Beep backend accepts PUT requests and publishes them to NAT queue.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Daniel Lim 42e1b651d4 Copy backend-protobuf/go in Dockerfile 4 years ago
backend-protobuf@a36ddf9a81 Added backend-protobuf as submodule 4 years ago
.env Use env for config instead of flags 4 years ago
.gitignore Initial commit 4 years ago
.gitmodules Added backend-protobuf as submodule 4 years ago
Dockerfile Copy backend-protobuf/go in Dockerfile 4 years ago
README.md backend-auth integration 4 years ago
go.mod Tidied go.mod of unused dependencies 4 years ago
go.sum Tidied go.mod of unused dependencies 4 years ago
main.go Added backend-protobuf as submodule 4 years ago

README.md

backend-publish

Beep backend accepts PUT requests and publishes a protobuf-ed version to a NATS queue, like some sort of weird HTTP/NATS converter. Also handles authentication of said HTTP requests. Needless to say, relies on a NATS instance being up.

To run this service securely means to run it behind traefik forwarding auth to backend-auth

Quickstart

go build && ./backend-publish

Environment Variables

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

ENV Description Default
LISTEN Host and port number to listen on :8080
NATS Host and port of nats nats://localhost:4222
SECRET JWT secret secret

API

All requests need to be passed through traefik calling backend-auth as Forward Authentication. Otherwise, populate X-User-Claim with:

{
  "userid": "<userid>",
  "clientid": "<clientid"
}

Put Bite

PUT /conversation/:key/start/:start

TODO: Description of what this does cos honestly I have no idea Ambrose doesn't write documentation

URL Params

Name Type Description
key String Audio bite's conversation's ID.
start Epoch timestamp Time the audio bite starts.

Body

Raw body of audio data in bytes.

Success (200 OK)

Empty body.

Errors

Code Description
400 start is not an uint/key is not an alphanumeric string/data could not be read from the body/bad user claim
500 Error serialising data into a protocol buffer.

Put Bite User

PUT /conversation/:key/start/:start/user

TODO: Description of what this does cos honestly I have no idea Ambrose doesn't write documentation

URL Params

Name Type Description
key String Audio bite's conversation's ID.
start Epoch timestamp Time the audio bite starts.

Body

Raw body of audio data in bytes.

Success (200 OK)

Empty body.

Errors

Code Description
400 start is not an uint/key is not an alphanumeric string/data could not be read from the body/bad user claim
500 Error serialising data into a protocol buffer.