Documentation
¶
Overview ¶
Package core is the stdlib-only foundation of the thesmos ecosystem.
core defines the contract seams (Clock, Rand, Reporter, …) that every other thesmos library imports. It depends on nothing outside the Go standard library; consumer-specific implementations (OpenTelemetry, Prometheus, crypto/rand, HLC, …) live in consumer repositories such as testkit, thesmos, and space.
The constraints governing this module are documented as Architecture Decision Records under docs/adr/.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package arena provides a contiguous byte buffer for batching variable-length binary output on hot paths.
|
Package arena provides a contiguous byte buffer for batching variable-length binary output on hot paths. |
|
Package clock defines the time seam used by every thesmos library.
|
Package clock defines the time seam used by every thesmos library. |
|
fake
Package fake provides a deterministic virtual-time clock.Clock for tests.
|
Package fake provides a deterministic virtual-time clock.Clock for tests. |
|
hlc
Package hlc provides a production clock.Clock backed by the system wall clock with Hybrid Logical Clock semantics.
|
Package hlc provides a production clock.Clock backed by the system wall clock with Hybrid Logical Clock semantics. |
|
Package crypto defines the cryptographic seams used by every thesmos library that constructs digests, audit chains, Merkle accumulators, or content addresses.
|
Package crypto defines the cryptographic seams used by every thesmos library that constructs digests, audit chains, Merkle accumulators, or content addresses. |
|
sha256
Package sha256 provides a SHA-256 crypto.Hasher implementation backed by crypto/sha256.
|
Package sha256 provides a SHA-256 crypto.Hasher implementation backed by crypto/sha256. |
|
sha3
Package sha3 provides SHA3-256, SHA3-384, and SHA3-512 crypto.Hasher implementations backed by crypto/sha3 (Go 1.24+).
|
Package sha3 provides SHA3-256, SHA3-384, and SHA3-512 crypto.Hasher implementations backed by crypto/sha3 (Go 1.24+). |
|
sha512
Package sha512 provides SHA-384 and SHA-512 crypto.Hasher implementations backed by crypto/sha512.
|
Package sha512 provides SHA-384 and SHA-512 crypto.Hasher implementations backed by crypto/sha512. |
|
Package epoch defines Epoch, a strictly-monotonic 64-bit counter type used for leader generations, schema versions, optimistic concurrency tokens, and any other "before/after" tag a system needs to reason about ordering across time.
|
Package epoch defines Epoch, a strictly-monotonic 64-bit counter type used for leader generations, schema versions, optimistic concurrency tokens, and any other "before/after" tag a system needs to reason about ordering across time. |
|
Package id defines ID, the fixed-max-size identifier value type used across the thesmos ecosystem for time-sortable and random-collision-resistant identifiers, plus the Generator interface that produces them.
|
Package id defines ID, the fixed-max-size identifier value type used across the thesmos ecosystem for time-sortable and random-collision-resistant identifiers, plus the Generator interface that produces them. |
|
fixed
Package fixed provides an id.Generator that returns the same id.ID on every call.
|
Package fixed provides an id.Generator that returns the same id.ID on every call. |
|
ksuid
Package ksuid provides an id.Generator producing K-Sortable Unique Identifiers — 160-bit time-sortable identifiers with a 4-byte Unix-second timestamp prefix and a 16-byte random payload.
|
Package ksuid provides an id.Generator producing K-Sortable Unique Identifiers — 160-bit time-sortable identifiers with a 4-byte Unix-second timestamp prefix and a 16-byte random payload. |
|
ulid
Package ulid provides an id.Generator producing ULIDs — Universally Unique Lexicographically-Sortable Identifiers.
|
Package ulid provides an id.Generator producing ULIDs — Universally Unique Lexicographically-Sortable Identifiers. |
|
uuidv4
Package uuidv4 provides an id.Generator producing RFC 4122 version-4 UUIDs (122 random bits + 4 version bits + 2 variant bits).
|
Package uuidv4 provides an id.Generator producing RFC 4122 version-4 UUIDs (122 random bits + 4 version bits + 2 variant bits). |
|
Package page defines Page and Cursor — the pagination request and response shape used by every list-returning interface so unbounded scans are impossible to write accidentally.
|
Package page defines Page and Cursor — the pagination request and response shape used by every list-returning interface so unbounded scans are impossible to write accidentally. |
|
Package pool provides typed sync.Pool wrappers for hot-path allocation pressure relief.
|
Package pool provides typed sync.Pool wrappers for hot-path allocation pressure relief. |
|
Package rand defines the randomness seam used by every thesmos library.
|
Package rand defines the randomness seam used by every thesmos library. |
|
crypto
Package crypto provides a rand.Rand backed by crypto/rand.
|
Package crypto provides a rand.Rand backed by crypto/rand. |
|
fixed
Package fixed provides a constant-output rand.Rand for tests that need to assert against a specific randomness branch.
|
Package fixed provides a constant-output rand.Rand for tests that need to assert against a specific randomness branch. |
|
pcg
Package pcg provides a PCG-backed rand.Rand suitable for non-cryptographic randomness.
|
Package pcg provides a PCG-backed rand.Rand suitable for non-cryptographic randomness. |
|
seeded
Package seeded provides a deterministic CSPRNG-quality rand.Rand for simulation and unit tests.
|
Package seeded provides a deterministic CSPRNG-quality rand.Rand for simulation and unit tests. |
|
Package tag defines Tag and Tags — the string key/value pair shape used in place of [map][string]string on value-type structs that cross async-buffered, cached, or cross-goroutine boundaries.
|
Package tag defines Tag and Tags — the string key/value pair shape used in place of [map][string]string on value-type structs that cross async-buffered, cached, or cross-goroutine boundaries. |
|
Package telemetry defines the metric and trace seams used by every thesmos library that needs to emit observation signals from a hot-path code path.
|
Package telemetry defines the metric and trace seams used by every thesmos library that needs to emit observation signals from a hot-path code path. |
|
noop
Package noop provides a telemetry.Reporter that discards every signal it receives.
|
Package noop provides a telemetry.Reporter that discards every signal it receives. |
|
Package version defines Version, the opaque, monotonic per-(scope, key) version token used by reads and writes for read-your-writes and compare-and-swap semantics.
|
Package version defines Version, the opaque, monotonic per-(scope, key) version token used by reads and writes for read-your-writes and compare-and-swap semantics. |
Click to show internal directories.
Click to hide internal directories.