https://github.com/ikeikeikeike/redisank
A common ranking system on Redis with Plug.
https://github.com/ikeikeikeike/redisank
elixir redis
Last synced: 3 months ago
JSON representation
A common ranking system on Redis with Plug.
- Host: GitHub
- URL: https://github.com/ikeikeikeike/redisank
- Owner: ikeikeikeike
- License: mit
- Created: 2016-12-03T12:55:54.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-01-25T17:49:21.000Z (over 8 years ago)
- Last Synced: 2024-09-26T00:26:52.673Z (9 months ago)
- Topics: elixir, redis
- Language: Elixir
- Homepage:
- Size: 7.81 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Redisank
A common ranking system on Redis with Plug
## Installation
If [available in Hex](https://hex.pm/docs/publish), the package can be installed as:
1. Add `redisank` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[{:redisank, "~> 0.1.0"}]
end
```2. Ensure `redisank` is started before your application:
```elixir
def application do
[applications: [:redisank]]
end
``````elixir
Ranking.top :weekly
Ranking.top :monthly
Ranking.top :quarterly
Ranking.top :biannually
Ranking.top :yearly
Ranking.top :allfrom = :calendar.local_time
Ranking.del from, to, :daily
Ranking.del from, to, :weekly
Ranking.del from, to, :monthlyRanking.sum :weekly
Ranking.sum :monthly
Ranking.sum :quarterly
Ranking.sum :biannually
Ranking.sum :yearly
Ranking.sum :all
```optional
```elixir
plug Redisank.Plug.Access, [key: "id"] when action in [:show]
```