|
|
@ -97,8 +97,26 @@ func FindConfig(filename string, opts *PathOptions) (string, error) { |
|
|
|
return "", ErrNoSuchConfig |
|
|
|
} |
|
|
|
|
|
|
|
// Configurator provides parsing access to YAML configurations with an option to
|
|
|
|
// a) load a predefined configuration from a VFS construct (local directory, zip
|
|
|
|
// files, embedded assets, etc), use that configuration as the target defaults,
|
|
|
|
// and then replace the values with a configuration file defined elsewhere
|
|
|
|
// (current directory, XDG_CONFIG_HOME, /etc, and so forth).
|
|
|
|
type Configurator struct { |
|
|
|
collection *vfs.VFSCollection |
|
|
|
|
|
|
|
// Defaults indicates the filename from which default values should be
|
|
|
|
// extracted.
|
|
|
|
Defaults string |
|
|
|
} |
|
|
|
|
|
|
|
func (c *Configurator) AddVFS(fs vfs.FileSystem) { |
|
|
|
c.collection.AddVFS(fs) |
|
|
|
} |
|
|
|
|
|
|
|
func (c *Configurator) Load(file string, v interface{}) error { |
|
|
|
|
|
|
|
return nil |
|
|
|
} |
|
|
|
|
|
|
|
func (c *Configurator) VFSConfig(filename string, opts *PathOptions) (vfs.ReadSeekCloser, error) { |
|
|
|