An in-memory key-value store with HTTP interface. https://code.ivysaur.me/tagserver
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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
mappu 3e8600a09e commit all archived files 5 years ago
dist-archive commit all archived files 5 years ago
doc commit all archived files 5 years ago
.legacy-codesite.toml initial meta commit 5 years ago
README.md commit all archived files 5 years ago

README.md

tagserver

An in-memory key-value store with HTTP interface.

This is a quick-and-dirty key-value store accessible over HTTP.

  • Both keys and values must be representable as a string.
  • Keys are split into two parts in order to optimise first-level list queries.
  • The underlying structure allows concurrent read queries, but a write will temporarily lock the storage against reads.
  • The data is asynchronously persisted to disk; after every write, a timestamp is sent to a background writer thread. If the writer's last write started before this timestamp, a new write action will be initiated.
  • Binaries are provided for win64, but the code is cross-platform Golang and should compile cleanly on other platforms.

Daemon

Usage of tagserver:
  -bindaddr string
        Bind address, can be blank
  -datafile string
        Persistence storage file (default "tagserver.json")
  -debug
        Display debug log on stdout
  -port int
        Port for web server (default 8080)

API

  • GET /get/KEY_FIRST/KEY_SECOND
  • GET /get/KEY_FIRST
  • POST /set/KEY_FIRST/KEY_SECOND

Example Usage

$ curl -X POST -d "thevalue" http://HOST/set/KEY_FIRST/KEY_SECOND
OK
$ curl http://HOST/get/KEY_FIRST/KEY_SECOND
thevalue
$ curl http://HOST/get/KEY_FIRST/
{"KEY_SECOND":"thevalue"}
$ curl http://HOST/get/KEY_FIRST/KEY_NOT_YET_SET
404 Not Found

Changelog

2015-10-08: r04