Documentation ¶
Index ¶
- Constants
- type Instance
- func (i *Instance) AllKeys() []string
- func (i *Instance) Close() error
- func (i *Instance) Closed() bool
- func (i *Instance) ConfigPath() string
- func (i *Instance) Get(key string) interface{}
- func (i *Instance) GetBool(key string) bool
- func (i *Instance) GetInt(key string) int
- func (i *Instance) GetString(key string) string
- func (i *Instance) GetStringMap(key string) map[string]interface{}
- func (i *Instance) GetStringMapStringSlice(key string) map[string][]string
- func (i *Instance) GetStringSlice(key string) []string
- func (i *Instance) GetThenSet(key string, valueF func(currentValue interface{}) (interface{}, error)) error
- func (i *Instance) GetTime(key string) time.Time
- func (i *Instance) IsSet(key string) bool
- func (i *Instance) Set(key string, value interface{}) error
Constants ¶
View Source
const CancelSet = "__CANCEL__"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Instance ¶
type Instance struct {
// contains filtered or unexported fields
}
Instance holds our main config logic
func (*Instance) ConfigPath ¶
ConfigPath returns the path at which our configuration is stored
func (*Instance) GetStringMap ¶
GetStringMap retrieves a map of strings to values for a given key
func (*Instance) GetStringMapStringSlice ¶
GetStringMapStringSlice retrieves a map of string slices for a given key
func (*Instance) GetStringSlice ¶
GetStringSlice retrieves a slice of strings for a given key
func (*Instance) GetThenSet ¶
func (i *Instance) GetThenSet(key string, valueF func(currentValue interface{}) (interface{}, error)) error
GetThenSet updates a value at the given key. The valueF argument returns the new value to set based on the previous one. If the function returns with an error, the update is cancelled. The function ensures that no-other process or thread can modify the key between reading of the old value and setting the new value.
Click to show internal directories.
Click to hide internal directories.