Documentation ¶
Index ¶
- type Config
- type Inspector
- type NanoconfFinder
- func (nf *NanoconfFinder) AddName(name string) *NanoconfFinder
- func (nf *NanoconfFinder) AddPath(cfgpath string) *NanoconfFinder
- func (nf *NanoconfFinder) CleanNames() *NanoconfFinder
- func (nf *NanoconfFinder) CleanPaths() *NanoconfFinder
- func (nf *NanoconfFinder) DefaultSetup(usr *user.User) *NanoconfFinder
- func (nf *NanoconfFinder) FindAll() []string
- func (nf *NanoconfFinder) FindDefault() string
- func (nf *NanoconfFinder) FindFirst() string
- func (nf *NanoconfFinder) SetDefaultConfig(cfgpath string) *NanoconfFinder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func (*Config) Find ¶
Find returns a context of the tree config. Each YAML-based config is basically a tree. So Find resets the root of the tree to a specific point.
func (*Config) SetSeparator ¶
SetSeparator sets a separator for Find path. Default is ":".
type Inspector ¶
type Inspector struct {
// contains filtered or unexported fields
}
func NewInspector ¶
func (*Inspector) DefaultInt ¶
DefaultInt is a wrapper around Int method, allowing return default value, in case nothing has been found. Overlay value is an empty string and it doesn't mean 0, but nil.
type NanoconfFinder ¶
type NanoconfFinder struct {
// contains filtered or unexported fields
}
func (*NanoconfFinder) AddName ¶
func (nf *NanoconfFinder) AddName(name string) *NanoconfFinder
AddName adds a name to the stack
func (*NanoconfFinder) AddPath ¶
func (nf *NanoconfFinder) AddPath(cfgpath string) *NanoconfFinder
AddPath adds a path to the stack
func (*NanoconfFinder) CleanNames ¶
func (nf *NanoconfFinder) CleanNames() *NanoconfFinder
CleanNames removes all the names from the stack
func (*NanoconfFinder) CleanPaths ¶
func (nf *NanoconfFinder) CleanPaths() *NanoconfFinder
CleanPaths removes all the paths from the stack
func (*NanoconfFinder) DefaultSetup ¶
func (nf *NanoconfFinder) DefaultSetup(usr *user.User) *NanoconfFinder
Setup typical locations for the user: /etc, $HOME/.config..., $HOME/.<cfg> etc. If user is nil, current user is used.
func (*NanoconfFinder) FindAll ¶
func (nf *NanoconfFinder) FindAll() []string
FindAll finds all possible configuration files that would match the search.
func (*NanoconfFinder) FindDefault ¶
func (nf *NanoconfFinder) FindDefault() string
FindDefault returns assumed confguration that could be default, unless it is pre-set.
func (*NanoconfFinder) FindFirst ¶
func (nf *NanoconfFinder) FindFirst() string
FindFirst finds nearest configuration that matches the search
func (*NanoconfFinder) SetDefaultConfig ¶
func (nf *NanoconfFinder) SetDefaultConfig(cfgpath string) *NanoconfFinder