Versions in this module Expand all Collapse all v0 v0.2.0 Mar 13, 2019 v0.1.0 Jul 23, 2018 Changes in this version + const ConfZeroPID + const ConfZeroPK + var ErrEditGroupConfig = errors.New("cannot edit a group of attribute") + var ErrInvalidGroup = errors.New("the service group is invalid") + var ErrInvalidSubtree = errors.New("subtree is invalid") + var ErrInvalidVersion = errors.New("config version is invalid") + var ErrOutdatedExec = errors.New("exec is out of date with config version") + var ErrUnexistingKey = errors.New("setting not found") + func Migrate(set Set, filename string, versionKey string, migrations []MigrateHandler, ...) error + type ConfigSaveOpts struct + Backup bool + Overwrite bool + type ConfigSet map[string]interface + func (cs ConfigSet) Save(filename string, perms os.FileMode, opts ConfigSaveOpts) error + type Configurable interface + Config func() interface{} + ID func() string + SetConfig func(interface{}) error + type MigrateHandler func(*Tree) error + type Migrator interface + Migrations func() []MigrateHandler + VersionKey func() string + type Set map[string]Configurable + func NewSet(configurables []Configurable) Set + func (s Set) Configs() ConfigSet + func (s Set) Get(key string) (interface{}, error) + func (s Set) Load(filename string) error + func (s Set) Save(filename string, perms os.FileMode, opts ConfigSaveOpts) error + func (s Set) Set(key string, value string) error + func (s Set) Tree() (*Tree, error) + type Tree struct + func TreeFromMap(m map[string]interface{}) (*Tree, error) + func (t *Tree) AddGroup(id, name, desc string) error + func (t *Tree) AddServiceToGroup(service, group string) error + func (t *Tree) Get(key string) interface{} + func (t *Tree) GetDefault(key string, def interface{}) interface{} + func (t *Tree) Set(key string, val interface{}) (err error)