Directories
¶
| Path | Synopsis |
|---|---|
|
Package apitest provides helpers for end-to-end HTTP tests that drive a real application handler through an httptest.Server.
|
Package apitest provides helpers for end-to-end HTTP tests that drive a real application handler through an httptest.Server. |
|
Package app holds the application assembly layer of the SDK.
|
Package app holds the application assembly layer of the SDK. |
|
Package auditlog records a versioned audit trail of model changes and answers history and diff queries over it.
|
Package auditlog records a versioned audit trail of model changes and answers history and diff queries over it. |
|
auditbus
Package auditbus records audit entries from events on the in-process eventbus, decoupling producers from the audit core: a producer publishes an Event on the bus and Register subscribes the audit core to consume it, so a domain package can request an audit write without importing auditlog.
|
Package auditbus records audit entries from events on the in-process eventbus, decoupling producers from the audit core: a producer publishes an Event on the bus and Register subscribes the audit core to consume it, so a domain package can request an audit write without importing auditlog. |
|
auditpg
Package auditpg is the Postgres implementation of auditlog.Store.
|
Package auditpg is the Postgres implementation of auditlog.Store. |
|
auditqueue
Package auditqueue is a durable, queue-backed auditlog.Recorder: Record enqueues the audit entry onto a skit queue (one cheap INSERT on the request path) and the workers of the queue (NewWorkers) drain it into the audit core.
|
Package auditqueue is a durable, queue-backed auditlog.Recorder: Record enqueues the audit entry onto a skit queue (one cheap INSERT on the request path) and the workers of the queue (NewWorkers) drain it into the audit core. |
|
auditrest
Package auditrest is the REST integration for auditlog: a read-side handler group (history / diff / changes) mountable on any skit router in one call.
|
Package auditrest is the REST integration for auditlog: a read-side handler group (history / diff / changes) mountable on any skit router in one call. |
|
Package auth provides authentication and authorization building blocks: a transport-neutral Principal carried in context, credential extraction from HTTP requests, a pluggable Verifier (token -> Principal), a built-in JWT verifier, and net/http middleware for authentication and role-based access control.
|
Package auth provides authentication and authorization building blocks: a transport-neutral Principal carried in context, credential extraction from HTTP requests, a pluggable Verifier (token -> Principal), a built-in JWT verifier, and net/http middleware for authentication and role-based access control. |
|
Package broker abstracts an event broker behind transport-agnostic Publisher and Consumer contracts.
|
Package broker abstracts an event broker behind transport-agnostic Publisher and Consumer contracts. |
|
internal/brokertrace
Package brokertrace records the send span of the broker adapters.
|
Package brokertrace records the send span of the broker adapters. |
|
internal/consume
Package consume is the consumer core of the broker adapters: it decodes a delivery, runs the handler under panic recovery and records the handling as a span and in the skit_broker_* metrics.
|
Package consume is the consumer core of the broker adapters: it decodes a delivery, runs the handler under panic recovery and records the handling as a span and in the skit_broker_* metrics. |
|
kafka
Package kafka is the Apache Kafka adapter for the skit broker abstraction.
|
Package kafka is the Apache Kafka adapter for the skit broker abstraction. |
|
rabbitmq
Package rabbitmq implements the broker abstraction over RabbitMQ.
|
Package rabbitmq implements the broker abstraction over RabbitMQ. |
|
Package chx is a thin ClickHouse client for analytics and long-term stores.
|
Package chx is a thin ClickHouse client for analytics and long-term stores. |
|
Package closer manages graceful shutdown of resources.
|
Package closer manages graceful shutdown of resources. |
|
cmd
|
|
|
skit
command
Command skit scaffolds and manages skit-based services.
|
Command skit scaffolds and manages skit-based services. |
|
Package config standardizes 12-factor configuration on jessevdk/go-flags: a single options struct whose fields carry `long`/`env`/`default`/`description` tags, so the same definition drives CLI flags, environment variables, and `--help`.
|
Package config standardizes 12-factor configuration on jessevdk/go-flags: a single options struct whose fields carry `long`/`env`/`default`/`description` tags, so the same definition drives CLI flags, environment variables, and `--help`. |
|
Package cron runs jobs on a wall-clock schedule as a supervised worker.Runnable.
|
Package cron runs jobs on a wall-clock schedule as a supervised worker.Runnable. |
|
Package dbtest is a lightweight way to run Postgres in Docker for tests: one call starts a disposable container (via testcontainers), hands back an open, migrated pool, and removes the container when the test is done.
|
Package dbtest is a lightweight way to run Postgres in Docker for tests: one call starts a disposable container (via testcontainers), hands back an open, migrated pool, and removes the container when the test is done. |
|
Package dbx provides SQL helpers on top of jmoiron/sqlx and database/sql: a pool and a transaction behind one Querier, query and exec helpers, transactions that open on a pool and join on a transaction, and bulk insert.
|
Package dbx provides SQL helpers on top of jmoiron/sqlx and database/sql: a pool and a transaction behind one Querier, query and exec helpers, transactions that open on a pool and join on a transaction, and bulk insert. |
|
pg
Package pg opens a Postgres pool for dbx through the pgx driver, with query tracing, pool metrics and a Classifier of Postgres error codes.
|
Package pg opens a Postgres pool for dbx through the pgx driver, with query tracing, pool metrics and a Classifier of Postgres error codes. |
|
sqlite
Package sqlite opens a SQLite pool for dbx through a driver the caller registers, modernc.org/sqlite by default, with a Classifier of SQLite result codes.
|
Package sqlite opens a SQLite pool for dbx through a driver the caller registers, modernc.org/sqlite by default, with a Classifier of SQLite result codes. |
|
Package debugsrv serves operational endpoints — net/http/pprof profiles plus optional metrics and health handlers — on a separate, internal-only listener or as a handler attached to an existing router.
|
Package debugsrv serves operational endpoints — net/http/pprof profiles plus optional metrics and health handlers — on a separate, internal-only listener or as a handler attached to an existing router. |
|
Package dim is a slim, generics-based dependency-injection toolkit: lazy providers and managed resources built from plain functions, with structured logging of initialization and cleanup.
|
Package dim is a slim, generics-based dependency-injection toolkit: lazy providers and managed resources built from plain functions, with structured logging of initialization and cleanup. |
|
Package errs provides a single, transport-agnostic error type with stable codes, an HTTP (and later gRPC) status mapping, errors of invalid input fields, and automatic redaction of secrets in user-facing messages.
|
Package errs provides a single, transport-agnostic error type with stable codes, an HTTP (and later gRPC) status mapping, errors of invalid input fields, and automatic redaction of secrets in user-facing messages. |
|
Package eventbus is an in-process, synchronous event bus for decoupling domain packages that cannot import one another (avoiding import cycles).
|
Package eventbus is an in-process, synchronous event bus for decoupling domain packages that cannot import one another (avoiding import cycles). |
|
Package grpcgateway builds a grpc-gateway as a plain http.Handler, so the JSON/HTTP transport runs as just another brick of the server kit — wrapped by httpserver and supervised in the same worker.Group as the gRPC and REST servers.
|
Package grpcgateway builds a grpc-gateway as a plain http.Handler, so the JSON/HTTP transport runs as just another brick of the server kit — wrapped by httpserver and supervised in the same worker.Group as the gRPC and REST servers. |
|
Package grpcserver bootstraps a gRPC server with the SDK's cross-cutting concerns and exposes it as a worker.Runnable.
|
Package grpcserver bootstraps a gRPC server with the SDK's cross-cutting concerns and exposes it as a worker.Runnable. |
|
Package grpctest spins up an in-memory gRPC server for tests, the gRPC counterpart of apitest.
|
Package grpctest spins up an in-memory gRPC server for tests, the gRPC counterpart of apitest. |
|
Package health provides liveness and readiness HTTP handlers suitable for Kubernetes probes.
|
Package health provides liveness and readiness HTTP handlers suitable for Kubernetes probes. |
|
Package httpclient builds configured *http.Client values for calling upstream services, and helps consume their JSON responses.
|
Package httpclient builds configured *http.Client values for calling upstream services, and helps consume their JSON responses. |
|
Package httplog writes the access log of an HTTP server: one record per request, through the application's own *slog.Logger, so access lines share its output, level, trace correlation and sinks.
|
Package httplog writes the access log of an HTTP server: one record per request, through the application's own *slog.Logger, so access lines share its output, level, trace correlation and sinks. |
|
Package httpmw provides outbound HTTP-client middleware: composable http.RoundTripper wrappers for resilient calls to upstream services.
|
Package httpmw provides outbound HTTP-client middleware: composable http.RoundTripper wrappers for resilient calls to upstream services. |
|
Package httpserver is the standard-library-idiomatic core of the server kit: a worker.Runnable that serves any http.Handler on its own listener with graceful shutdown.
|
Package httpserver is the standard-library-idiomatic core of the server kit: a worker.Runnable that serves any http.Handler on its own listener with graceful shutdown. |
|
Package i18n is a thin wrapper over nicksnyder/go-i18n that loads message catalogs from an fs.FS (typically an embed.FS), resolves the request language from an Accept-Language header, and localizes *errs.Error messages by their MessageID/Code with Args as template data.
|
Package i18n is a thin wrapper over nicksnyder/go-i18n that loads message catalogs from an fs.FS (typically an embed.FS), resolves the request language from an Accept-Language header, and localizes *errs.Error messages by their MessageID/Code with Args as template data. |
|
internal
|
|
|
brokertest
Package brokertest starts the brokers of the skit tests in containers — RabbitMQ and a single-node Kafka — pauses a container to stand for a broker that stops answering, and packs messages in an envelope other than CloudEvents.
|
Package brokertest starts the brokers of the skit tests in containers — RabbitMQ and a single-node Kafka — pauses a container to stand for a broker that stops answering, and packs messages in an envelope other than CloudEvents. |
|
httpw
Package httpw provides a single canonical http.ResponseWriter proxy shared by every middleware that needs to observe a response.
|
Package httpw provides a single canonical http.ResponseWriter proxy shared by every middleware that needs to observe a response. |
|
pgschema
Package pgschema provisions the Postgres tables of the SDK storage packages at startup and derives the advisory-lock keys of the SDK.
|
Package pgschema provisions the Postgres tables of the SDK storage packages at startup and derives the advisory-lock keys of the SDK. |
|
prom
Package prom holds the Prometheus helpers the SDK packages share: register-or-get, the bucket bounds of durations, the exemplar of a duration and the metrics of the runs of periodic work.
|
Package prom holds the Prometheus helpers the SDK packages share: register-or-get, the bucket bounds of durations, the exemplar of a duration and the metrics of the runs of periodic work. |
|
runspan
Package runspan records a run of periodic work — a worker tick, a cron run — as the root span of its own trace.
|
Package runspan records a run of periodic work — a worker tick, a cron run — as the root span of its own trace. |
|
Package lock provides distributed mutual exclusion for work that must run on at most one replica at a time — most commonly a scheduled job (see the cron package and `skit add cron`).
|
Package lock provides distributed mutual exclusion for work that must run on at most one replica at a time — most commonly a scheduled job (see the cron package and `skit add cron`). |
|
Package logger builds the service's *slog.Logger: a JSON handler chain that correlates every record with the active trace, tags it with the service identity, and can fire side-effect hooks per level.
|
Package logger builds the service's *slog.Logger: a JSON handler chain that correlates every record with the active trace, tags it with the service identity, and can fire side-effect hooks per level. |
|
Package metrics is the one Prometheus registry of a process: the base preset, the HTTP server metrics and the scrape handler.
|
Package metrics is the one Prometheus registry of a process: the base preset, the HTTP server metrics and the scrape handler. |
|
Package middleware provides standard net/http server middleware for skit services.
|
Package middleware provides standard net/http server middleware for skit services. |
|
Package migrate applies SQL schema migrations from an embedded filesystem.
|
Package migrate applies SQL schema migrations from an embedded filesystem. |
|
Package order describes the ordering of a list query: a By value (an allowlisted field name + an ASC/DESC direction) and a Parse that builds one from untrusted "field,direction" request input.
|
Package order describes the ordering of a list query: a By value (an allowlisted field name + an ASC/DESC direction) and a Parse that builds one from untrusted "field,direction" request input. |
|
Package otel is the OpenTelemetry API of skit: tracers for SDK packages, span errors, suppression of background traces and W3C trace context propagation.
|
Package otel is the OpenTelemetry API of skit: tracers for SDK packages, span errors, suppression of background traces and W3C trace context propagation. |
|
otlp
Package otlp builds the OTLP/gRPC span exporter for otel/setup.
|
Package otlp builds the OTLP/gRPC span exporter for otel/setup. |
|
setup
Package setup installs the OpenTelemetry SDK of a process: the TracerProvider, the Resource, the sampler, the propagator and the OTel diagnostics.
|
Package setup installs the OpenTelemetry SDK of a process: the TracerProvider, the Resource, the sampler, the propagator and the OTel diagnostics. |
|
Package outbox publishes domain events to a message broker through a queue of events: an event is a task of the queue package, scheduled in the transaction of its domain change and published by the workers of its queue.
|
Package outbox publishes domain events to a message broker through a queue of events: an event is a task of the queue package, scheduled in the transaction of its domain change and published by the workers of its queue. |
|
Package page provides a small, validated value for query paging, shared by the transport (parsing ?page=/?rows= or gRPC fields) and the store (binding :offset / :rows_per_page).
|
Package page provides a small, validated value for query paging, shared by the transport (parsing ?page=/?rows= or gRPC fields) and the store (binding :offset / :rows_per_page). |
|
Package poller maintains a single "current value" that is refreshed by periodically calling a Getter.
|
Package poller maintains a single "current value" that is refreshed by periodically calling a Getter. |
|
provider
|
|
|
postgres
Package postgres provides a ready Postgres connection pool for dim: Resource opens it with pg.Open, checks it is reachable and closes it on shutdown.
|
Package postgres provides a ready Postgres connection pool for dim: Resource opens it with pg.Open, checks it is reachable and closes it on shutdown. |
|
redis
Package redis provides a ready Redis client (github.com/redis/go-redis) for dim: Resource opens it, checks it with a PING and closes it on shutdown.
|
Package redis provides a ready Redis client (github.com/redis/go-redis) for dim: Resource opens it, checks it with a PING and closes it on shutdown. |
|
sentry
Package sentry initializes the Sentry SDK (github.com/getsentry/sentry-go) for dim: Resource initializes it, returns the current Hub and flushes the buffered events on shutdown.
|
Package sentry initializes the Sentry SDK (github.com/getsentry/sentry-go) for dim: Resource initializes it, returns the current Hub and flushes the buffered events on shutdown. |
|
translator
Package translator provides a ready i18n.Translator for dim: Resource builds it from the message files of the service.
|
Package translator provides a ready i18n.Translator for dim: Resource builds it from the message files of the service. |
|
Package queue runs durable background work with at-least-once delivery, safe for concurrent workers across goroutines and replicas.
|
Package queue runs durable background work with at-least-once delivery, safe for concurrent workers across goroutines and replicas. |
|
Package rest is a tiny typed-handler layer over net/http.
|
Package rest is a tiny typed-handler layer over net/http. |
|
jsonapi
Package jsonapi encodes rest responses as JSON:API documents (application/vnd.api+json) with github.com/hashicorp/jsonapi.
|
Package jsonapi encodes rest responses as JSON:API documents (application/vnd.api+json) with github.com/hashicorp/jsonapi. |
|
mid
Package mid provides application-layer middleware: rest.MidFunc values that wrap a typed rest.HandlerFunc and operate on the ResponseEncoder it returns (the typed value), not on raw bytes.
|
Package mid provides application-layer middleware: rest.MidFunc values that wrap a typed rest.HandlerFunc and operate on the ResponseEncoder it returns (the typed value), not on raw bytes. |
|
router
Package router wraps the standard library's net/http.ServeMux with nestable groups and two cooperating handler/middleware layers: net/http transport middleware and typed rest application middleware.
|
Package router wraps the standard library's net/http.ServeMux with nestable groups and two cooperating handler/middleware layers: net/http transport middleware and typed rest application middleware. |
|
Package retry runs an operation again on failure, with exponential backoff, optional jitter, a bounded attempt budget, and an early stop on terminal errors.
|
Package retry runs an operation again on failure, with exponential backoff, optional jitter, a bounded attempt budget, and an early stop on terminal errors. |
|
Package safetick provides panic recovery helpers for long-running background loops and message-consumer callbacks, so a single bad tick or message cannot crash the worker.
|
Package safetick provides panic recovery helpers for long-running background loops and message-consumer callbacks, so a single bad tick or message cannot crash the worker. |
|
Package translation provides a type-safe, declarative system for translating model content stored per-record (distinct from i18n, which localizes static catalog/error strings).
|
Package translation provides a type-safe, declarative system for translating model content stored per-record (distinct from i18n, which localizes static catalog/error strings). |
|
translationpg
Package translationpg is the Postgres implementation of translation.Store.
|
Package translationpg is the Postgres implementation of translation.Store. |
|
translationrest
Package translationrest wires the translation package into a skit REST router as a single rest.MidFunc that translates responses automatically.
|
Package translationrest wires the translation package into a skit REST router as a single rest.MidFunc that translates responses automatically. |
|
translationtest
Package translationtest provides an in-memory translation.Store for tests, so a Translator runs without Postgres.
|
Package translationtest provides an in-memory translation.Store for tests, so a Translator runs without Postgres. |
|
Package validate checks a struct by its `validate:` tags (github.com/go-playground/validator) and reports the failures as an errs.FieldErrors error.
|
Package validate checks a struct by its `validate:` tags (github.com/go-playground/validator) and reports the failures as an errs.FieldErrors error. |
|
Package worker unifies the background-execution patterns found across the reference services into one small vocabulary.
|
Package worker unifies the background-execution patterns found across the reference services into one small vocabulary. |
Click to show internal directories.
Click to hide internal directories.