MCPcopy Index your code
hub / github.com/syncthing/syncthing / getConfig

Function getConfig

cmd/syncthing/cli/utils.go:98–113  ·  view source on GitHub ↗
(c APIClient)

Source from the content-addressed store, hash-verified

96}
97
98func getConfig(c APIClient) (config.Configuration, error) {
99 cfg := config.Configuration{}
100 response, err := c.Get("system/config")
101 if err != nil {
102 return cfg, err
103 }
104 bytes, err := responseToBArray(response)
105 if err != nil {
106 return cfg, err
107 }
108 err = json.Unmarshal(bytes, &cfg)
109 if err != nil {
110 return config.Configuration{}, err
111 }
112 return cfg, nil
113}
114
115func prettyPrintJSON(data interface{}) error {
116 enc := json.NewEncoder(os.Stdout)

Callers 2

RunMethod · 0.85
RunMethod · 0.85

Calls 3

responseToBArrayFunction · 0.85
GetMethod · 0.65
UnmarshalMethod · 0.45

Tested by

no test coverage detected