ReloadConfig reloads the config file, if possible.
(ctx context.Context)
| 1240 | |
| 1241 | // ReloadConfig reloads the config file, if possible. |
| 1242 | func (lc *Client) ReloadConfig(ctx context.Context) (ok bool, err error) { |
| 1243 | body, err := lc.send(ctx, "POST", "/localapi/v0/reload-config", 200, nil) |
| 1244 | if err != nil { |
| 1245 | return |
| 1246 | } |
| 1247 | res, err := decodeJSON[apitype.ReloadConfigResponse](body) |
| 1248 | if err != nil { |
| 1249 | return |
| 1250 | } |
| 1251 | if res.Err != "" { |
| 1252 | return false, errors.New(res.Err) |
| 1253 | } |
| 1254 | return res.Reloaded, nil |
| 1255 | } |
| 1256 | |
| 1257 | // SwitchToEmptyProfile creates and switches to a new unnamed profile. The new |
| 1258 | // profile is not assigned an ID until it is persisted after a successful login. |
no test coverage detected