Golang key/value Database
via HTTP (by Flume Cloud Services)
docker run -d -p 8080:8080 flumecloudservices/cache
mkdir $GOPATH/src/github.com/flume-cloud-services && cd $GOPATH/src/github.com/flume-cloud-services
git clone https://github.com/flume-cloud-services/cache.git && cd cache
go get -d -v
go install -v
FLUME_CACHE_ADMIN=admin_name FLUME_CACHE_SECRET=secret_token cache
Use the signin
route with the following body to generate the JWT token :
POST /signin
Body:
- name: The admin name given in FLUME_CACHE_ADMIN by default it's simply "admin"
Return:
- If success :
- A JWT Token
- The cookie with the previously generated JWT Token
- If failed :
- Unauthorized Status
- Bad request Status
Check if the jwt is correctly generated by visiting welcome
route :
GET /welcome
Return:
- If success :
- Welcome to you visitor !
- If failed :
- Unauthorized Status
Then insert data using the /insert
route :
POST /insert
Body:
- key: The key name to access the given value
- value: The value of the key
Return:
- If success :
- Data succesfully inseted
- If failed :
- Bad Request Status
- Internal Server Error Status
Finally get this data using the /get
route :
POST /get
Body:
- key: the key of the desired data
Return:
- If success :
- The desired data
- If failed :
- Bad Request Status
- Internal Server Error Status