Documentation ¶
Index ¶
Constants ¶
View Source
const (
// ContextConfigValue can be used as key to query the config object
ContextConfigValue = "github.com/aellwein/config/v1/config.Cfg"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cfg ¶
type Cfg interface { GetAll() map[string]interface{} Get(key string) interface{} GetString(key string) string GetBool(key string) bool GetInt(key string) int GetInt32(key string) int32 GetInt64(key string) int64 GetUint(key string) uint GetUint32(key string) uint32 GetUint64(key string) uint64 GetFloat64(key string) float64 GetDuration(key string) time.Duration GetIntSlice(key string) []int GetSizeInBytes(key string) uint GetTime(key string) time.Time GetStringSlice(key string) []string Set(key string, val interface{}) // Saves back the config (forces overwrite) Write() error }
Cfg defines an interface which is capable to provide object for interaction with configuration.
type CfgOption ¶
type CfgOption string
CfgOption provides a type for config options which can be passed using Options()
const ( // NoErrorOnMissingCfgFileOption defines that there should be no error upon creation of Cfg if none of config files could be found. NoErrorOnMissingCfgFileOption CfgOption = "NoErrorOnMissingCfgFileOption" )
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context is used to pass context with underlying config object to commands.
func NewContext ¶
NewContext creates a context containing the given config object
func (*Context) Done ¶
func (c *Context) Done() <-chan struct{}
Done has a no-op implementation of context.Context.Done()
Click to show internal directories.
Click to hide internal directories.