Skip to content

Team-Fuho/shiroko

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

shiroko

shiroko is a HTTP microservice for record a leaderboard (in this case, used for a donation board... and wisely hardcoded for it) with a conventional HTTP interface

Dependency

  • redis

Service

Bootup

  1. Configuration

reference: https://rocket.rs/v0.5-rc/guide/configuration/#configuration

  1. Configurable keys

HTTP Specs

1. Get a list

  • request
GET / HTTP/1.1
  • response schema
interface Schema {
  Err?: string;
  Ok: {
    who: string;
    did: number;
  }[];
}

2. Add amount to entry

  • request
PUT / HTTP/1.1
Content-Type: application/json

{
  "who": "string",
  "did": 1000
}
  • response schema
interface Schema {
  Err?: string;
  Ok: number;
}

3. Force set entry

  • request
POST / HTTP/1.1
Content-Type: application/json

{
  "who": "string",
  "did": 1000
}
  • response schema
interface Schema {
  Err?: string;
  Ok: number;
}

4. Move amount, then set 0 to user in from

PATCH / HTTP/1.1
Content-Type: application/json

{
  "from": "jane",
  "to": "john"
}
  • response schema
interface Schema {
  Err?: string;
  Ok: number;
}

About

Conventionally use for sorted KV

Topics

Resources

License

Stars

Watchers

Forks

Languages