code.ivysaur.me

tagserver

buildbuildsuccesssuccess written inwritten ingolanggolang

ABOUT
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
• Initial public release

CONTACT

For bug reports, feature requests, or if you need any help, please click here to email me.