Documentation ¶
Index ¶
- func Key(elems ...string) string
- func MissingKeyMessage(key string) func(format string, args ...any) string
- type Config
- func (c Config) Bool(ctx context.Context, key string, defaultTo ...bool) (bool, error)
- func (c Config) Bytes(ctx context.Context, key string, defaultTo ...byte) ([]byte, error)
- func (c Config) Float(ctx context.Context, key string, defaultTo ...float64) (float64, error)
- func (c Config) Int(ctx context.Context, key string, defaultTo ...int) (int, error)
- func (c Config) String(ctx context.Context, key string, defaultTo ...string) (string, error)
- func (c Config) Strings(ctx context.Context, key string, defaultTo ...string) ([]string, error)
- func (c Config) URL(ctx context.Context, key string, defaultTo ...*url.URL) (*url.URL, error)
- type Configurable
- type InMemoryConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
Configurable
}
func New ¶
func New(configurable Configurable) *Config
type Configurable ¶
type InMemoryConfig ¶
type InMemoryConfig struct { sync.RWMutex Values map[any]any // contains filtered or unexported fields }
func NewInMemoryConfig ¶
func NewInMemoryConfig(values ...map[any]any) *InMemoryConfig
func (*InMemoryConfig) Merge ¶
func (i *InMemoryConfig) Merge(ctx context.Context, configurable Configurable) (Configurable, error)
Click to show internal directories.
Click to hide internal directories.