5
0
Fork 0
Beep backend accepts PUT requests and publishes them to NAT queue.
 
 
Go to file
UnicodingUnicorn 3f8f28dd99 Initial commit 2019-02-06 13:26:35 +08:00
.gitignore Initial commit 2019-02-06 13:26:35 +08:00
README.md Initial commit 2019-02-06 13:26:35 +08:00
bite.pb.go Initial commit 2019-02-06 13:26:35 +08:00
main.go Initial commit 2019-02-06 13:26:35 +08:00

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. Needless to say, relies on a NATS instance being up.

Quickstart

go build && ./backend-publish

Flags

Flags are supplied to the compiled go program in the form -flag=stuff.

Flag Description Default
listen Port number to listen on 8080
nats URL of NATS nats://localhost:4222

API

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
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
500 Error serialising data into a protocol buffer.