Documentation
¶
Overview ¶
Package export builds the immutable per-cell component archives and the component-set document that an aggregate release producer consumes.
Everything emitted here is derived from the embedded target descriptors the installer itself trusts: the archive members, their permission modes, and the declared bundle identity all come from one artifact.Bundle per cell. Nothing downstream re-derives them.
The archive format is specified in docs/component-archive-format.md and is implemented by WriteArchive/ReadArchive in this package.
Index ¶
- Constants
- func AssetBasename(version artifact.Version, id artifact.ComponentID) (string, error)
- func MarshalComponentSet(cells []CellResult) ([]byte, error)
- func VerifyArchive(id artifact.ComponentID, location string, content []byte, ...) error
- func WriteArchive(destination io.Writer, bundle artifact.Bundle) error
- type BundleSource
- type CellBundle
- type CellResult
- type Member
- type MemberKind
- type Request
- type Result
Constants ¶
const ArchiveFormat = "pasture.component-archive/v1"
ArchiveFormat is the canonical identifier of the component archive format specified in docs/component-archive-format.md.
const ComponentSetFilename = "components.json"
ComponentSetFilename is the basename of the emitted component-set document.
const ComponentSetSchema = "aura.aggregate-components/v1"
ComponentSetSchema is the schema string of the component-set document the aggregate release producer consumes.
Variables ¶
This section is empty.
Functions ¶
func AssetBasename ¶
AssetBasename returns the canonical immutable component asset basename for one release version and one component coordinate. Aggregate release validation accepts exactly this spelling and nothing else.
func MarshalComponentSet ¶
func MarshalComponentSet(cells []CellResult) ([]byte, error)
MarshalComponentSet encodes the component-set document for the given cell results, in canonical component order, with a trailing newline.
func VerifyArchive ¶
func VerifyArchive(id artifact.ComponentID, location string, content []byte, bundle artifact.Bundle) error
VerifyArchive re-reads archive bytes and proves they carry exactly the members, permission modes, sizes, and content digests the bundle manifest declares — in the canonical order. It is the round-trip check every written archive passes before an export is reported as complete.
func WriteArchive ¶
WriteArchive writes one bundle as a component archive: a gzip-compressed tar whose members are exactly the bundle manifest entries, in lexicographic path order, carrying the manifest's permission modes and zeroed ownership and timestamps. The same bundle always produces byte-identical output.
Types ¶
type BundleSource ¶
type BundleSource func() ([]CellBundle, error)
BundleSource yields the nine canonical cell bundles. Production wiring reads the embedded target descriptors; tests inject small synthetic bundles.
type CellBundle ¶
type CellBundle struct {
ID artifact.ComponentID
Bundle artifact.Bundle
}
CellBundle pairs one canonical component coordinate with the exact target bundle the installer would activate for it.
func EmbeddedBundles ¶
func EmbeddedBundles() ([]CellBundle, error)
EmbeddedBundles is the production bundle source: the exact per-cell bundles the three embedded target descriptors declare — the same bundles the installer activates. Nothing here re-derives paths, modes, or identities.
type CellResult ¶
type CellResult struct {
ID artifact.ComponentID
Asset string
ArchivePath string
BundleID artifact.BundleID
Digest artifact.Digest
Size int64
Members int
}
CellResult reports what was written for one component coordinate.
type Member ¶
Member is one archive member: the bundle-relative path, its permission mode, its variant, and — for regular files — the exact content digest and size.
func BundleMembers ¶
BundleMembers returns the exact member list a bundle must produce, in the canonical order WriteArchive writes it. It is the expectation side of the round-trip check performed against every written archive.
func ReadArchive ¶
ReadArchive reads a component archive back into its member list, recomputing each regular file's digest from the archived bytes. It is the verification half of the format: the installer, the release pipeline, and the tests all use it to prove an archive matches the bundle it claims to carry.
type MemberKind ¶
type MemberKind uint8
MemberKind is the closed set of archive member variants.
const ( // MemberDirectory is a directory member declared by the bundle manifest. MemberDirectory MemberKind = iota + 1 // MemberRegularFile is a regular-file member declared by the bundle manifest. MemberRegularFile )
func (MemberKind) String ¶
func (k MemberKind) String() string
type Request ¶
Request is one complete export: the immutable release version the assets are named for, and the output directory to claim.
type Result ¶
type Result struct {
Version artifact.Version
OutDir string
ComponentSetPath string
Cells []CellResult
}
Result reports a complete export.
func Export ¶
Export writes one component archive per canonical cell into a freshly claimed output directory, verifies each written archive against the bundle manifest it was built from, and writes the component-set document the aggregate release producer consumes. A failed export leaves no directory behind, so a partial set can never be published.