Documentation
¶
Overview ¶
Package config provides configuration management for quad-ops
Index ¶
Constants ¶
const ( DefaultRepositoryDir = "/var/lib/quad-ops" DefaultSyncInterval = 5 * time.Minute DefaultQuadletDir = "/etc/containers/systemd" DefaultUserRepositoryDir = "$HOME/.local/share/quad-ops" DefaultUserQuadletDir = "$HOME/.config/containers/systemd" DefaultUserMode = false DefaultVerbose = false DefaultUnitStartTimeout = 10 * time.Second DefaultImagePullTimeout = 30 * time.Second )
Default configuration values for the quad-ops system. These constants define the default values for various configuration settings, such as the repository directory, sync interval, quadlet directory, database path, user mode, and verbosity.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockProvider ¶ added in v0.21.0
MockProvider is a test implementation of Provider for testing purposes.
func (*MockProvider) GetConfig ¶ added in v0.21.0
func (m *MockProvider) GetConfig() *Settings
GetConfig returns the mock configuration.
func (*MockProvider) InitConfig ¶ added in v0.21.0
func (m *MockProvider) InitConfig() *Settings
InitConfig initializes the mock configuration (returns existing config).
func (*MockProvider) SetConfig ¶ added in v0.21.0
func (m *MockProvider) SetConfig(config *Settings)
SetConfig sets the mock configuration (for testing convenience).
func (*MockProvider) SetConfigFilePath ¶ added in v0.21.0
func (m *MockProvider) SetConfigFilePath(path string)
SetConfigFilePath sets the mock configuration file path.
type Provider ¶ added in v0.9.0
type Provider interface {
// GetConfig returns the current application configuration.
GetConfig() *Settings
// SetConfig sets the application configuration.
SetConfig(c *Settings)
// InitConfig initializes the application configuration.
InitConfig() *Settings
// SetConfigFilePath sets the configuration file path.
SetConfigFilePath(p string)
}
Provider defines the interface for configuration providers.
func NewConfigProvider ¶ added in v0.21.0
func NewConfigProvider() Provider
NewConfigProvider creates and initializes a new config provider.
func NewDefaultConfigProvider ¶ added in v0.9.0
func NewDefaultConfigProvider() Provider
NewDefaultConfigProvider creates a new default config provider.
type Repository ¶
type Repository struct {
Name string `yaml:"name"`
URL string `yaml:"url"`
Reference string `yaml:"ref,omitempty"`
ComposeDir string `yaml:"composeDir,omitempty"`
}
Repository represents a repository that is managed by the quad-ops system. It contains information about the repository, including its name, URL, target directory, and compose directory.
type Settings ¶ added in v0.9.0
type Settings struct {
RepositoryDir string `yaml:"repositoryDir"`
SyncInterval time.Duration `yaml:"syncInterval"`
QuadletDir string `yaml:"quadletDir"`
Repositories []Repository `yaml:"repositories"`
UserMode bool `yaml:"userMode"`
Verbose bool `yaml:"verbose"`
UnitStartTimeout time.Duration `yaml:"unitStartTimeout"`
ImagePullTimeout time.Duration `yaml:"imagePullTimeout"`
}
Settings represents the configuration for the quad-ops system. It contains various settings such as the repository directory, sync interval, quadlet directory, database path, user mode, and verbosity.