Browse Source

More contemplation.

template-theme-rewrite
Benjamin Shelton 9 months ago
parent
commit
b889b33c73
1 changed files with 18 additions and 0 deletions
  1. +18
    -0
      utils/config.go

+ 18
- 0
utils/config.go View File

@ -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) {


Loading…
Cancel
Save