Documentation
¶
Overview ¶
Package file provides config file support for uconfig
Index ¶
- Variables
- func New(path string, unmarshal Unmarshal, config Config) plugins.Plugin
- func NewMulti(path string, unmarshalOptions UnmarshalOptions, optional bool) plugins.Plugin
- func NewReader(src io.Reader, filepath string, unmarshal Unmarshal) plugins.Plugin
- type Config
- type Files
- type Plugin
- type Unmarshal
- type UnmarshalOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrEncodingFailed = errors.New("failed to decode file")
View Source
var ErrFileExtNotSupported = errors.New("file extension not supported")
Functions ¶
func NewMulti ¶ added in v0.8.0
func NewMulti(path string, unmarshalOptions UnmarshalOptions, optional bool) plugins.Plugin
NewMutli returns a multi unmarshal plugin that can decode the file from path using various Unmarshal functions provided in unmarshal map. This is usually used as a second stage to load configurations based on a flag or configuration value.
Types ¶
type Config ¶
type Config struct {
// indicates if a file that does not exist should be ignored.
Optional bool
}
Config describes the options required for a file.
type Files ¶
Files represents a set of file paths and the appropriate unmarshal function for the given file.
type UnmarshalOptions ¶ added in v0.8.0
Click to show internal directories.
Click to hide internal directories.