Documentation
¶
Overview ¶
Package artifacts implements the `atmos artifacts` command space: publish, pull, copy, inspect, list, search, delete, sign, verify, and show.
The commands are thin wiring. They parse flags with the standard flag parser, build the artifact service through the composition root in pkg/artifact/compose, call one service method, and render the typed result. Packaging, repository access, signatures, locks, and conflict policy all live in the artifact service and its repositories, so the commands, workflow steps, and hooks share one implementation.
Index ¶
- func NewCommand() *cobra.Command
- func NewKindPublishCommand(spec *KindPublishSpec) *cobra.Command
- func SetAtmosConfig(config *schema.AtmosConfiguration)
- func UseCatalogFactory(factory CatalogFactory) (restore func())
- func UseServiceFactory(factory ServiceFactory) (restore func())
- type CatalogFactory
- type CommandProvider
- func (*CommandProvider) GetAliases() []internal.CommandAlias
- func (*CommandProvider) GetCommand() *cobra.Command
- func (*CommandProvider) GetCompatibilityFlags() map[string]compat.CompatibilityFlag
- func (*CommandProvider) GetFlagsBuilder() flags.Builder
- func (*CommandProvider) GetGroup() string
- func (*CommandProvider) GetName() string
- func (*CommandProvider) GetPositionalArgsBuilder() *flags.PositionalArgsBuilder
- func (*CommandProvider) IsExperimental() bool
- type KindPublishSpec
- type ServiceFactory
- type ServiceOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCommand ¶
NewCommand builds the `atmos artifacts` command tree with fresh flag parsers. The registered command is built once at package initialization; tests build their own to start from default flags.
func NewKindPublishCommand ¶
func NewKindPublishCommand(spec *KindPublishSpec) *cobra.Command
NewKindPublishCommand builds a convenience publish command for one artifact kind.
func SetAtmosConfig ¶
func SetAtmosConfig(config *schema.AtmosConfiguration)
SetAtmosConfig is called from root.go after the configuration is initialized.
func UseCatalogFactory ¶
func UseCatalogFactory(factory CatalogFactory) (restore func())
UseCatalogFactory replaces the catalog service factory and returns a function that restores the previous one. It is the seam command tests use; production code never calls it.
func UseServiceFactory ¶
func UseServiceFactory(factory ServiceFactory) (restore func())
UseServiceFactory replaces the service factory and returns a function that restores the previous one. It is the seam command tests use to run the real commands against injected repositories, verifiers, and signers; production code never calls it.
Types ¶
type CatalogFactory ¶
type CatalogFactory func(config *schema.AtmosConfiguration) (catalog.Maintainer, error)
CatalogFactory builds the catalog maintenance service for the loaded configuration. Tests replace it to inject a fake; production composes the real repositories lazily, so building the service performs no network access, credential resolution, or directory creation.
type CommandProvider ¶
type CommandProvider struct{}
CommandProvider registers the artifacts commands with the standard command registry.
func (*CommandProvider) GetAliases ¶
func (*CommandProvider) GetAliases() []internal.CommandAlias
GetAliases returns nil: the commands have no aliases.
func (*CommandProvider) GetCommand ¶
func (*CommandProvider) GetCommand() *cobra.Command
GetCommand returns the artifacts parent command with every subcommand attached.
func (*CommandProvider) GetCompatibilityFlags ¶
func (*CommandProvider) GetCompatibilityFlags() map[string]compat.CompatibilityFlag
GetCompatibilityFlags returns nil: the commands use native Cobra flags only.
func (*CommandProvider) GetFlagsBuilder ¶
func (*CommandProvider) GetFlagsBuilder() flags.Builder
GetFlagsBuilder returns nil: the subcommands own their flags.
func (*CommandProvider) GetGroup ¶
func (*CommandProvider) GetGroup() string
GetGroup returns the command group for help organization.
func (*CommandProvider) GetName ¶
func (*CommandProvider) GetName() string
GetName returns the command name.
func (*CommandProvider) GetPositionalArgsBuilder ¶
func (*CommandProvider) GetPositionalArgsBuilder() *flags.PositionalArgsBuilder
GetPositionalArgsBuilder returns nil: the parent command takes no positional arguments.
func (*CommandProvider) IsExperimental ¶
func (*CommandProvider) IsExperimental() bool
IsExperimental reports that the artifacts commands are experimental in V1.
type KindPublishSpec ¶
type KindPublishSpec struct {
// Use is the command usage line, for example "publish <source>".
Use string
// Short is the one-line description.
Short string
// Long is the long description.
Long string
// Example is the rendered usage examples.
Example string
// Kind is the artifact kind the command publishes, for example "scaffold".
Kind string
// Prefix is the Viper key prefix that keeps this command's values apart from every other
// command's, for example "scaffold.publish".
Prefix string
// Usage is the argument usage shown when the source argument is missing.
Usage string
}
KindPublishSpec describes a convenience publish command that supplies its artifact kind, such as `atmos scaffold publish`. The command delegates to the same publish pipeline as `atmos artifacts publish`: same flags (without --kind), same environment variables, same service, same result rendering, so the two can never drift.
type ServiceFactory ¶
type ServiceFactory = invoke.ServiceFactory
ServiceFactory builds the artifact service for the loaded configuration. Tests replace newService to inject a fake service; production composes the real repositories lazily, so building the service performs no network access, credential resolution, or directory creation.
type ServiceOptions ¶
type ServiceOptions = invoke.ServiceOptions
ServiceOptions are the per-invocation settings that reach the composition root.