configsource

package
v0.115.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hook

type Hook interface {
	OnNew()
	OnRetrieve(scheme string, retrieved map[string]any)
	OnShutdown()
}

Hook is a means of providing introspection to a confmap.Provider's lifecycle, useful for evaluating Retrieve()'ed content.

type ProviderWrapper added in v0.101.0

type ProviderWrapper struct {
	// contains filtered or unexported fields
}

ProviderWrapper is the entrypoint for existing confmap.Providers to be provided with configsource.ConfigSource retrieval functionality. Once Wrap()'ed, their Retrieve() method as invoked by the service's confmap.Resolver will be further resolved by any applicable ConfigSource directives (including any initial `config_sources:` settings declarations).

func New

func New(logger *zap.Logger, hooks []Hook) *ProviderWrapper

func (*ProviderWrapper) ResolveForWrapped added in v0.101.0

func (pw *ProviderWrapper) ResolveForWrapped(ctx context.Context, uri string, onChange confmap.WatcherFunc, w *wrappedProvider) (*confmap.Retrieved, error)

ResolveForWrapped will retrieve from the wrappedProvider and, if possible, resolve all config source directives with their resolved values. If the wrappedProvider's retrieved value is only valid AsRaw() (scalar/array) then that will be returned without further evaluation.

func (*ProviderWrapper) Wrap added in v0.101.0

Wrap registers the provided confmap.ProviderWrapper in a provider store to proxy its methods and expose ConfigSource content resolution capabilities.

Jump to

Keyboard shortcuts

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