1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

Rename provider handles to *Provider (#914)

This commit is contained in:
Tom Limoncelli
2020-10-26 09:25:30 -04:00
committed by GitHub
parent 29c7ff3a05
commit ca30c9c34f
43 changed files with 318 additions and 318 deletions

View File

@ -10,7 +10,7 @@ import (
// Api layer for Internet.bs
type api struct {
type internetbsProvider struct {
key string
password string
}
@ -28,7 +28,7 @@ type domainRecord struct {
Nameserver []string `json:"nameserver"`
}
func (c *api) getNameservers(domain string) ([]string, error) {
func (c *internetbsProvider) getNameservers(domain string) ([]string, error) {
var bodyString, err = c.get("/Domain/Info", requestParams{"Domain": domain})
if err != nil {
return []string{}, fmt.Errorf("failed fetching nameservers list (Internet.bs): %s", err)
@ -40,7 +40,7 @@ func (c *api) getNameservers(domain string) ([]string, error) {
return ns, nil
}
func (c *api) updateNameservers(ns []string, domain string) error {
func (c *internetbsProvider) updateNameservers(ns []string, domain string) error {
rec := requestParams{}
rec["Domain"] = domain
rec["Ns_list"] = strings.Join(ns, ",")
@ -50,7 +50,7 @@ func (c *api) updateNameservers(ns []string, domain string) error {
return nil
}
func (c *api) get(endpoint string, params requestParams) ([]byte, error) {
func (c *internetbsProvider) get(endpoint string, params requestParams) ([]byte, error) {
client := &http.Client{}
req, _ := http.NewRequest("GET", "https://api.internet.bs/"+endpoint, nil)
q := req.URL.Query()