Documentation
¶
Index ¶
- Variables
- func AllNames() []string
- func AllNonDefaultNames() []string
- func ConfBool(name string, def ...bool) bool
- func ConfInt(name string, def int) int
- func ConfKeyExists(name string) bool
- func ConfKeyExistsIn(v *viper.Viper, name string) bool
- func ConfString(name string, def string) string
- func ConfStringFrom(v *viper.Viper, vd *viper.Viper, name string, def string) string
- func ConfStringSlice(name string, def []string) []string
- func ConfStringSliceFrom(v *viper.Viper, vd *viper.Viper, name string, def []string) []string
- func ConfStrings(name string) []string
- func CopyToAndUse(name string) error
- func Current() *viper.Viper
- func CurrentName() string
- func Default() *viper.Viper
- func Delete(name string) error
- func DeleteConf(name string)
- func ReadDefaultConfig(dir string) error
- func SetConf(name string, val interface{})
- func SetConfIn(v *viper.Viper, name string, val interface{})
- func Use(name string) error
- func WriteConfigAs(name string) error
Constants ¶
This section is empty.
Variables ¶
var OnWriteError func(path string, err error)
OnWriteError is called the first time saving the configuration fails, and not again.
Every setting the program remembers goes through one write: the files you have opened recently, the theme, the column layout, the profile in use. Those writes discarded their error, so a configuration directory that is read-only, full, or owned by somebody else produced a program that appeared to accept every preference and forgot all of them - with nothing said anywhere.
Once, not per write, because the cause does not go away: fifty settings against a read-only directory would otherwise be fifty dialogs. The path is passed because it is the thing the user has to go and fix.
Set by the UI at startup. Nil is fine - the failure is still logged.
Functions ¶
func AllNonDefaultNames ¶
func AllNonDefaultNames() []string
func ConfKeyExists ¶
func ConfString ¶
func ConfStringFrom ¶
func ConfStringSlice ¶
func ConfStringSliceFrom ¶
func ConfStrings ¶
func CopyToAndUse ¶
func CurrentName ¶
func CurrentName() string
func DeleteConf ¶
func DeleteConf(name string)
func WriteConfigAs ¶
Types ¶
This section is empty.