A caching service developed in Go. It provides REST APIs to access key-value pairs stored in Couchbase.
You may also consider using couchcache as a mocked service when doing TDD.
Run couchcache with Couchbase server (host and port) and bucket (name and password) information
./couchcache --host=HOST --port=PORT --bucket=BUCKET --pass=PASS
./couchcache --host=10.99.107.192 --port=8091 --bucket=cachebucket --pass=c@che1t
host: localhost
port: 8091
bucket: couchcache
pass: password
http://HOST:8080/key/KEY
http://10.99.107.190:8080/key/customer_555
http://10.99.107.190:8080/key/the_service_i_want_to_mock-endpoint_a, if you're mocking other service's endpoint
- request
- send
POSTrequest to endpoint with data in body - optionally set TTL by
?ttl=TTL_IN_SEC
- send
- response
HTTP 201 Createdif storedHTTP 400 Bad Requestif key or value is invalid
- request
- send
GETrequest to endpoint
- send
- response
HTTP 200 OKwith data in bodyHTTP 404 Not Foundif key doesn't existHTTP 400 Bad Requestif key is invalid
- request
- send
DELETErequest to endpoint
- send
- response
HTTP 204 No Contentif deletedHTTP 404 Not Foundis key doesn't existHTTP 400 Bad Requestif key is invalid
- request
- send
PUTrequest to endpoint with data in body
- send
- response
HTTP 200 OKif appendedHTTP 404 Not Foundif key doesn't existHTTP 400 Bad Requestif key or value is invalid
- Max key length is 250 bytes
- Max value size is 20 MB
See Couchbase Limits.
couchcache is distributed under the terms of the MIT license. See LICENSE for details.