MCPcopy
hub / github.com/IceWhaleTech/CasaOS / GetConfigByName

Function GetConfigByName

pkg/utils/httper/drive.go:132–146  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

130}
131
132func GetConfigByName(name string) (map[string]string, error) {
133
134 res, err := NewRestyClient().R().SetFormData(map[string]string{
135 "name": name,
136 }).Post("/config/get")
137 if err != nil {
138 return nil, err
139 }
140 if res.StatusCode() != 200 {
141 return nil, fmt.Errorf("create config failed")
142 }
143 var result map[string]string
144 json.Unmarshal(res.Body(), &result)
145 return result, nil
146}
147func GetAllConfigName() (RemotesResult, error) {
148 var result RemotesResult
149 res, err := NewRestyClient().R().SetFormData(map[string]string{}).Post("/config/listremotes")

Callers 3

CheckAndMountByNameMethod · 0.92
CheckAndMountAllMethod · 0.92
GetConfigByNameMethod · 0.92

Calls 1

NewRestyClientFunction · 0.70

Tested by

no test coverage detected