system

package
v0.2.17 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: MPL-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Components

type Components struct {
	Roots            *root.Service
	Sources          *source.Service
	Collections      *collection.Service
	Artifacts        *artifact.Service
	Refresh          *refresh.Service
	ShareableSchemas *shareable.Registry

	ManagedArtifacts *managedartifact.Service
	CollectionReader collection.Reader
	ArtifactReader   artifact.Reader
	Catalogs         catalog.Reader
	SourceRuntime    source.Runtime
	// contains filtered or unexported fields
}

func Open

func Open(
	ctx context.Context,
	config Config,
) (*Components, error)

func (*Components) Close

func (c *Components) Close() error

func (*Components) CommitTopologyHydration added in v0.2.16

func (c *Components) CommitTopologyHydration(
	ctx context.Context,
	desired topology.Hydration,
) error

CommitTopologyHydration records successful installation only after the generic topology and artifact-family installation paths both complete.

func (*Components) DecoderFingerprint added in v0.2.13

func (c *Components) DecoderFingerprint() (cryptoutil.Digest, error)

DecoderFingerprint returns the exact decoder capability fingerprint used by newly published catalogs. Consumers use it to mark old catalogs stale after a decoder implementation or revision changes.

func (*Components) EnsureProtectedTopology added in v0.2.14

func (c *Components) EnsureProtectedTopology(
	ctx context.Context,
	declaration topology.Declaration,
) (topology.Installed, error)

EnsureProtectedTopology creates or verifies a declared protected Root and its generic Sources. Feature installers remain responsible for feature Collections, Artifacts, package validation, and package publication.

func (*Components) GetManagedSourceState added in v0.2.13

func (c *Components) GetManagedSourceState(
	ctx context.Context,
	rootID basespec.RootID,
	sourceID basespec.SourceID,
) (ManagedPackageResult, error)

GetManagedSourceState returns the current confirmed snapshot generation used as the optimistic token for managed package publication and removal. It does not expose Source configuration or the private acknowledged-generation metadata field.

func (*Components) GetTopologyHydration added in v0.2.15

func (c *Components) GetTopologyHydration(
	ctx context.Context,
	installerName string,
) (topology.Hydration, bool, error)

func (*Components) HasDecoder

func (c *Components) HasDecoder(id basespec.DecoderID) bool

func (*Components) PrepareTopologyHydrations added in v0.2.16

func (c *Components) PrepareTopologyHydrations(
	ctx context.Context,
	desiredValues []topology.Hydration,
) (map[string]bool, error)

PrepareTopologyHydrations reconciles all installer desired states before any installer creates topology. It must operate as one batch because multiple artifact families can share one protected Root.

func (*Components) PublishManagedPackage added in v0.2.13

func (c *Components) PublishManagedPackage(
	ctx context.Context,
	rootID basespec.RootID,
	sourceID basespec.SourceID,
	expectedSourceRevision uint64,
	publication source.ManagedPackagePublication,
) (ManagedPackageResult, error)

PublishManagedPackage publishes a package and advances the Source revision only when the resulting snapshot generation changed. The revision advance invalidates catalogs that observed the prior generation.

Source-side publication and SQLite metadata publication intentionally remain separate operations. If the package write succeeds but the revision advance conflicts, the caller receives the conflict and must reload before retrying.

func (*Components) PublishProtectedManagedPackage added in v0.2.14

func (c *Components) PublishProtectedManagedPackage(
	ctx context.Context,
	rootID basespec.RootID,
	sourceID basespec.SourceID,
	expectedSourceRevision uint64,
	publication source.ManagedPackagePublication,
) (ManagedPackageResult, error)

PublishProtectedManagedPackage is the trusted protected-topology package publication path. Artifact Store assigns no built-in meaning to this method. Application installers use it only for a Root declared protected by the application RootPolicy.

func (*Components) PutTopologyHydration added in v0.2.15

func (c *Components) PutTopologyHydration(
	ctx context.Context,
	value topology.Hydration,
) error

func (*Components) RemoveManagedPackage added in v0.2.13

func (c *Components) RemoveManagedPackage(
	ctx context.Context,
	rootID basespec.RootID,
	sourceID basespec.SourceID,
	expectedSourceRevision uint64,
	address source.ManagedPackageAddress,
	expectedGeneration string,
) (ManagedPackageResult, error)

RemoveManagedPackage removes one complete package and advances the Source revision after successful source-side removal.

func (*Components) RemoveProtectedManagedPackage added in v0.2.14

func (c *Components) RemoveProtectedManagedPackage(
	ctx context.Context,
	rootID basespec.RootID,
	sourceID basespec.SourceID,
	expectedSourceRevision uint64,
	address source.ManagedPackageAddress,
	expectedGeneration string,
) (ManagedPackageResult, error)

RemoveProtectedManagedPackage is the trusted protected-topology removal path. It is reserved for an explicit installer or update workflow.

func (*Components) ResetTopologyHydration added in v0.2.15

func (c *Components) ResetTopologyHydration(
	ctx context.Context,
	installerName string,
	rootID basespec.RootID,
) error

ResetTopologyHydration removes all local state for a binary-owned topology.

A reset is authorized only when rootID is the current protected Root or the persisted hydration record for installerName owns rootID. The second case is required when a newer binary changes its protected Root ID.

The hydration record intentionally survives this method. It is replaced only after the next complete installation succeeds, making interrupted upgrades converge on the next application start.

func (*Components) RootMutationPolicy added in v0.2.14

func (c *Components) RootMutationPolicy() protection.RootPolicy

type Config

type Config struct {
	BaseDirectory             string
	EmbeddedProviders         map[string]fs.FS
	AdditionalSources         []source.Adapter
	Decoders                  []discovery.Decoder
	Clock                     clockutil.Clock
	ShareableCodecs           []shareable.Codec
	RootMutationPolicy        protection.RootPolicy
	FilesystemTraversalPolicy *fsdir.TraversalPolicy
}

type ManagedPackageResult added in v0.2.13

type ManagedPackageResult struct {
	Source     source.Summary
	Generation string
}

Jump to

Keyboard shortcuts

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