5
0
Fork 0
Single Badger store to serve bite, transcription and any others.
 
 
Go to file
Daniel Lim 01a6b678ab Added backend-protobuf as submodule 2019-06-23 08:44:23 +08:00
backend-protobuf@a36ddf9a81 Added backend-protobuf as submodule 2019-06-23 08:44:23 +08:00
.env Use env for config instead of flags 2019-02-18 23:43:49 +08:00
.gitignore Initial commit 2019-02-13 22:45:23 +08:00
.gitmodules Added backend-protobuf as submodule 2019-06-23 08:44:23 +08:00
Dockerfile Use env for config instead of flags 2019-02-18 23:43:49 +08:00
README.md Use env for config instead of flags 2019-02-18 23:43:49 +08:00
go.mod Use env for config instead of flags 2019-02-18 23:43:49 +08:00
go.sum Use env for config instead of flags 2019-02-18 23:43:49 +08:00
key.go Initial commit 2019-02-13 22:45:23 +08:00
main.go Added backend-protobuf as submodule 2019-06-23 08:44:23 +08:00

README.md

backend-store

Single Badger store to serve bite, transcription and any others. Is kinda bite-centric, so required values revolve around a Bite. Transacts through NATS.

Environment Variables

Supply environment variables by either exporting them or editing .env.

ENV Description Default
DBPATH Path to store badger files in. Please make sure it exists. /tmp/badger
NATS Host and port of nats nats://localhost:4222

Key format

Takes in three variables: type, key and start. Type is the type of data to be inserted, e.g. bite, bite_user or transcription. Key could be some secret passphrase declaring you the Raj of British India for all I know. Start is the Epoch timestamp of the start of the Bite.

NATS

Refer to protobuf definitions in backend-protobuf.

Name What you do Accepted Protobuf Protobuf redundant fields Response Protobuf Response empty fields
new_store Publish to Store - - -
request_store Request DataRequest - Response client
scan_store Request ScanRequest - Response client

new_store

Pushes the results of its operation to backend-subscribe.

Code Message Description
200 Inserted bite's key Store operation was successful
400 400 Bad Request Key could not be marshalled properly
500 500 Internal Server Error Error storing the bite in badger