Giter Site home page Giter Site logo

exhammer / hammer-plug Goto Github PK

View Code? Open in Web Editor NEW
61.0 3.0 8.0 63 KB

A plug to apply rate-limiting with Hammer

Home Page: https://hexdocs.pm/ExHammer/hammer-plug

License: MIT License

Elixir 100.00%
elixir plug throttling elixir-lang elixir-library phoenix rate-limiting

hammer-plug's Introduction

Hammer.Plug

Build Status Hex.pm Documentation Total Download License

Hammer is a rate-limiter for Elixir, with pluggable storage backends.

This library is a plug helper, to easily add rate-limiting to Phoenix applications, or any Elixir system that uses plug.

Example:

# Allow ten uploads per 60 seconds
plug Hammer.Plug, [
  rate_limit: {"video:upload", 60_000, 10},
  by: {:session, :user_id}
] when action == :upload_video_file

def upload_video_file(conn, _opts) do
  # ...
end

Documentation

See the Hammer documentation page for more info on Hammer itself.

See the Hammer.Plug docs for more info about this library and how to use it, specifically the Hammer.Plug module.

Installation

Hammer-Plug is avaliable available in Hex, the package can be installed by adding hammer_plug to your list of dependencies in mix.exs:

def deps do
  [
    {:hammer, "~> 6.0"},
    {:hammer_plug, "~> 3.0"}
  ]
end

hammer-plug's People

Contributors

blatyo avatar dependabot[bot] avatar epinault avatar junekelly avatar mathiasose avatar rmoorman avatar smaximov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

hammer-plug's Issues

bump hammer deps to ~>6.0

Otherwise this plug is not usable

Failed to use "hammer" (version 6.0.0) because
  hammer_plug (version 1.0.0) requires ~> 5.0
  mix.exs specifies ~> 6.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.