MCPcopy Create free account
hub / github.com/plexdrive/plexdrive / Read

Function Read

config/config.go:18–27  ·  view source on GitHub ↗

Read reads the configuration based on a filesystem path

(configPath string)

Source from the content-addressed store, hash-verified

16
17// Read reads the configuration based on a filesystem path
18func Read(configPath string) (*Config, error) {
19 configFile, err := ioutil.ReadFile(configPath)
20 if nil != err {
21 return nil, fmt.Errorf("Could not read config file in %v", configPath)
22 }
23
24 var config Config
25 json.Unmarshal(configFile, &config)
26 return &config, nil
27}
28
29// Create creates the configuration by requesting from stdin
30func Create(configPath string) (*Config, error) {

Callers 1

mainFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected