Pronounced Yuu-Kiv. A simple key-value server that uses redb for persistence.
- --port: The port to listen on. Defaults to 9958 (YWKV via T9 keyboard).
- --table-name: The name of the
redb
table to use. Defaults tomain
. - --db-file-name: The name of the
redb
file to read/write on disk. Defaults toywkv.redb
. - token: The bearer auth token to check GET/POST requests against. Required.
ywkv [--port value] [--table-name value] [--db-file-name value] <token>
All requests should be in format address/:key
. Value payloads are passed as text.
Request:
curl -X POST -H "Authorization: Bearer hello" localhost:9958/hello -d "world" | jq -C
Response (200):
{
"value": "",
"status": "SuccessNew"
}
Request:
curl -X GET -H "Authorization: Bearer hello" localhost:9958/hello | jq -C
Response (200):
{
"value": "world",
"status": "Found"
}
Request:
curl -X GET -H "Authorization: Bearer hello" localhost:9958/hello | jq -C
Response (500):
{
"value": "Table 'main' does not exist",
"status": "Failure"
}
Request:
curl -X POST -H "Authorization: Bearer hello" localhost:9958/hello -d "world" | jq -C
Response (200):
{
"value": "world",
"status": "SuccessOverwrite"
}
Request:
curl -X GET -H "Authorization: Bearer hello" localhost:9958/missing | jq -C
Response (404):
{
"value": "",
"status": "Missing"
}