Documentation
¶
Overview ¶
Package platform holds cross-cutting technical helpers: the outbound HTTP client, the redacting logger, the configuration and the in-memory cache (ADR 0002).
Directories
¶
| Path | Synopsis |
|---|---|
|
Package buildinfo tells the version of the running binary.
|
Package buildinfo tells the version of the running binary. |
|
Package cache keeps registry answers in memory for a while, so a burst of checks on the same identifier calls an upstream once (ADR 0002).
|
Package cache keeps registry answers in memory for a while, so a burst of checks on the same identifier calls an upstream once (ADR 0002). |
|
Package clock gives the commands the system time, pauses and jitter that the use cases take as ports, so the use cases stay testable.
|
Package clock gives the commands the system time, pauses and jitter that the use cases take as ports, so the use cases stay testable. |
|
Package config reads the configuration of every command from environment variables into one typed Config, validated as a whole at startup so a command stops before doing anything with a value it cannot use (ADR 0002).
|
Package config reads the configuration of every command from environment variables into one typed Config, validated as a whole at startup so a command stops before doing anything with a value it cannot use (ADR 0002). |
|
Package csvfile reads the semicolon- or comma-separated files upstream sources publish, record by record, after checking their header.
|
Package csvfile reads the semicolon- or comma-separated files upstream sources publish, record by record, after checking their header. |
|
Package defaults fills the zero fields of a configuration struct with their default value, so every Config in platform follows the same rule: zero means default, negative is invalid.
|
Package defaults fills the zero fields of a configuration struct with their default value, so every Config in platform follows the same rule: zero means default, negative is invalid. |
|
Package httpclient is the only way out to the network: every source and registry fetches through a Client (ADR 0002).
|
Package httpclient is the only way out to the network: every source and registry fetches through a Client (ADR 0002). |
|
httpclienttest
Package httpclienttest builds httpclient.Client values for tests against an httptest TLS server.
|
Package httpclienttest builds httpclient.Client values for tests against an httptest TLS server. |
|
Package logging builds the structured logger every command writes with: log/slog lines in JSON, personal data masked, the request identifier of the context added (ADR 0002).
|
Package logging builds the structured logger every command writes with: log/slog lines in JSON, personal data masked, the request identifier of the context added (ADR 0002). |
|
loggingtest
Package loggingtest builds redacting loggers for tests, writing to a buffer the test reads back.
|
Package loggingtest builds redacting loggers for tests, writing to a buffer the test reads back. |
|
Package ratelimit limits the requests of each client with a token bucket per key, in memory and bounded: an idle bucket is forgotten, and the number of buckets is capped.
|
Package ratelimit limits the requests of each client with a token bucket per key, in memory and bounded: an idle bucket is forgotten, and the number of buckets is capped. |
|
Package startup is what every command does before its own work: load the typed configuration, build the redacting logger from it and make that logger the log/slog default, so no line written by the command or a library bypasses the masking of personal data (ADR 0002).
|
Package startup is what every command does before its own work: load the typed configuration, build the redacting logger from it and make that logger the log/slog default, so no line written by the command or a library bypasses the masking of personal data (ADR 0002). |
|
Package throttle keeps the registry clients away from an upstream that asked to wait with a Retry-After header (RFC 9110, section 10.2.3), so a check fails fast instead of calling it again too soon.
|
Package throttle keeps the registry clients away from an upstream that asked to wait with a Retry-After header (RFC 9110, section 10.2.3), so a check fails fast instead of calling it again too soon. |
Click to show internal directories.
Click to hide internal directories.