Documentation ¶
Index ¶
- func ConfigFromEnvironment() []string
- func ProviderKeyForAccessor(accessor *url.URL) configuration.ProviderKey
- type Manager
- func New[R configuration.Role](ctx context.Context, router configuration.Router[R], ...) (*Manager[R], error)
- func NewDefaultConfigurationManagerFromConfig(ctx context.Context, registry *providers.Registry[configuration.Configuration], ...) (*Manager[configuration.Configuration], error)
- func NewDefaultSecretsManagerFromConfig(ctx context.Context, registry *providers.Registry[configuration.Secrets], ...) (*Manager[configuration.Secrets], error)
- func (m *Manager[R]) Get(ctx context.Context, ref configuration.Ref, value any) error
- func (m *Manager[R]) List(ctx context.Context) ([]configuration.Entry, error)
- func (m *Manager[R]) MapForModule(ctx context.Context, module string) (map[string][]byte, error)
- func (m *Manager[R]) ProviderKey() configuration.ProviderKey
- func (m *Manager[R]) Set(ctx context.Context, ref configuration.Ref, value any) error
- func (m *Manager[R]) SetJSON(ctx context.Context, ref configuration.Ref, value json.RawMessage) error
- func (m *Manager[R]) Unset(ctx context.Context, ref configuration.Ref) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigFromEnvironment ¶
func ConfigFromEnvironment() []string
func ProviderKeyForAccessor ¶
func ProviderKeyForAccessor(accessor *url.URL) configuration.ProviderKey
Types ¶
type Manager ¶
type Manager[R configuration.Role] struct { // contains filtered or unexported fields }
Manager is a high-level configuration manager that abstracts the details of the Router and Provider interfaces.
func New ¶
func New[R configuration.Role](ctx context.Context, router configuration.Router[R], provider configuration.Provider[R]) (*Manager[R], error)
New configuration manager.
func NewDefaultConfigurationManagerFromConfig ¶
func NewDefaultConfigurationManagerFromConfig(ctx context.Context, registry *providers.Registry[configuration.Configuration], projectConfig projectconfig.Config) (*Manager[configuration.Configuration], error)
NewDefaultConfigurationManagerFromConfig creates a new configuration manager from the project config found in the config paths.
func NewDefaultSecretsManagerFromConfig ¶
func NewDefaultSecretsManagerFromConfig(ctx context.Context, registry *providers.Registry[configuration.Secrets], projectConfig projectconfig.Config) (*Manager[configuration.Secrets], error)
NewDefaultSecretsManagerFromConfig creates a new secrets manager from the project config found in the config paths.
func (*Manager[R]) Get ¶
Get a configuration value from the active providers.
"value" must be a pointer to a Go type that can be unmarshalled from JSON.
func (*Manager[R]) MapForModule ¶
MapForModule combines all configuration values visible to the module. Local values take precedence.
func (*Manager[R]) ProviderKey ¶ added in v0.394.0
func (m *Manager[R]) ProviderKey() configuration.ProviderKey
ProviderKeys returns the keys of the available providers.
func (*Manager[R]) SetJSON ¶
func (m *Manager[R]) SetJSON(ctx context.Context, ref configuration.Ref, value json.RawMessage) error
SetJSON sets a configuration value using raw JSON data.