Documentation
¶
Overview ¶
Package digest defines the canonical OCI digest type used across Gantry.
All Gantry-internal APIs that identify cached or in-flight content use a Digest, not a raw string. This package centralizes parsing and validation so the format is enforced exactly once.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Algorithm ¶
type Algorithm string
Algorithm identifies a digest hash algorithm.
v1 supports SHA-256 only - that is what the OCI Distribution API uses for `blobs/sha256:<hex>` and `manifests/sha256:<hex>` (the only digest-keyed endpoints in the agent's API surface, per architecture.md the API contract).
const ( // SHA256 is the only digest algorithm Gantry accepts (per OCI spec // alignment in the design doc of detailed-design.md). SHA256 Algorithm = "sha256" )
type Digest ¶
type Digest struct {
// contains filtered or unexported fields
}
Digest is a parsed OCI content digest, e.g. "sha256:abc...".
The zero value is invalid; construct via Parse.
func MustParse ¶
MustParse is Parse but panics on error. Intended for test fixtures and compile-time constants only.
func Parse ¶
Parse validates s as an OCI digest in the form "<algo>:<hex>" and returns the parsed Digest. Unknown algorithms are rejected.