MCPcopy
hub / github.com/benbjohnson/litestream / ReadConfigFile

Function ReadConfigFile

cmd/litestream/main.go:601–609  ·  view source on GitHub ↗

ReadConfigFile unmarshals config from filename. Expands path if needed. If expandEnv is true then environment variables are expanded in the config.

(filename string, expandEnv bool)

Source from the content-addressed store, hash-verified

599// ReadConfigFile unmarshals config from filename. Expands path if needed.
600// If expandEnv is true then environment variables are expanded in the config.
601func ReadConfigFile(filename string, expandEnv bool) (Config, error) {
602 f, err := OpenConfigFile(filename)
603 if err != nil {
604 return DefaultConfig(), err
605 }
606 defer f.Close()
607
608 return ParseConfig(f, expandEnv)
609}
610
611// ParseConfig unmarshals config from a reader.
612// If expandEnv is true then environment variables are expanded in the config.

Callers 7

RunMethod · 0.85
ParseFlagsMethod · 0.85
RunMethod · 0.85
RunMethod · 0.85
ExecuteMethod · 0.85
loadFromConfigMethod · 0.85
RunMethod · 0.85

Calls 4

OpenConfigFileFunction · 0.85
DefaultConfigFunction · 0.85
ParseConfigFunction · 0.85
CloseMethod · 0.45

Tested by

no test coverage detected