An open API service indexing awesome lists of open source software.

https://github.com/flume-cloud-services/cache

Golang key/value Database via HTTP (by Flume Cloud Services)
https://github.com/flume-cloud-services/cache

cloud database golang http http-server json key-value self-hosted

Last synced: 3 months ago
JSON representation

Golang key/value Database via HTTP (by Flume Cloud Services)

Awesome Lists containing this project

README

          




# Cache
`Golang key/value Database` via **HTTP** (by Flume Cloud Services)

## Installation

### Docker

```bash
docker run -d -p 8080:8080 flumecloudservices/cache
```

### Manually

```bash
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
```

## Usage

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
```