profiles

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 AllNames

func AllNames() []string

func AllNonDefaultNames

func AllNonDefaultNames() []string

func ConfBool

func ConfBool(name string, def ...bool) bool

func ConfInt

func ConfInt(name string, def int) int

func ConfKeyExists

func ConfKeyExists(name string) bool

func ConfKeyExistsIn

func ConfKeyExistsIn(v *viper.Viper, name string) bool

func ConfString

func ConfString(name string, def string) string

func ConfStringFrom

func ConfStringFrom(v *viper.Viper, vd *viper.Viper, name string, def string) string

func ConfStringSlice

func ConfStringSlice(name string, def []string) []string

func ConfStringSliceFrom

func ConfStringSliceFrom(v *viper.Viper, vd *viper.Viper, name string, def []string) []string

func ConfStrings

func ConfStrings(name string) []string

func CopyToAndUse

func CopyToAndUse(name string) error

func Current

func Current() *viper.Viper

func CurrentName

func CurrentName() string

func Default

func Default() *viper.Viper

func Delete

func Delete(name string) error

func DeleteConf

func DeleteConf(name string)

func ReadDefaultConfig

func ReadDefaultConfig(dir string) error

First is error, second is warning

func SetConf

func SetConf(name string, val interface{})

func SetConfIn

func SetConfIn(v *viper.Viper, name string, val interface{})

func Use

func Use(name string) error

func WriteConfigAs

func WriteConfigAs(name string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址