A simple, distributed key-value store.
Stand up the service using:
docker compose up -d apiThen you can hit it with curl:
# add a key
curl -X PUT -d 'testing' https://localhost:443/v1/abc --insecure
# get the value for a key
curl -X GET https://localhost:443/v1/abc --insecure
# delete a key
curl -X DELETE https://localhost:443/v1/abc --insecureBelow will contain the required tooling and common commands for developing on this codebase.
- Install the Go toolchain with a version of at least the value specified in the go.mod.
- Install docker engine and docker compose. The easiest way to handle this is via docker desktop.
- Install golangci-lint for local linting and formatting.
Use the following to run tests:
go test -race ./...Use the following for code formatting:
golangci-lint fmtUse the following for code linting:
golangci-lint runBuild containers by running:
docker compose buildPull down updated containers with:
docker compose pullStand up the development deployment with:
docker compose up -d apiTear down the docker environment with:
docker compose downVarious items for cleanup.
- Improve README
- Create a TODO section
- Provide a thorough project description
- Provide useful code snippets for cli execution
- Document the API(s)
- Document prerequisites and general dev setup
- Set up CI
- Linting w/ golangci-lint
- Testing
- Report test coverage in PR and on project README
- Build docker container
- Bring in Just for encapsulating typical project commands
- Update Go + Deps
- Utilize multi-stage docker build
- Swap over to Postgres logger by default
- Restructure main for better configurability
- Add in env var/cli configuration setting
- Reconsider defaults
- Improve unit and integration testing
- Refactor to use standard Go project layouts
- Drop gorilla/mux for chi (https://github.com/go-chi/chi)
- Drop lib/pq for pgx (https://github.com/jackc/pgx)
- Improve logging and utilize context logging
- Swap over to sqlc instead of raw SQL (https://github.com/sqlc-dev/sqlc)
- Create an OpenAPI specification w/ validation
- Use codegen tooling to create your Chi router and service (https://github.com/oapi-codegen/oapi-codegen)
- Add a gRPC API
- Instrument for OpenTelemetry
- Utilize decorator patterns
- Utilize telemetry middleware
- Add healthz endpoints for service health checking
- Generate a valid cert via LetsEncrypt
- Utilize mtls termination between traefik and api services
- Enable SSL with Postgres
- Set up OpenTelemetry collectors + Grafana
- Utilize healthcheck endpoints