bundle

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 2, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package bundle defines the portable source input to checked compilation. A SourceBundle never contains checked IR or mutable runtime state.

Index

Constants

View Source
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

type OCIVerifier func(context.Context, string, string) error

OCIVerifier verifies the pulled digest before the bundle layer is decoded.

type Source

type Source struct {
	Path    string `json:"path"`
	Content string `json:"content"`
}

Source is one normalized .eff or .effx source file.

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) Name

func (bundle *SourceBundle) Name() string

Name returns the bundle name.

func (*SourceBundle) OCIBytes

func (bundle *SourceBundle) OCIBytes() ([]byte, error)

OCIBytes returns a deterministic tar layer containing the canonical bundle.

func (*SourceBundle) PublishOCI

func (bundle *SourceBundle) PublishOCI(ctx context.Context, imageReference string) (string, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL