v0.1.3
- Replace uv/ruff/pytest with Go setup, golangci-lint, go test - Library-only: lint + test + release (tag) + notify, no Docker build
handler-base
Go module providing shared infrastructure for NATS-based handler services.
Packages
| Package | Purpose |
|---|---|
config |
Environment-based configuration via struct fields |
health |
HTTP health/readiness server for Kubernetes probes |
natsutil |
NATS/JetStream client with msgpack serialization |
telemetry |
OpenTelemetry tracing and metrics setup |
clients |
HTTP clients for LLM, embeddings, reranker, STT, TTS |
handler |
Base Handler runner wiring NATS + health + telemetry |
Usage
package main
import (
"context"
"git.daviestechlabs.io/daviestechlabs/handler-base/config"
"git.daviestechlabs.io/daviestechlabs/handler-base/handler"
"github.com/nats-io/nats.go"
)
func main() {
cfg := config.Load()
cfg.ServiceName = "my-service"
h := handler.New("my.subject", cfg)
h.OnMessage(func(ctx context.Context, msg *nats.Msg, data map[string]any) (map[string]any, error) {
return map[string]any{"ok": true}, nil
})
h.Run()
}
Testing
go test ./...
Languages
Go
100%