Documentation
¶
Overview ¶
Package config contains the definition of the application config structure and logic required to load and update it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UpdateConfig ¶ added in v0.0.32
UpdateConfig locks a separate lock file, reads from disk, applies the changes from the anonymous function, writes to disk and unlocks the file.
Types ¶
type Clients ¶
type Clients struct {
AutoDiscovery bool `yaml:"auto_discovery"`
RegisteredClients []string `yaml:"registered_clients"`
}
Clients contains settings for client configuration.
type Config ¶
type Config struct {
Secrets Secrets `yaml:"secrets"`
Clients Clients `yaml:"clients"`
RegistryUrl string `yaml:"registry_url"`
CACertificatePath string `yaml:"ca_certificate_path,omitempty"`
}
Config represents the configuration of the application.
func GetConfig ¶
func GetConfig() *Config
GetConfig is a Singleton that returns the application configuration.
func LoadOrCreateConfig ¶
LoadOrCreateConfig fetches the application configuration. If it does not already exist - it will create a new config file with default values.
type Secrets ¶
type Secrets struct {
ProviderType string `yaml:"provider_type"`
}
Secrets contains the settings for secrets management.
func (*Secrets) GetProviderType ¶ added in v0.0.33
func (s *Secrets) GetProviderType() (secrets.ProviderType, error)
GetProviderType returns the secrets provider type from the environment variable or application config. It first checks the TOOLHIVE_SECRETS_PROVIDER environment variable, and falls back to the config file.