client/tailscale: add SetDNS func

Updates #1235

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
bradfitz/acme
Brad Fitzpatrick 4 years ago
parent f0121468f4
commit 796e222901

@ -256,3 +256,12 @@ func Logout(ctx context.Context) error {
_, err := send(ctx, "POST", "/localapi/v0/logout", http.StatusNoContent, nil)
return err
}
// SetDNS adds a DNS TXT record.
func SetDNS(ctx context.Context, name, value string) error {
v := url.Values{}
v.Set("name", name)
v.Set("value", value)
_, err := send(ctx, "POST", "/localapi/v0/set-dns?"+v.Encode(), 200, nil)
return err
}

Loading…
Cancel
Save