registry

package
v0.20.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Static is the registry for static config variables. These variables will
	// never be affected by a Watch-ed config, and maintain their original
	// values for the lifetime of the process.
	Static = viper.New()
	// Dynamic is the registry for dynamic config variables. If a config file is
	// found by viper, it will be watched by a threadsafe wrapper around a
	// second viper (see sync.Viper), and variables registered to it will pick
	// up changes to that config file throughout the lifetime of the process.
	Dynamic = sync.New()
)

Functions

func Combined

func Combined() *viper.Viper

Combined returns a viper combining the Static and Dynamic registries.

Types

type Bindable

type Bindable interface {
	BindEnv(vars ...string) error
	BindPFlag(key string, flag *pflag.Flag) error
	RegisterAlias(alias string, key string)
	SetDefault(key string, value any)
}

Bindable represents the methods needed to bind a value.Value to a given registry. It exists primarly to allow us to treat a sync.Viper as a viper.Viper for configuration registration purposes.

Jump to

Keyboard shortcuts

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