catalog

package
v1.234.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Overview

Package catalog manages discovery metadata independently of release installation.

Index

Constants

View Source
const Kind = "AtmosPluginCatalog"

Variables

This section is empty.

Functions

func Add

func Add(file *File, source string, release *pluginoci.Release, descriptors *extension.Registry) error

Add records a verified release's metadata without executing the plugin.

func NormalizeVersion

func NormalizeVersion(version string) string

NormalizeVersion strips a single leading "v" so "v0.1.0" and "0.1.0" name the same release. Catalog versions are stored without the prefix because they are strict semantic versions.

func ParseReleaseReference

func ParseReleaseReference(value string) (name.Reference, error)

ParseReleaseReference validates a release reference locally. A tag or digest is required, because registries otherwise resolve an implicit "latest" that catalogs must not pin.

func Publish

func Publish(ctx context.Context, registry atmosoci.Registry, reference string, file *File, expected string) error

Publish checks the caller's observed revision and digest immediately before replacement. Publishers must serialize writes; registries without CAS cannot make the final check and tag update atomic.

func Remove

func Remove(file *File, name, version string) error

Remove unlists one version or an entire entry. Artifact bytes remain available. A leading "v" on version is ignored.

Types

type Entry

type Entry struct {
	Name         string    `yaml:"name" json:"name"`
	Description  string    `yaml:"description,omitempty" json:"description,omitempty"`
	Publisher    string    `yaml:"publisher" json:"publisher"`
	Capabilities []string  `yaml:"capabilities" json:"capabilities"`
	Runtime      string    `yaml:"runtime" json:"runtime"`
	Source       string    `yaml:"source" json:"source"`
	Versions     []Version `yaml:"versions" json:"versions"`
}

Entry describes a package repository and the releases indexed for discovery.

func Search(file *File, filter Filter) []Entry

Search returns matching static entries. An empty catalog produces an empty list.

type File

type File = manifest.Manifest[Spec]

File is the standard Atmos manifest envelope for mutable discovery metadata.

func New

func New(name string) *File

New creates an empty catalog suitable for an initial publication.

func Parse

func Parse(raw []byte) (*File, error)

Parse validates catalog metadata without fetching or executing any package.

func Read

func Read(ctx context.Context, registry atmosoci.Registry, reference string) (*File, string, error)

Read fetches a bounded catalog and verifies its descriptor and layer bytes. Once a manifest is found, its digest is returned even if its content is unreadable. Callers can distinguish an absent catalog from a present but corrupt artifact.

type Filter

type Filter struct{ Query, Capability, Runtime string }

Filter constrains catalog discovery without loading executable payloads.

type InventoryOption

type InventoryOption func(*inventoryOptions)

InventoryOption configures committed catalog input independently of release planning.

func WithHead

func WithHead(head string) InventoryOption

WithHead selects the committed revision containing the accepted inventory and manifests.

func WithInventory

func WithInventory(file string) InventoryOption

WithInventory selects a repository-relative inventory file.

func WithInventoryRunner

func WithInventoryRunner(runner pkgit.Runner) InventoryOption

WithInventoryRunner injects Git access for inventory reads.

type PublicVerifier

type PublicVerifier interface {
	Verify(context.Context, string, string, string) (string, error)
}

PublicVerifier checks anonymously readable OCI bytes.

type ReleaseSelection

type ReleaseSelection struct {
	Name       string `json:"name"`
	Version    string `json:"version"`
	Repository string `json:"repository"`
}

ReleaseSelection identifies a published package version to reconcile into a catalog.

func ReadInventory

func ReadInventory(ctx context.Context, options ...InventoryOption) ([]ReleaseSelection, error)

ReadInventory selects releases from committed manifests without building a CI release plan. It resolves the revision once, so concurrent branch movement cannot mix snapshots.

type Spec

type Spec struct {
	Entries []Entry `yaml:"entries" json:"entries"`
}

Spec holds discoverable packages. Catalog inclusion does not establish trust.

type SyncOption

type SyncOption func(*syncOptions)

SyncOption configures catalog reconciliation.

func WithPublicVerification

func WithPublicVerification(verifier PublicVerifier) SyncOption

WithPublicVerification checks releases before listing them and the catalog after publication.

func WithSkipMissing

func WithSkipMissing() SyncOption

WithSkipMissing permits only registry not-found releases to remain absent.

type Syncer

type Syncer struct {
	// contains filtered or unexported fields
}

Syncer reconciles releases using an injected registry and extension registry.

func NewSyncer

func NewSyncer(registry atmosoci.Registry, descriptors *extension.Registry) *Syncer

NewSyncer constructs a catalog reconciler.

func (*Syncer) Sync

func (s *Syncer) Sync(ctx context.Context, target string, releases []ReleaseSelection, options ...SyncOption) error

Sync merges verified releases into the current catalog and publishes once. Historical versions and existing yank metadata are retained. Callers must serialize publishers.

type Version

type Version struct {
	Version       string                       `yaml:"version" json:"version"`
	Digest        string                       `yaml:"digest" json:"digest"`
	Platforms     []string                     `yaml:"platforms" json:"platforms"`
	Compatibility pluginmanifest.Compatibility `yaml:"compatibility" json:"compatibility"`
	Yanked        *Yanked                      `yaml:"yanked,omitempty" json:"yanked,omitempty"`
}

Version pins a discovery result to an immutable OCI index.

func Select

func Select(entry *Entry, constraint, platform string) (*Version, error)

Select chooses the newest non-yanked version for the requested platform.

type Yanked

type Yanked struct {
	Reason string `yaml:"reason" json:"reason"`
}

Yanked excludes a version from new discovery without affecting existing locks.

Jump to

Keyboard shortcuts

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