api-core.go

module
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: MIT

README

api-core.go

CI Coverage License Issues PRs Dependabot

Shared HTTP API building blocks for sweetrpg's Go services: query-string parsing into paging/sort/filter/projection params, conversion of those params into MongoDB BSON filters, OpenTelemetry tracing setup, health/ping handlers, and common response value objects.

Install

go get github.com/sweetrpg/api-core.go

Packages

  • util - GetQueryParams (parses a JSON:API-style query string) and ConvertQueryParams (turns those params into MongoDB filter/sort/projection bson.D documents)
  • tracing - SetupTracing/TeardownTracing and BuildSpanWithParams (OpenTelemetry)
  • server - HealthHandler/PingHandler for status endpoints
  • vo - shared response value objects (ErrorVO, PingResponseVO, HealthResponseVO)
  • constants - environment variable names used by the packages above

Documentation

Package documentation: pkg.go.dev/github.com/sweetrpg/api-core.go. Test coverage reports are published to sweetrpg.github.io/api-core.go 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 featureflags provides a shared client for evaluating feature flags against the flagd sidecar injected into a pod by the OpenFeature Operator.
Package featureflags provides a shared client for evaluating feature flags against the flagd sidecar injected into a pod by the OpenFeature Operator.
Package ratelimit implements the platform-wide, Redis-backed, per-client, per-route-tier request rate limiter for sweetrpg Go HTTP services.
Package ratelimit implements the platform-wide, Redis-backed, per-client, per-route-tier request rate limiter for sweetrpg Go HTTP services.

Jump to

Keyboard shortcuts

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