internal/

directory
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT

Directories

Path Synopsis
Package apptest lets choktest and the batteries' tests reach what a test needs without a public API: chok fills in the hooks when it initializes, and choktest sets the knobs.
Package apptest lets choktest and the batteries' tests reach what a test needs without a public API: chok fills in the hooks when it initializes, and choktest sets the knobs.
Package clientip resolves the real client address behind reverse proxies — the stdlib replacement for gin's ClientIP/SetTrustedProxies pair (security-sensitive: this value keys the identity login rate limiter).
Package clientip resolves the real client address behind reverse proxies — the stdlib replacement for gin's ClientIP/SetTrustedProxies pair (security-sensitive: this value keys the identity login rate limiter).
Package conf loads the typed configuration behind chok.Load.
Package conf loads the typed configuration behind chok.Load.
Package dbtest gives each test a throwaway database of the dialect CHOK_TEST_DRIVER names: sqlite (the default; a file in t.TempDir, so the production pool layout is exercised), postgres (a fresh schema in the database of CHOK_TEST_PG_DSN) or mysql (a fresh chok_test_<rand> database on the server of CHOK_TEST_MYSQL_DSN).
Package dbtest gives each test a throwaway database of the dialect CHOK_TEST_DRIVER names: sqlite (the default; a file in t.TempDir, so the production pool layout is exercised), postgres (a fresh schema in the database of CHOK_TEST_PG_DSN) or mysql (a fresh chok_test_<rand> database on the server of CHOK_TEST_MYSQL_DSN).
Package dbx carries what db knows about a model's tables to store and the batteries without widening db's public API: the indexes db.Table declares, SoftUnique and Unique, which store uses to name the field of a duplicate-key error and to resolve an upsert's conflict target, the plain tables a battery declares for its own schema, the statement observer telemetry attaches to a handle, and the batteries' migration files the chok command applies.
Package dbx carries what db knows about a model's tables to store and the batteries without widening db's public API: the indexes db.Table declares, SoftUnique and Unique, which store uses to name the field of a duplicate-key error and to resolve an upsert's conflict target, the plain tables a battery declares for its own schema, the statement observer telemetry attaches to a handle, and the batteries' migration files the chok command applies.
Package jsonx holds the encoding/json/v2 options every chok body uses.
Package jsonx holds the encoding/json/v2 options every chok body uses.
Package lint holds repository-wide static checks that run as ordinary tests, so go test ./...
Package lint holds repository-wide static checks that run as ordinary tests, so go test ./...
Package logtap copies the records an App's loggers write to one more slog.Handler, the OpenTelemetry Logs bridge of telemetry, without a public API: the root package wraps the handlers it builds with Wrap, and App.Use binds telemetry's bridge to that App when logs.otel is on.
Package logtap copies the records an App's loggers write to one more slog.Handler, the OpenTelemetry Logs bridge of telemetry, without a public API: the root package wraps the handlers it builds with Wrap, and App.Use binds telemetry's bridge to that App when logs.otel is on.
Package openapi builds the OpenAPI 3.1 document of a chok App from its route table by reflecting over each route's request and response types.
Package openapi builds the OpenAPI 3.1 document of a chok App from its route table by reflecting over each route's request and response types.
Package redislog routes go-redis's own log lines (a dial that failed, a connection it dropped) to slog.
Package redislog routes go-redis's own log lines (a dial that failed, a connection it dropped) to slog.
Package reqinfo carries the per-request facts that middleware outside the router needs once the handler has run — the matched route pattern, for access logs and telemetry — without widening chok's public API.
Package reqinfo carries the per-request facts that middleware outside the router needs once the handler has run — the matched route pattern, for access logs and telemetry — without widening chok's public API.
Package serving tells the batteries' Starters whether the App serves HTTP.
Package serving tells the batteries' Starters whether the App serves HTTP.
tools
apidoc command
Command apidoc writes docs/api.md, the map of chok's public API: for each public package, every line `go doc -short` prints for it — the lines hack/apibudget.sh counts against hack/budget.txt — with the first sentence of its comment.
Command apidoc writes docs/api.md, the map of chok's public API: for each public package, every line `go doc -short` prints for it — the lines hack/apibudget.sh counts against hack/budget.txt — with the first sentence of its comment.
configkeys command
Command configkeys counts the configuration keys an application built on chok can set — Base plus every battery's Config — against the config_keys limit in hack/budget.txt (plan §6).
Command configkeys counts the configuration keys an application built on chok can set — Base plus every battery's Config — against the config_keys limit in hack/budget.txt (plan §6).
doccheck
Package doccheck holds the test that compiles the Go programs of the documentation: every go block of docs/quickstart.md, README.md, README_zh.md, docs/realtime.md and docs/mail.md is a complete program, built against this checkout, and the chok.yaml shown next to it loads strictly into the program's configuration.
Package doccheck holds the test that compiles the Go programs of the documentation: every go block of docs/quickstart.md, README.md, README_zh.md, docs/realtime.md and docs/mail.md is a complete program, built against this checkout, and the chok.yaml shown next to it loads strictly into the program's configuration.
Package tracectx lets a package read the trace id a context carries without importing OpenTelemetry: package telemetry sets TraceID when it initializes, so in a binary that links telemetry identity's audit events record the request's trace.
Package tracectx lets a package read the trace id a context carries without importing OpenTelemetry: package telemetry sets TraceID when it initializes, so in a binary that links telemetry identity's audit events record the request's trace.

Jump to

Keyboard shortcuts

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