MCPcopy Index your code
hub / github.com/docker/cli / LoadFromReader

Function LoadFromReader

cli/config/config.go:110–116  ·  view source on GitHub ↗

LoadFromReader is a convenience function that creates a ConfigFile object from a reader. It returns an error if configData is malformed.

(configData io.Reader)

Source from the content-addressed store, hash-verified

108// LoadFromReader is a convenience function that creates a ConfigFile object from
109// a reader. It returns an error if configData is malformed.
110func 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]

Callers 4

TestJSONReaderNoFileFunction · 0.85
TestJSONSaveWithNoFileFunction · 0.85

Calls 1

LoadFromReaderMethod · 0.95

Tested by 4

TestJSONReaderNoFileFunction · 0.68
TestJSONSaveWithNoFileFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…