Beep backend handling of audio bites. Chopped up words spoken are uploaded into bite to be stored in a scan-able key-value store. Subscribes to new_bite and new_bite_user events from a NATS publisher.
go build && ./backend-bite
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 |
GET /conversation/:key/scan
Get a list of bite start times within a conversation key and specified timespan.
| Name |
Type |
Description |
| key |
String |
Audio bite's conversation's ID. |
| Name |
Type |
Description |
| from |
Epoch timestamp |
Time to start scanning from |
| to |
Epoch timestamp |
Time to scan to |
Content-Type: application/json
{
"previous": <Timestamp of bite before <starts>>,
"starts": [Timestamp, Timestamp...],
"next": <Timestamp of bite after <starts>>,
}
| Code |
Description |
| 400 |
Malformed input (from/to not timestamp, key not alphanumeric). |
| 500 |
NATs or protobuf serilisation encountered errors. |
GET /conversation/:key/start/:start
Get a specific bite.
| Name |
Type |
Description |
| key |
String |
Audio bite's conversation's ID. |
| start |
Epoch timestamp |
Time the audio bite starts. |
Raw audio data.
| Code |
Description |
| 400 |
start is not an uint/key is not an alphanumeric string/specified bite could not be found |
| 500 |
NATs or protobuf serilisation encountered errors. |
GET /conversation/:key/start/:start/user
Get a specific bite_user.
| Name |
Type |
Description |
| key |
String |
Audio bite's conversation's ID. |
| start |
Epoch timestamp |
Time the audio bite starts. |
Raw audio data.
| Code |
Description |
| 400 |
start is not an uint/key is not an alphanumeric string/specified bite could not be found |
| 500 |
NATs or protobuf serilisation encountered errors. |