0.6.2 • Published 5 years ago

vesild v0.6.2

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

VesilD

A very simple leaderboard service

  • RESTful (ish)
  • Redis Backed
  • Really Simple!

API

This is only sort of RESTful - don't @ me!

  • PATCH /leaderboard/:leaderboardKey/member/:memberKey

    Increments the score for a single member in a single leaderboard

    If the leaderboard does not exist then it is created

    If the member does not exist then it is created with score equal to points

    [
        {
            "path": "/points",
            "action": "increment",
            "value": (integer)
        }
     ]

    Returns a 200 response with body:

    {
         "member": (string),
         "leaderboard": (string),
         "points": (integer),
         "rank": (integer)
    }
  • PATCH /leaderboard/:leaderboardKey

    As above but allowing for the incrementing of multiple member points in a single leaderboard

    [
        {
             "path": "/member/:memberKey/points",
             "action": "increment",
             "value": (integer)
        },
        {
             "path": "/member/:memberKey/points",
             "action": "increment",
             "value": (integer)
        }
        ...
    ]
  • PATCH /member/:memberKey

    As above but allowing for the incrementing of multiple leaderboard points for a single member

    [
       {
           "path": "/leaderboard/:leaderboardKey/points",
           "action": "increment",
           "value": (integer)
       },
       {
           "path": "/leaderboard/:leaderboardKey/points",
           "action": "increment",
           "value": (integer)
       }
       ...
    ]
  • GET /leaderboard/:leaderboardKey?from=x&to=y

    Get a list of members in a leaderboard from position x to y

    First position is position x

    If not provided the x = 1, y = 10

    [
       {
          "member": (string),
          "leaderboard": (string),
          "points": (integer),
          "rank": (integer)
       },    
       {
          "member": (string),
          "leaderboard": (string),
          "points": (integer),
          "rank": (integer)
       },
       ...
    ]
  • GET /leaderboard/:leaderboardKey?includeMember=:id

    Includes the position of a member in the result set.

    To return just the position of this member pass from=0&to=0

    [
       {
          "member": (string),
          "leaderboard": (string),
          "points": (integer),
          "rank": (integer)
       },
       {
          "member": (string),
          "leaderboard": (string),
          "points": (integer),
          "rank": (integer)
       }
       ...
    ]
  • GET /member/:memberKey

    Gets a list of all leaderboards the member is part of

     [
       {
         "member": (string),
         "leaderboard": (string),
         "points": (integer),
         "rank": (integer)
       },    
       {
         "member": (string),
         "leaderboard": (string),
         "points": (integer),
         "rank": (integer)
       },
       ...
     ]
  • DELETE /leaderboard/:leaderboardKey/member/:memberKey

    Deletes a value by leaderboard and member keys

    Returns 204 on success

0.6.2

5 years ago

0.6.1

5 years ago

0.6.0

5 years ago

0.5.1

5 years ago

0.5.0

5 years ago

0.4.0

5 years ago

0.3.6

5 years ago

0.3.5

5 years ago

0.3.4

5 years ago

0.3.3

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.1

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago