system

package
v0.2.13 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: MPL-2.0 Imports: 23 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

	CollectionReader collection.Reader
	ArtifactReader   artifact.Reader
	Catalogs         catalog.Reader
	Definitions      definition.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) 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) 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) HasDecoder

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

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) RemoveManagedPackage added in v0.2.13

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

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

type Config

type Config struct {
	BaseDirectory             string
	EmbeddedProviders         map[string]fs.FS
	AdditionalSources         []source.Adapter
	Decoders                  []discovery.Decoder
	Clock                     clockutil.Clock
	IDGenerator               uuidutil.Generator
	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