Documentation ¶
Index ¶
- func Filename() string
- func Get(key string) interface{}
- func GetDuration(key string) time.Duration
- func GetEnclave(key string) *memguard.Enclave
- func GetString(key string) string
- func GetStringMapString(key string) map[string]string
- func GetUint32(key string) uint32
- func Init() error
- func IsSet(key string) bool
- func Load(configPath string) error
- func Reset()
- func Set(key string, value interface{})
- func SetDefaults(dbPath string)
- func SetFilename(filename string)
- func Write(filename string, exclusive bool) error
- func WriteStruct(filename string) error
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Filename ¶ added in v0.7.1
func Filename() string
Filename returns the name of the file that the configuration is using.
func Get ¶ added in v0.2.0
func Get(key string) interface{}
Get returns an uncasted value from the config map.
func GetDuration ¶ added in v0.2.0
GetDuration returns a duration from the config map.
func GetEnclave ¶ added in v0.2.0
GetEnclave returns an enclave from the config map.
func GetStringMapString ¶ added in v0.4.0
GetStringMapString returns a map[string]string from the config map.
func Set ¶ added in v0.2.0
func Set(key string, value interface{})
Set sets a value to the config map.
func SetDefaults ¶ added in v0.2.0
func SetDefaults(dbPath string)
SetDefaults populates the config map with the default values.
func SetFilename ¶ added in v0.7.1
func SetFilename(filename string)
SetFilename sets the configuration filename.
func Write ¶ added in v0.2.0
Write encodes and writes the config map to the specified file.
If exclusive is true an error will be returned if the file already exists, otherwise it will truncate the file and write to it.
func WriteStruct ¶ added in v0.2.0
WriteStruct writes the configuration empty structure to the given file.
Types ¶
type Config ¶ added in v0.2.0
type Config struct {
// contains filtered or unexported fields
}
Config contains the elements for handling the configuration.