Documentation
¶
Overview ¶
Package bundle defines the portable source input to checked compilation. A SourceBundle never contains checked IR or mutable runtime state.
Index ¶
- Constants
- type OCIVerifier
- type Source
- type SourceBundle
- func (bundle *SourceBundle) Bytes() ([]byte, error)
- func (bundle *SourceBundle) Digest() (string, error)
- func (bundle *SourceBundle) Environment() ir.Environment
- func (bundle *SourceBundle) Executors() map[string]invocation.Descriptor
- func (bundle *SourceBundle) Metadata() map[string]string
- func (bundle *SourceBundle) Name() string
- func (bundle *SourceBundle) OCIBytes() ([]byte, error)
- func (bundle *SourceBundle) PublishOCI(ctx context.Context, imageReference string) (string, error)
- func (bundle *SourceBundle) PushOCI(ctx context.Context, imageReference string) error
- func (bundle *SourceBundle) Sources() []Source
- func (bundle *SourceBundle) Version() string
- type Spec
Constants ¶
const (
// FormatVersion is the only source bundle format accepted by this release.
FormatVersion = "effectus.source-bundle.v1"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OCIVerifier ¶
OCIVerifier verifies the pulled digest before the bundle layer is decoded.
type SourceBundle ¶
type SourceBundle struct {
// contains filtered or unexported fields
}
SourceBundle is immutable after construction. Accessors return copies.
func New ¶
func New(spec Spec) (*SourceBundle, error)
New validates and freezes a source bundle. Source paths must already be normalized; source line endings are normalized to LF before hashing.
func Parse ¶
func Parse(data []byte) (*SourceBundle, error)
Parse strictly decodes a source bundle and rejects unknown or duplicate JSON fields.
func ParseOCI ¶
func ParseOCI(data []byte) (*SourceBundle, error)
ParseOCI decodes the deterministic OCI tar layer and rejects all unexpected entries.
func PullOCI ¶
func PullOCI(ctx context.Context, imageReference string, verifier OCIVerifier) (*SourceBundle, error)
PullOCI loads one digest-pinned source-bundle layer. The verifier runs after digest validation and before layer decoding.
func (*SourceBundle) Bytes ¶
func (bundle *SourceBundle) Bytes() ([]byte, error)
Bytes returns the canonical portable file encoding.
func (*SourceBundle) Digest ¶
func (bundle *SourceBundle) Digest() (string, error)
Digest returns the semantic digest. Optional metadata is deliberately excluded.
func (*SourceBundle) Environment ¶
func (bundle *SourceBundle) Environment() ir.Environment
Environment returns a deep copy of checked declarations.
func (*SourceBundle) Executors ¶
func (bundle *SourceBundle) Executors() map[string]invocation.Descriptor
Executors returns a copy of canonical descriptors keyed by verb.
func (*SourceBundle) Metadata ¶
func (bundle *SourceBundle) Metadata() map[string]string
Metadata returns a copy of non-semantic metadata.
func (*SourceBundle) OCIBytes ¶
func (bundle *SourceBundle) OCIBytes() ([]byte, error)
OCIBytes returns a deterministic tar layer containing the canonical bundle.
func (*SourceBundle) PublishOCI ¶
PublishOCI publishes a source bundle and returns its digest-pinned immutable reference. imageReference can be a tag only as a publication target; callers must persist and deploy the returned digest reference.
func (*SourceBundle) PushOCI ¶
func (bundle *SourceBundle) PushOCI(ctx context.Context, imageReference string) error
PushOCI is retained for source compatibility. New callers should use PublishOCI and deploy only its returned digest-pinned reference.
func (*SourceBundle) Sources ¶
func (bundle *SourceBundle) Sources() []Source
Sources returns a copy of normalized source files.
func (*SourceBundle) Version ¶
func (bundle *SourceBundle) Version() string
Version returns the bundle version.
type Spec ¶
type Spec struct {
Name string
Version string
Sources []Source
Environment ir.Environment
Executors map[string]invocation.Descriptor
Metadata map[string]string
}
Spec is construction input for an immutable SourceBundle.