this is a simple prototype of a key value (string -> string) storage service. Build to practice Go stdlib and idiomatic code style, mainly interfaces. Currently, only in-memory storage is implemented.
# start the service
go run cmd/main.go
this service listens on port 8080 and provides /storage
endpoint to store and retrieve key-value pairs (via POST & GET
http methods).
curl -X POST --location "http://127.0.0.1:8080/storage" \
-d '{
"key": "number",
"value": "42"
}'
{"key":"number","value":"42"}
curl -X GET --location "http://127.0.0.1:8080/storage?key=number"
{"key":"number","value":"42"}
you can use GoReleaser to build the binary.
goreleaser build --clean --snapshot --clean