Documentation
¶
Index ¶
Constants ¶
View Source
const ( OpNew = "configurer: new ->" OpUnmarshalKey = "configurer: unmarshal key ->" OpUnmarshal = "configurer: unmarshal ->" OpOverwrite = "configurer: overwrite ->" OpParseFlag = "configurer: parse flag ->" )
View Source
const DefaultGracefulTimeout = 30 * time.Second
View Source
const PluginName string = "config"
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 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 GracefulTimeout() time.Duration SetGracefulTimeout(timeout time.Duration) Configurer // Version returns current version Version() string }
func NewConfigurer ¶
func NewConfigurer(version string, options ...Option) (Configurer, error)
type Option ¶
type Option func(*configurer)
func WithConfigType ¶
func WithPrefix ¶
func WithReadInCfg ¶
Click to show internal directories.
Click to hide internal directories.