LoadFromReader is a convenience function that creates a ConfigFile object from a reader. It returns an error if configData is malformed.
(configData io.Reader)
| 108 | // LoadFromReader is a convenience function that creates a ConfigFile object from |
| 109 | // a reader. It returns an error if configData is malformed. |
| 110 | func LoadFromReader(configData io.Reader) (*configfile.ConfigFile, error) { |
| 111 | configFile := configfile.ConfigFile{ |
| 112 | AuthConfigs: make(map[string]types.AuthConfig), |
| 113 | } |
| 114 | err := configFile.LoadFromReader(configData) |
| 115 | return &configFile, err |
| 116 | } |
| 117 | |
| 118 | // Load reads the configuration file ([ConfigFileName]) from the given directory. |
| 119 | // If no directory is given, it uses the default [Dir]. A [*configfile.ConfigFile] |
searching dependent graphs…