Documentation
¶
Overview ¶
Package config provides configuration management functionality.
Index ¶
- type Artifact
- type Builder
- func (b *Builder) Build() (*Config, error)
- func (b *Builder) WithDestination(destPath, sourcePathStrip string) *Builder
- func (b *Builder) WithRegistryCredentials(creds *RegistryCredentials) *Builder
- func (b *Builder) WithSource(sourceURL, sourcePathStrip string) *Builder
- func (b *Builder) WithViper(prefix string, v *viper.Viper) *Builder
- type Config
- type CredentialsResolver
- type Destination
- type DestinationConfig
- type JFrogConfig
- type RegistryConfig
- type RegistryCredentials
- type Source
- type SourceConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶ added in v0.5.6
type Builder struct {
// contains filtered or unexported fields
}
Builder provides a fluent interface for building configuration.
func NewBuilder ¶ added in v0.5.6
func NewBuilder() *Builder
NewBuilder creates a new configuration builder.
func (*Builder) WithDestination ¶ added in v0.5.6
WithDestination sets the destination configuration.
func (*Builder) WithRegistryCredentials ¶ added in v0.5.6
func (b *Builder) WithRegistryCredentials(creds *RegistryCredentials) *Builder
WithRegistryCredentials sets registry credentials.
func (*Builder) WithSource ¶ added in v0.5.6
WithSource sets the source configuration.
type Config ¶
type Config struct {
Source SourceConfig `yaml:"source"`
Destination DestinationConfig `yaml:"destination"`
LogLevel string `yaml:"log_level"`
Concurrent int `yaml:"concurrent"`
}
Config represents the configuration for the mirror process.
type CredentialsResolver ¶ added in v0.5.6
type CredentialsResolver struct {
// contains filtered or unexported fields
}
CredentialsResolver handles credential resolution from various sources.
func NewCredentialsResolver ¶ added in v0.5.6
func NewCredentialsResolver() *CredentialsResolver
NewCredentialsResolver creates a new credentials resolver.
func (*CredentialsResolver) ResolveCredentials ¶ added in v0.5.6
func (r *CredentialsResolver) ResolveCredentials(registryConfig *RegistryConfig, jfrogConfig *JFrogConfig) (*RegistryCredentials, error)
ResolveCredentials resolves registry credentials from flags and environment.
type Destination ¶
type Destination interface {
// Put stores an artifact in the destination
Put(ctx context.Context, artifact *Artifact, content io.Reader) error
// Exists checks if an artifact already exists in the destination
Exists(ctx context.Context, artifact *Artifact) (bool, error)
// Validate checks if the destination configuration is valid
Validate() error
}
Destination represents a location where artifacts can be stored.
type DestinationConfig ¶
type DestinationConfig struct {
Type string `yaml:"type"`
URL string `yaml:"url"`
User string `yaml:"user"`
Password string `yaml:"password"`
DestPath string `yaml:"dest_path"`
SourcePathStrip string `yaml:"source_path_strip"`
}
DestinationConfig represents the configuration for a destination.
type JFrogConfig ¶ added in v0.5.6
JFrogConfig holds JFrog configuration parameters.
type RegistryConfig ¶ added in v0.5.6
type RegistryConfig struct {
URL string
User string
Password string
Type string
PasswordFromStdin bool
}
RegistryConfig holds registry configuration parameters.
type RegistryCredentials ¶ added in v0.5.6
RegistryCredentials holds registry authentication information.
type Source ¶
type Source interface {
// List returns all available artifacts from the source
List(ctx context.Context) ([]*Artifact, error)
// Get retrieves a specific artifact by its coordinates
Get(ctx context.Context, artifact *Artifact) (io.ReadCloser, error)
// Validate checks if the source configuration is valid
Validate() error
}
Source represents a source from which artifacts can be retrieved.
type SourceConfig ¶
SourceConfig represents the configuration for a source.