Documentation
¶
Overview ¶
Package manage commits explicit plugin lifecycle changes after artifact preparation.
Index ¶
- func RegistryNotFound(atmos *schema.AtmosConfiguration, alias string) error
- func ResolveCatalogReference(atmos *schema.AtmosConfiguration, value string) (string, error)
- func ResolveRegistryHost(atmos *schema.AtmosConfiguration, value string) (string, error)
- type AddOptions
- type Manager
- func (m *Manager) Add(ctx context.Context, options AddOptions) error
- func (m *Manager) EditRegistry(ctx context.Context, alias string, registry *schema.PluginRegistry) error
- func (m *Manager) Remove(ctx context.Context, alias string) error
- func (m *Manager) Restore(ctx context.Context, options RestoreOptions) error
- func (m *Manager) Search(ctx context.Context, request discovery.Request) ([]discovery.Result, error)
- type RegistryCredentials
- type RestoreOptions
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegistryNotFound ¶
func RegistryNotFound(atmos *schema.AtmosConfiguration, alias string) error
RegistryNotFound reports an unknown registry alias and lists the configured ones.
func ResolveCatalogReference ¶
func ResolveCatalogReference(atmos *schema.AtmosConfiguration, value string) (string, error)
ResolveCatalogReference maps a configured registry alias or an explicit oci:// reference to a catalog reference. Anything else is rejected with the aliases that would have worked.
func ResolveRegistryHost ¶
func ResolveRegistryHost(atmos *schema.AtmosConfiguration, value string) (string, error)
ResolveRegistryHost maps a configured registry alias or an explicit registry host to the host that credentials are scoped to. A bare word that is neither a configured alias nor shaped like a host (no dot, port, or localhost) is treated as a mistyped alias.
Types ¶
type AddOptions ¶
type AddOptions struct{ Alias, Source, Constraint, Layout, PinnedDigest, SelectedVersion string }
AddOptions selects an explicit package declaration and optional offline layout.
type Manager ¶
type Manager struct {
Project string
ConfigFile string
Config *schema.AtmosConfiguration
Installer *install.Service
}
Manager owns one scope's configuration and release lock transaction.
func (*Manager) Add ¶
func (m *Manager) Add(ctx context.Context, options AddOptions) error
Add installs a package and preserves unrelated root configuration and comments.
The alias is derived before the previous entry is looked up. Without --version an existing declaration for the same source keeps its constraint, and a new declaration is pinned with a caret from the release actually installed. An unchanged install writes nothing.
func (*Manager) EditRegistry ¶
func (m *Manager) EditRegistry(ctx context.Context, alias string, registry *schema.PluginRegistry) error
EditRegistry changes catalog configuration independently of registry credentials.
func (*Manager) Remove ¶
Remove removes a release declaration and lock only after checking auth references. Shared immutable cache entries remain available for other projects and rollback.
type RegistryCredentials ¶
type RegistryCredentials struct {
Auth *schema.AuthConfig
// Input supplies the password or token. Nil uses standard input.
Input io.Reader
// StdinIsTTY reports whether standard input is an interactive terminal. Nil probes the real one.
StdinIsTTY func() bool
// Open opens the keyring backend. Nil uses the configured Atmos keyring.
Open func(*schema.AuthConfig) (keyring.Keyring, error)
}
RegistryCredentials stores explicit registry credentials in the shared Atmos keyring. The seams default to the process terminal, standard input, and configured keyring backend.
func (*RegistryCredentials) Remove ¶
func (c *RegistryCredentials) Remove(host string) error
Remove deletes the stored credentials for a registry host. It is idempotent.
func (*RegistryCredentials) Store ¶
func (c *RegistryCredentials) Store(host, username string) error
Store reads a password from the input and saves it for the registry host. It refuses configurations that cannot persist the secret, rather than reporting a login that was lost.
type RestoreOptions ¶
RestoreOptions controls locked restoration and explicit version advancement.
type Status ¶
type Status struct {
Alias string `json:"alias" yaml:"alias"`
State string `json:"state" yaml:"state"`
Path string `json:"path,omitempty" yaml:"path,omitempty"`
// Source is "path" when plugins.packages.<alias>.path selects a local build, and empty for releases.
Source string `json:"source,omitempty" yaml:"source,omitempty"`
// Plugin and Version come from the local manifest of a path package; releases report them in Release.
Plugin string `json:"plugin,omitempty" yaml:"plugin,omitempty"`
Version string `json:"version,omitempty" yaml:"version,omitempty"`
// Hint explains how to resolve a state that needs attention, such as a corrupt cached release.
Hint string `json:"hint,omitempty" yaml:"hint,omitempty"`
Release *pluginlock.Entry `json:"release,omitempty" yaml:"release,omitempty"`
Manifest *manifest.Config `json:"manifest,omitempty" yaml:"manifest,omitempty"`
}
Status is a credential-free view of a selected package.