catalog-api

module
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2026 License: MIT

README

SweetRPG Catalog API

CI Coverage License Issues PRs Dependabot Deployment

HTTP microservice for the SweetRPG Catalog domain (licenses, volumes, contributions, persons, publishers, reviews, studios, systems). A thin Gin-based layer: server/*.go wires JSON:API routes to catalog-data.go's data-access functions.

Run locally

scripts/run-docker-local.sh

Brings up the service plus its MongoDB and Redis dependencies via docker/docker-compose.yml. Swagger UI is served at /swagger/index.html once running.

Known gaps

  • catalog-data.go's Volume entity is the only one with a write path, and Update/Delete are still // TODO stubs there. Every other entity is read-only.
  • No test coverage in server/ or cmd/ yet.

Documentation

Package documentation: pkg.go.dev/github.com/sweetrpg/catalog-api.

Swagger UI (swaggo/swag + gin-swagger, generated from handler annotations, not hand-written): api.catalog.dev.sweetrpg.com/swagger/index.html in dev, or /swagger/index.html against whatever host you're running locally.

Test coverage reports are published to sweetrpg.github.io/catalog-api/coverage.html on every merge to develop.

Contributing

See CONTRIBUTING.md for the development workflow and RELEASE.md for how versions get cut.

Directories

Path Synopsis
Package cachettl resolves the cache TTL for a given route group, loaded once at startup from the CACHE_TTLS env var so slower-changing entities and faster-changing ones aren't forced onto the same cache policy.
Package cachettl resolves the cache TTL for a given route group, loaded once at startup from the CACHE_TTLS env var so slower-changing entities and faster-changing ones aren't forced onto the same cache policy.
cmd
catalog-api command
Package docs Code generated by swaggo/swag.
Package docs Code generated by swaggo/swag.
Package ratelimit implements a Redis-backed, per-client, per-route-tier request rate limiter.
Package ratelimit implements a Redis-backed, per-client, per-route-tier request rate limiter.
Package readiness tracks the reachability of backend dependencies (beyond Mongo, which api-core.go's HealthHandler already covers) so /status/health can fail loud instead of the service silently degrading to an uncached or unlimited mode.
Package readiness tracks the reachability of backend dependencies (beyond Mongo, which api-core.go's HealthHandler already covers) so /status/health can fail loud instead of the service silently degrading to an uncached or unlimited mode.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL