Documentation
¶
Overview ¶
Package artifact defines immutable, target-independent generated artifacts.
Index ¶
- Constants
- func AggregateManifestChecksum(manifest []byte) []byte
- type AggregateAssetSource
- type AggregateComponent
- func (c AggregateComponent) Asset() string
- func (c AggregateComponent) AuraRevision() Revision
- func (c AggregateComponent) BundleID() BundleID
- func (c AggregateComponent) Digest() Digest
- func (c AggregateComponent) Extension() Extension
- func (c AggregateComponent) Harness() Harness
- func (c AggregateComponent) ID() ComponentID
- func (c AggregateComponent) PastureRevision() Revision
- func (c AggregateComponent) RuntimeContractID() RuntimeContractID
- type AggregateComponentSpec
- type AggregateManifest
- func (m AggregateManifest) AuraRevision() Revision
- func (m AggregateManifest) Channel() ReleaseChannel
- func (m AggregateManifest) Compatible(installer Version) bool
- func (m AggregateManifest) Components() []AggregateComponent
- func (m AggregateManifest) InstallerMax() Version
- func (m AggregateManifest) InstallerMin() Version
- func (m AggregateManifest) MarshalJSON() ([]byte, error)
- func (m AggregateManifest) PastureRevision() Revision
- func (m *AggregateManifest) UnmarshalJSON(data []byte) error
- func (m AggregateManifest) Version() Version
- type AggregateManifestSpec
- type AggregateRequirements
- type AggregateValidationError
- type Bundle
- type BundleID
- type ComponentID
- type Digest
- type Entry
- type EntryType
- type Extension
- type Harness
- type Manifest
- func (m Manifest) Entries() []Entry
- func (m Manifest) Equal(other Manifest) bool
- func (m Manifest) Len() int
- func (m Manifest) MarshalBinary() ([]byte, error)
- func (m Manifest) MarshalJSON() ([]byte, error)
- func (m *Manifest) UnmarshalBinary(data []byte) error
- func (m *Manifest) UnmarshalJSON(data []byte) error
- type Mode
- type Path
- type ReleaseChannel
- type Revision
- type RuntimeContractID
- type ValidationError
- type VerifiedAggregate
- type Version
Constants ¶
const AggregateChecksumAsset = "pasture-aggregate-manifest.json.sha256"
const AggregateManifestAsset = "pasture-aggregate-manifest.json"
const AggregateManifestSchema = "pasture.aggregate-release/v1"
Variables ¶
This section is empty.
Functions ¶
func AggregateManifestChecksum ¶
AggregateManifestChecksum returns the canonical checksum sidecar bytes.
Types ¶
type AggregateAssetSource ¶
AggregateAssetSource injects release asset I/O for verification and testing.
type AggregateComponent ¶
type AggregateComponent struct {
// contains filtered or unexported fields
}
AggregateComponent is one immutable member of the closed three-by-three set.
func (AggregateComponent) Asset ¶
func (c AggregateComponent) Asset() string
func (AggregateComponent) AuraRevision ¶
func (c AggregateComponent) AuraRevision() Revision
func (AggregateComponent) BundleID ¶
func (c AggregateComponent) BundleID() BundleID
func (AggregateComponent) Digest ¶
func (c AggregateComponent) Digest() Digest
func (AggregateComponent) Extension ¶
func (c AggregateComponent) Extension() Extension
func (AggregateComponent) Harness ¶
func (c AggregateComponent) Harness() Harness
func (AggregateComponent) ID ¶
func (c AggregateComponent) ID() ComponentID
func (AggregateComponent) PastureRevision ¶
func (c AggregateComponent) PastureRevision() Revision
func (AggregateComponent) RuntimeContractID ¶
func (c AggregateComponent) RuntimeContractID() RuntimeContractID
type AggregateComponentSpec ¶
type AggregateComponentSpec struct {
Harness Harness
Extension Extension
Asset string
Digest Digest
BundleID BundleID
RuntimeContractID RuntimeContractID
PastureRevision Revision
AuraRevision Revision
}
AggregateComponentSpec is the typed producer input for one component.
type AggregateManifest ¶
type AggregateManifest struct {
// contains filtered or unexported fields
}
AggregateManifest is a completely validated immutable aggregate release.
func NewAggregateManifest ¶
func NewAggregateManifest(spec AggregateManifestSpec) (AggregateManifest, error)
NewAggregateManifest validates typed producer input through the public codec.
func ParseAggregateManifest ¶
func ParseAggregateManifest(data []byte) (AggregateManifest, error)
ParseAggregateManifest strictly decodes the public aggregate manifest codec.
func VerifyAggregateManifest ¶
func VerifyAggregateManifest(manifestBytes, checksumBytes []byte) (AggregateManifest, error)
VerifyAggregateManifest validates the immutable checksum sidecar and strict manifest without opening components.
func (AggregateManifest) AuraRevision ¶
func (m AggregateManifest) AuraRevision() Revision
func (AggregateManifest) Channel ¶
func (m AggregateManifest) Channel() ReleaseChannel
func (AggregateManifest) Compatible ¶
func (m AggregateManifest) Compatible(installer Version) bool
func (AggregateManifest) Components ¶
func (m AggregateManifest) Components() []AggregateComponent
func (AggregateManifest) InstallerMax ¶
func (m AggregateManifest) InstallerMax() Version
func (AggregateManifest) InstallerMin ¶
func (m AggregateManifest) InstallerMin() Version
func (AggregateManifest) MarshalJSON ¶
func (m AggregateManifest) MarshalJSON() ([]byte, error)
MarshalJSON emits the canonical aggregate manifest representation.
func (AggregateManifest) PastureRevision ¶
func (m AggregateManifest) PastureRevision() Revision
func (*AggregateManifest) UnmarshalJSON ¶
func (m *AggregateManifest) UnmarshalJSON(data []byte) error
UnmarshalJSON replaces m only after complete strict validation.
func (AggregateManifest) Version ¶
func (m AggregateManifest) Version() Version
type AggregateManifestSpec ¶
type AggregateManifestSpec struct {
Version Version
Channel ReleaseChannel
InstallerMin Version
InstallerMax Version
PastureRevision Revision
AuraRevision Revision
Components []AggregateComponentSpec
}
AggregateManifestSpec is the typed producer input for a complete release.
type AggregateRequirements ¶
type AggregateRequirements struct {
Version Version
Installer Version
PastureRevision Revision
AuraRevision Revision
MaxAssetBytes int64
MaxTotalBytes int64
ExpectedManifestDigest Digest
}
AggregateRequirements are trusted installer-side constraints.
type AggregateValidationError ¶
AggregateValidationError is an actionable aggregate release failure.
func (*AggregateValidationError) Error ¶
func (e *AggregateValidationError) Error() string
func (*AggregateValidationError) Unwrap ¶
func (e *AggregateValidationError) Unwrap() error
type Bundle ¶
type Bundle struct {
// contains filtered or unexported fields
}
Bundle is an immutable content-addressed artifact and implements fs.FS for its declared regular-file leaves.
func NewBundle ¶
NewBundle validates source against manifest and snapshots every file byte. The returned value owns no handle or alias into source.
func (Bundle) Equal ¶
Equal reports whether two validated bundles have identical canonical manifests and content addresses.
type BundleID ¶
type BundleID struct {
// contains filtered or unexported fields
}
BundleID is the validated content address of a complete artifact manifest.
func ParseBundleID ¶
ParseBundleID validates the canonical artifact bundle identifier.
func (BundleID) MarshalText ¶
func (*BundleID) UnmarshalText ¶
type ComponentID ¶
type ComponentID struct {
// contains filtered or unexported fields
}
ComponentID is the opaque canonical target descriptor identity harness/extension.
func ComponentIDs ¶
func ComponentIDs() []ComponentID
ComponentIDs returns every canonical coordinate in harness-major order.
func NewComponentID ¶
func NewComponentID(harness Harness, extension Extension) (ComponentID, error)
NewComponentID constructs one member of the closed three-by-three matrix.
func ParseComponentID ¶
func ParseComponentID(value string) (ComponentID, error)
ParseComponentID validates one member of the closed three-by-three matrix.
func (ComponentID) Extension ¶
func (id ComponentID) Extension() Extension
func (ComponentID) Harness ¶
func (id ComponentID) Harness() Harness
func (ComponentID) IsValid ¶
func (id ComponentID) IsValid() bool
func (ComponentID) String ¶
func (id ComponentID) String() string
type Digest ¶
type Digest struct {
// contains filtered or unexported fields
}
Digest is a validated lowercase SHA-256 content digest.
func DigestBytes ¶
DigestBytes returns the SHA-256 digest of the exact supplied bytes.
func ParseDigest ¶
ParseDigest validates the canonical sha256:<64 lowercase hex> form.
func (Digest) MarshalText ¶
func (*Digest) UnmarshalText ¶
type Entry ¶
type Entry struct {
// contains filtered or unexported fields
}
Entry is one immutable manifest entry.
func NewDirectoryEntry ¶
NewDirectoryEntry constructs a validated directory manifest entry.
func NewFileEntry ¶
NewFileEntry constructs a validated regular-file manifest entry.
func (Entry) IsDirectory ¶
type EntryType ¶
type EntryType struct {
// contains filtered or unexported fields
}
EntryType is one of the closed artifact entry variants.
func DirectoryType ¶
func DirectoryType() EntryType
DirectoryType returns the directory entry variant.
func ParseEntryType ¶
ParseEntryType decodes a closed artifact entry variant.
func RegularFileType ¶
func RegularFileType() EntryType
RegularFileType returns the regular-file entry variant.
func (EntryType) MarshalText ¶
func (*EntryType) UnmarshalText ¶
type Extension ¶
type Extension uint8
Extension identifies one immutable generated component class.
func ParseExtension ¶
func (Extension) MarshalText ¶
func (*Extension) UnmarshalText ¶
type Manifest ¶
type Manifest struct {
// contains filtered or unexported fields
}
Manifest is an immutable, lexicographically ordered artifact inventory.
func NewManifest ¶
NewManifest validates ownership collisions and snapshots entries in lexicographic path order.
func ParseManifest ¶
ParseManifest decodes and validates a manifest. Entry order in the input is canonicalized by NewManifest before the value can be observed.
func (Manifest) MarshalBinary ¶
MarshalBinary emits the same canonical bytes as MarshalJSON.
func (Manifest) MarshalJSON ¶
MarshalJSON emits the canonical manifest codec.
func (*Manifest) UnmarshalBinary ¶
UnmarshalBinary replaces m only after the complete input validates.
func (*Manifest) UnmarshalJSON ¶
UnmarshalJSON replaces m only after the complete input validates.
type Mode ¶
type Mode struct {
// contains filtered or unexported fields
}
Mode is an explicit set of Unix permission bits.
func (Mode) MarshalText ¶
func (*Mode) UnmarshalText ¶
type Path ¶
type Path struct {
// contains filtered or unexported fields
}
Path is a canonical, slash-separated relative artifact path.
func (Path) MarshalText ¶
MarshalText returns the canonical path spelling.
func (*Path) UnmarshalText ¶
UnmarshalText replaces p only after the complete input validates.
type ReleaseChannel ¶
type ReleaseChannel string
ReleaseChannel is the closed aggregate release channel.
const ( ReleaseFinal ReleaseChannel = "final" ReleasePrerelease ReleaseChannel = "prerelease" )
type Revision ¶
type Revision string
Revision is an immutable lowercase Git commit identity.
func ParseRevision ¶
ParseRevision validates an immutable Git commit identity.
type RuntimeContractID ¶
type RuntimeContractID struct {
// contains filtered or unexported fields
}
RuntimeContractID is one opaque constructor-owned, harness-bound target identity.
func NewRuntimeContractID ¶
func NewRuntimeContractID(harness Harness, name string) (RuntimeContractID, error)
NewRuntimeContractID constructs a canonical <harness>/<profile> identity.
func ParseRuntimeContractID ¶
func ParseRuntimeContractID(value string) (RuntimeContractID, error)
ParseRuntimeContractID parses the same canonical identity emitted by target descriptors.
func ProductionRuntimeContract ¶
func ProductionRuntimeContract(harness Harness) (RuntimeContractID, error)
ProductionRuntimeContract returns the sole registered target profile accepted by runtime lowering, target descriptors, and aggregate releases.
func (RuntimeContractID) Harness ¶
func (id RuntimeContractID) Harness() Harness
func (RuntimeContractID) IsValid ¶
func (id RuntimeContractID) IsValid() bool
func (RuntimeContractID) MarshalJSON ¶
func (id RuntimeContractID) MarshalJSON() ([]byte, error)
func (RuntimeContractID) String ¶
func (id RuntimeContractID) String() string
func (*RuntimeContractID) UnmarshalJSON ¶
func (id *RuntimeContractID) UnmarshalJSON(data []byte) error
type ValidationError ¶
type ValidationError struct {
Stage string
Bundle string
Entry string
Rule string
Reason string
Impact string
Fix string
Cause error
}
ValidationError describes a rejected artifact value or filesystem boundary. Its fields are stable so callers can present or inspect the actionable failure without parsing Error's text.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
func (*ValidationError) Unwrap ¶
func (e *ValidationError) Unwrap() error
Unwrap returns the lower-level filesystem or codec error, when one exists.
type VerifiedAggregate ¶
type VerifiedAggregate struct {
// contains filtered or unexported fields
}
VerifiedAggregate is produced only after all manifest and component bytes verify.
func VerifyAggregate ¶
func VerifyAggregate(ctx context.Context, source AggregateAssetSource, requirements AggregateRequirements) (VerifiedAggregate, error)
VerifyAggregate verifies the checksum, identity, compatibility, revisions, and every component before returning a value usable by a mutator.
func (VerifiedAggregate) Asset ¶
func (v VerifiedAggregate) Asset(id ComponentID) ([]byte, bool)
func (VerifiedAggregate) Manifest ¶
func (v VerifiedAggregate) Manifest() AggregateManifest
type Version ¶
type Version struct {
// contains filtered or unexported fields
}
Version is a validated semantic version without a leading v.
func ParseVersion ¶
ParseVersion parses the canonical SemVer form used by aggregate releases.