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