manager

package
v0.405.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

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

func (m *Manager[R]) Get(ctx context.Context, ref configuration.Ref, value any) error

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]) List

func (m *Manager[R]) List(ctx context.Context) ([]configuration.Entry, error)

func (*Manager[R]) MapForModule

func (m *Manager[R]) MapForModule(ctx context.Context, module string) (map[string][]byte, error)

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]) Set

func (m *Manager[R]) Set(ctx context.Context, ref configuration.Ref, value any) error

Set a configuration value, encoding "value" as JSON before storing it.

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.

func (*Manager[R]) Unset

func (m *Manager[R]) Unset(ctx context.Context, ref configuration.Ref) error

Unset a configuration value in all providers.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL