MCPcopy
hub / github.com/tailscale/tailscale / ReloadConfig

Method ReloadConfig

client/local/local.go:1242–1255  ·  view source on GitHub ↗

ReloadConfig reloads the config file, if possible.

(ctx context.Context)

Source from the content-addressed store, hash-verified

1240
1241// ReloadConfig reloads the config file, if possible.
1242func (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.

Callers 2

reloadConfigFunction · 0.45

Calls 2

sendMethod · 0.95
NewMethod · 0.45

Tested by

no test coverage detected