Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCollectionNotFound = errors.New("collection not found")
ErrCollectionNotFound occurred when settings file cannot be found in search paths.
Functions ¶
This section is empty.
Types ¶
type Collection ¶
type Collection struct { // Extension is settings file extension, default is 'yaml'. Extension string // Paths is list of directories to look for settings file. // Default values are as follows, // - $HOME/.config // - /etc (Non Windows) // - /usr/local/etc (Non Windows) SearchPaths []string // contains filtered or unexported fields }
Collection is a group of settings which are saved in a single yaml file.
func NewCollection ¶
func NewCollection(name, dirname string) (*Collection, error)
NewCollection create new collection given its name and directory name.
func (*Collection) Load ¶
func (cl *Collection) Load(v interface{}) error
Load read settings file and unmarshal the content as given v. For example, if a collection created with directory name 'test' and named 'settings', with default extension, then this function will look for SEARCH_DIR/test/settings.yaml.
Click to show internal directories.
Click to hide internal directories.