Documentation
¶
Index ¶
Constants ¶
View Source
const ( OpNew = "configurer: new ->" OpUnmarshalKey = "configurer: unmarshal key ->" OpUnmarshal = "configurer: unmarshal ->" OpOverwrite = "configurer: overwrite ->" OpParseFlag = "configurer: parse flag ->" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Configurer ¶
type Configurer interface {
// UnmarshalKey takes a single key and unmarshal it into a Struct.
UnmarshalKey(name string, out any) error
// Unmarshal the config into a Struct. Make sure that the tags
// on the fields of the structure are properly set.
Unmarshal(out any) error
// Overwrite used to overwrite particular values in the unmarshalled config
Overwrite(values map[string]any) error
// Get used to get config section
Get(name string) any
// Has checks if config section exists.
Has(name string) bool
GracefulTimeout() time.Duration
// Version returns current version
Version() string
}
func NewConfigurer ¶
type Option ¶
type Option func(*configurer)
func WithConfigType ¶
func WithPrefix ¶
func WithReadInCfg ¶
Click to show internal directories.
Click to hide internal directories.