MCPcopy Create free account
hub / github.com/rilldata/rill / GetAll

Method GetAll

cli/pkg/dotrill/dotrill.go:56–77  ·  view source on GitHub ↗

GetAll loads all values from ~/.rill/{filename}. It assumes filename identifies a YAML file.

(filename string)

Source from the content-addressed store, hash-verified

54// GetAll loads all values from ~/.rill/{filename}.
55// It assumes filename identifies a YAML file.
56func (d DotRill) GetAll(filename string) (map[string]string, error) {
57 filename, err := d.ResolveFilename(filename, false)
58 if err != nil {
59 return nil, err
60 }
61
62 data, err := os.ReadFile(filename)
63 if err != nil {
64 if os.IsNotExist(err) {
65 return map[string]string{}, nil
66 }
67 return nil, err
68 }
69
70 conf := map[string]string{}
71 err = yaml.Unmarshal(data, &conf)
72 if err != nil {
73 return nil, err
74 }
75
76 return conf, nil
77}
78
79// Get returns a single entry from ~/.rill/{filename}.
80// It assumes filename identifies a YAML file.

Callers 2

GetMethod · 0.95
SetMethod · 0.95

Calls 1

ResolveFilenameMethod · 0.95

Tested by

no test coverage detected