Skip to content

Commit 08e9db6

Browse files
authored
chore: minor changes (#2581)
1 parent b8beddc commit 08e9db6

File tree

38 files changed

+146
-146
lines changed

38 files changed

+146
-146
lines changed

cmd/zz_gen_cmd_dnshelp.go

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/content/dns/zz_gen_dode.md

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/content/dns/zz_gen_duckdns.md

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

providers/dns/corenetworks/internal/client.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func NewClient(login, password string) *Client {
3838

3939
// ListZone gets a list of all DNS zones.
4040
// https://beta.api.core-networks.de/doc/#functon_dnszones
41-
func (c Client) ListZone(ctx context.Context) ([]Zone, error) {
41+
func (c *Client) ListZone(ctx context.Context) ([]Zone, error) {
4242
endpoint := c.baseURL.JoinPath("dnszones")
4343

4444
req, err := newJSONRequest(ctx, http.MethodGet, endpoint, nil)
@@ -57,7 +57,7 @@ func (c Client) ListZone(ctx context.Context) ([]Zone, error) {
5757

5858
// GetZoneDetails provides detailed information about a DNS zone.
5959
// https://beta.api.core-networks.de/doc/#functon_dnszones_details
60-
func (c Client) GetZoneDetails(ctx context.Context, zone string) (*ZoneDetails, error) {
60+
func (c *Client) GetZoneDetails(ctx context.Context, zone string) (*ZoneDetails, error) {
6161
endpoint := c.baseURL.JoinPath("dnszones", zone)
6262

6363
req, err := newJSONRequest(ctx, http.MethodGet, endpoint, nil)
@@ -76,7 +76,7 @@ func (c Client) GetZoneDetails(ctx context.Context, zone string) (*ZoneDetails,
7676

7777
// ListRecords gets a list of DNS records belonging to the zone.
7878
// https://beta.api.core-networks.de/doc/#functon_dnszones_records
79-
func (c Client) ListRecords(ctx context.Context, zone string) ([]Record, error) {
79+
func (c *Client) ListRecords(ctx context.Context, zone string) ([]Record, error) {
8080
endpoint := c.baseURL.JoinPath("dnszones", zone, "records")
8181

8282
req, err := newJSONRequest(ctx, http.MethodGet, endpoint, nil)
@@ -95,7 +95,7 @@ func (c Client) ListRecords(ctx context.Context, zone string) ([]Record, error)
9595

9696
// AddRecord adds a record.
9797
// https://beta.api.core-networks.de/doc/#functon_dnszones_records_add
98-
func (c Client) AddRecord(ctx context.Context, zone string, record Record) error {
98+
func (c *Client) AddRecord(ctx context.Context, zone string, record Record) error {
9999
endpoint := c.baseURL.JoinPath("dnszones", zone, "records", "/")
100100

101101
if record.Name == "" {
@@ -117,7 +117,7 @@ func (c Client) AddRecord(ctx context.Context, zone string, record Record) error
117117

118118
// DeleteRecords deletes all DNS records of a zone that match the DNS record passed.
119119
// https://beta.api.core-networks.de/doc/#functon_dnszones_records_delete
120-
func (c Client) DeleteRecords(ctx context.Context, zone string, record Record) error {
120+
func (c *Client) DeleteRecords(ctx context.Context, zone string, record Record) error {
121121
endpoint := c.baseURL.JoinPath("dnszones", zone, "records", "delete")
122122

123123
if record.Name == "" {
@@ -139,7 +139,7 @@ func (c Client) DeleteRecords(ctx context.Context, zone string, record Record) e
139139

140140
// CommitRecords sends a commit to the zone.
141141
// https://beta.api.core-networks.de/doc/#functon_dnszones_commit
142-
func (c Client) CommitRecords(ctx context.Context, zone string) error {
142+
func (c *Client) CommitRecords(ctx context.Context, zone string) error {
143143
endpoint := c.baseURL.JoinPath("dnszones", zone, "records", "commit")
144144

145145
req, err := newJSONRequest(ctx, http.MethodPost, endpoint, nil)
@@ -155,7 +155,7 @@ func (c Client) CommitRecords(ctx context.Context, zone string) error {
155155
return nil
156156
}
157157

158-
func (c Client) do(req *http.Request, result any) error {
158+
func (c *Client) do(req *http.Request, result any) error {
159159
at := getToken(req.Context())
160160
if at != "" {
161161
req.Header.Set(authorizationHeader, "Bearer "+at)

providers/dns/corenetworks/internal/identity.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const tokenKey token = "token"
1313

1414
// CreateAuthenticationToken gets an authentication token.
1515
// https://beta.api.core-networks.de/doc/#functon_auth_token
16-
func (c Client) CreateAuthenticationToken(ctx context.Context) (*Token, error) {
16+
func (c *Client) CreateAuthenticationToken(ctx context.Context) (*Token, error) {
1717
endpoint := c.baseURL.JoinPath("auth", "token")
1818

1919
req, err := newJSONRequest(ctx, http.MethodPost, endpoint, Auth{Login: c.login, Password: c.password})
@@ -30,7 +30,7 @@ func (c Client) CreateAuthenticationToken(ctx context.Context) (*Token, error) {
3030
return &token, nil
3131
}
3232

33-
func (c Client) CreateAuthenticatedContext(ctx context.Context) (context.Context, error) {
33+
func (c *Client) CreateAuthenticatedContext(ctx context.Context) (context.Context, error) {
3434
tok, err := c.CreateAuthenticationToken(ctx)
3535
if err != nil {
3636
return nil, err

providers/dns/cpanel/internal/cpanel/client.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func NewClient(baseURL, username, token string) (*Client, error) {
4040

4141
// FetchZoneInformation fetches zone information.
4242
// https://api.docs.cpanel.net/openapi/cpanel/operation/dns-parse_zone/
43-
func (c Client) FetchZoneInformation(ctx context.Context, domain string) ([]shared.ZoneRecord, error) {
43+
func (c *Client) FetchZoneInformation(ctx context.Context, domain string) ([]shared.ZoneRecord, error) {
4444
endpoint := c.baseURL.JoinPath("DNS", "parse_zone")
4545

4646
query := endpoint.Query()
@@ -64,7 +64,7 @@ func (c Client) FetchZoneInformation(ctx context.Context, domain string) ([]shar
6464
// AddRecord adds a new record.
6565
//
6666
// add='{"dname":"example", "ttl":14400, "record_type":"TXT", "data":["string1", "string2"]}'
67-
func (c Client) AddRecord(ctx context.Context, serial uint32, domain string, record shared.Record) (*shared.ZoneSerial, error) {
67+
func (c *Client) AddRecord(ctx context.Context, serial uint32, domain string, record shared.Record) (*shared.ZoneSerial, error) {
6868
data, err := json.Marshal(record)
6969
if err != nil {
7070
return nil, fmt.Errorf("failed to create request JSON data: %w", err)
@@ -76,7 +76,7 @@ func (c Client) AddRecord(ctx context.Context, serial uint32, domain string, rec
7676
// EditRecord edits an existing record.
7777
//
7878
// edit='{"line_index": 9, "dname":"example", "ttl":14400, "record_type":"TXT", "data":["string1", "string2"]}'
79-
func (c Client) EditRecord(ctx context.Context, serial uint32, domain string, record shared.Record) (*shared.ZoneSerial, error) {
79+
func (c *Client) EditRecord(ctx context.Context, serial uint32, domain string, record shared.Record) (*shared.ZoneSerial, error) {
8080
data, err := json.Marshal(record)
8181
if err != nil {
8282
return nil, fmt.Errorf("failed to create request JSON data: %w", err)
@@ -88,12 +88,12 @@ func (c Client) EditRecord(ctx context.Context, serial uint32, domain string, re
8888
// DeleteRecord deletes an existing record.
8989
//
9090
// remove=22
91-
func (c Client) DeleteRecord(ctx context.Context, serial uint32, domain string, lineIndex int) (*shared.ZoneSerial, error) {
91+
func (c *Client) DeleteRecord(ctx context.Context, serial uint32, domain string, lineIndex int) (*shared.ZoneSerial, error) {
9292
return c.updateZone(ctx, serial, domain, "remove", strconv.Itoa(lineIndex))
9393
}
9494

9595
// https://api.docs.cpanel.net/openapi/cpanel/operation/dns-mass_edit_zone/
96-
func (c Client) updateZone(ctx context.Context, serial uint32, domain, action, data string) (*shared.ZoneSerial, error) {
96+
func (c *Client) updateZone(ctx context.Context, serial uint32, domain, action, data string) (*shared.ZoneSerial, error) {
9797
endpoint := c.baseURL.JoinPath("DNS", "mass_edit_zone")
9898

9999
query := endpoint.Query()
@@ -116,7 +116,7 @@ func (c Client) updateZone(ctx context.Context, serial uint32, domain, action, d
116116
return &result.Data, nil
117117
}
118118

119-
func (c Client) doRequest(ctx context.Context, endpoint *url.URL, result any) error {
119+
func (c *Client) doRequest(ctx context.Context, endpoint *url.URL, result any) error {
120120
req, err := http.NewRequestWithContext(ctx, http.MethodGet, endpoint.String(), http.NoBody)
121121
if err != nil {
122122
return fmt.Errorf("unable to create request: %w", err)

providers/dns/cpanel/internal/whm/client.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func NewClient(baseURL, username, token string) (*Client, error) {
4040

4141
// FetchZoneInformation fetches zone information.
4242
// https://api.docs.cpanel.net/openapi/whm/operation/parse_dns_zone/
43-
func (c Client) FetchZoneInformation(ctx context.Context, domain string) ([]shared.ZoneRecord, error) {
43+
func (c *Client) FetchZoneInformation(ctx context.Context, domain string) ([]shared.ZoneRecord, error) {
4444
endpoint := c.baseURL.JoinPath("parse_dns_zone")
4545

4646
query := endpoint.Query()
@@ -64,7 +64,7 @@ func (c Client) FetchZoneInformation(ctx context.Context, domain string) ([]shar
6464
// AddRecord adds a new record.
6565
//
6666
// add='{"dname":"example", "ttl":14400, "record_type":"TXT", "data":["string1", "string2"]}'
67-
func (c Client) AddRecord(ctx context.Context, serial uint32, domain string, record shared.Record) (*shared.ZoneSerial, error) {
67+
func (c *Client) AddRecord(ctx context.Context, serial uint32, domain string, record shared.Record) (*shared.ZoneSerial, error) {
6868
data, err := json.Marshal(record)
6969
if err != nil {
7070
return nil, fmt.Errorf("failed to create request JSON data: %w", err)
@@ -76,7 +76,7 @@ func (c Client) AddRecord(ctx context.Context, serial uint32, domain string, rec
7676
// EditRecord edits an existing record.
7777
//
7878
// edit='{"line_index": 9, "dname":"example", "ttl":14400, "record_type":"TXT", "data":["string1", "string2"]}'
79-
func (c Client) EditRecord(ctx context.Context, serial uint32, domain string, record shared.Record) (*shared.ZoneSerial, error) {
79+
func (c *Client) EditRecord(ctx context.Context, serial uint32, domain string, record shared.Record) (*shared.ZoneSerial, error) {
8080
data, err := json.Marshal(record)
8181
if err != nil {
8282
return nil, fmt.Errorf("failed to create request JSON data: %w", err)
@@ -88,12 +88,12 @@ func (c Client) EditRecord(ctx context.Context, serial uint32, domain string, re
8888
// DeleteRecord deletes an existing record.
8989
//
9090
// remove=22
91-
func (c Client) DeleteRecord(ctx context.Context, serial uint32, domain string, lineIndex int) (*shared.ZoneSerial, error) {
91+
func (c *Client) DeleteRecord(ctx context.Context, serial uint32, domain string, lineIndex int) (*shared.ZoneSerial, error) {
9292
return c.updateZone(ctx, serial, domain, "remove", strconv.Itoa(lineIndex))
9393
}
9494

9595
// https://api.docs.cpanel.net/openapi/whm/operation/mass_edit_dns_zone/
96-
func (c Client) updateZone(ctx context.Context, serial uint32, domain, action, data string) (*shared.ZoneSerial, error) {
96+
func (c *Client) updateZone(ctx context.Context, serial uint32, domain, action, data string) (*shared.ZoneSerial, error) {
9797
endpoint := c.baseURL.JoinPath("mass_edit_dns_zone")
9898

9999
query := endpoint.Query()
@@ -116,7 +116,7 @@ func (c Client) updateZone(ctx context.Context, serial uint32, domain, action, d
116116
return &result.Data, nil
117117
}
118118

119-
func (c Client) doRequest(ctx context.Context, endpoint *url.URL, result any) error {
119+
func (c *Client) doRequest(ctx context.Context, endpoint *url.URL, result any) error {
120120
query := endpoint.Query()
121121
query.Set("api.version", "1")
122122
endpoint.RawQuery = query.Encode()

providers/dns/derak/internal/client.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func NewClient(apiKey string) *Client {
3737

3838
// GetRecords gets all records.
3939
// Note: the response is not influenced by the query parameters, so the documentation seems wrong.
40-
func (c Client) GetRecords(ctx context.Context, zoneID string, params *GetRecordsParameters) (*GetRecordsResponse, error) {
40+
func (c *Client) GetRecords(ctx context.Context, zoneID string, params *GetRecordsParameters) (*GetRecordsResponse, error) {
4141
endpoint := c.baseURL.JoinPath("zones", zoneID, "dnsrecords")
4242

4343
v, err := querystring.Values(params)
@@ -61,7 +61,7 @@ func (c Client) GetRecords(ctx context.Context, zoneID string, params *GetRecord
6161
}
6262

6363
// GetRecord gets a record by ID.
64-
func (c Client) GetRecord(ctx context.Context, zoneID, recordID string) (*Record, error) {
64+
func (c *Client) GetRecord(ctx context.Context, zoneID, recordID string) (*Record, error) {
6565
endpoint := c.baseURL.JoinPath("zones", zoneID, "dnsrecords", recordID)
6666

6767
req, err := newJSONRequest(ctx, http.MethodGet, endpoint, nil)
@@ -79,7 +79,7 @@ func (c Client) GetRecord(ctx context.Context, zoneID, recordID string) (*Record
7979
}
8080

8181
// CreateRecord creates a new record.
82-
func (c Client) CreateRecord(ctx context.Context, zoneID string, record Record) (*Record, error) {
82+
func (c *Client) CreateRecord(ctx context.Context, zoneID string, record Record) (*Record, error) {
8383
endpoint := c.baseURL.JoinPath("zones", zoneID, "dnsrecords")
8484

8585
req, err := newJSONRequest(ctx, http.MethodPut, endpoint, record)
@@ -97,7 +97,7 @@ func (c Client) CreateRecord(ctx context.Context, zoneID string, record Record)
9797
}
9898

9999
// EditRecord edits an existing record.
100-
func (c Client) EditRecord(ctx context.Context, zoneID, recordID string, record Record) (*Record, error) {
100+
func (c *Client) EditRecord(ctx context.Context, zoneID, recordID string, record Record) (*Record, error) {
101101
endpoint := c.baseURL.JoinPath("zones", zoneID, "dnsrecords", recordID)
102102

103103
req, err := newJSONRequest(ctx, http.MethodPatch, endpoint, record)
@@ -115,7 +115,7 @@ func (c Client) EditRecord(ctx context.Context, zoneID, recordID string, record
115115
}
116116

117117
// DeleteRecord deletes an existing record.
118-
func (c Client) DeleteRecord(ctx context.Context, zoneID, recordID string) error {
118+
func (c *Client) DeleteRecord(ctx context.Context, zoneID, recordID string) error {
119119
endpoint := c.baseURL.JoinPath("zones", zoneID, "dnsrecords", recordID)
120120

121121
req, err := newJSONRequest(ctx, http.MethodDelete, endpoint, nil)
@@ -140,7 +140,7 @@ func (c Client) DeleteRecord(ctx context.Context, zoneID, recordID string) error
140140
// GetZones gets zones.
141141
// Note: it's not a part of the official API, there is no documentation about this.
142142
// The endpoint comes from UI calls analysis.
143-
func (c Client) GetZones(ctx context.Context) ([]Zone, error) {
143+
func (c *Client) GetZones(ctx context.Context) ([]Zone, error) {
144144
req, err := http.NewRequestWithContext(ctx, http.MethodGet, c.zoneEndpoint, http.NoBody)
145145
if err != nil {
146146
return nil, err
@@ -159,7 +159,7 @@ func (c Client) GetZones(ctx context.Context) ([]Zone, error) {
159159
return response.Result, nil
160160
}
161161

162-
func (c Client) do(req *http.Request, result any) error {
162+
func (c *Client) do(req *http.Request, result any) error {
163163
req.SetBasicAuth("api", c.apiKey)
164164

165165
resp, err := c.HTTPClient.Do(req)

providers/dns/directadmin/internal/client.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func NewClient(baseURL, username, password string) (*Client, error) {
3838
}, nil
3939
}
4040

41-
func (c Client) SetRecord(ctx context.Context, domain string, record Record) error {
41+
func (c *Client) SetRecord(ctx context.Context, domain string, record Record) error {
4242
data, err := querystring.Values(record)
4343
if err != nil {
4444
return err
@@ -49,7 +49,7 @@ func (c Client) SetRecord(ctx context.Context, domain string, record Record) err
4949
return c.do(ctx, domain, data)
5050
}
5151

52-
func (c Client) DeleteRecord(ctx context.Context, domain string, record Record) error {
52+
func (c *Client) DeleteRecord(ctx context.Context, domain string, record Record) error {
5353
data, err := querystring.Values(record)
5454
if err != nil {
5555
return err
@@ -60,7 +60,7 @@ func (c Client) DeleteRecord(ctx context.Context, domain string, record Record)
6060
return c.do(ctx, domain, data)
6161
}
6262

63-
func (c Client) do(ctx context.Context, domain string, data url.Values) error {
63+
func (c *Client) do(ctx context.Context, domain string, data url.Values) error {
6464
endpoint := c.baseURL.JoinPath("CMD_API_DNS_CONTROL")
6565

6666
query := endpoint.Query()

providers/dns/dode/dode.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ lego --email you@example.com --dns dode -d '*.example.com' -d example.com run
1515
[Configuration.Additional]
1616
DODE_POLLING_INTERVAL = "Time between DNS propagation check in seconds (Default: 2)"
1717
DODE_PROPAGATION_TIMEOUT = "Maximum waiting time for DNS propagation in seconds (Default: 60)"
18-
DODE_TTL = "The TTL of the TXT record used for the DNS challenge in seconds (Default: 120)"
1918
DODE_HTTP_TIMEOUT = "API request timeout in seconds (Default: 30)"
2019
DODE_SEQUENCE_INTERVAL = "Time between sequential requests in seconds (Default: 60)"
2120

0 commit comments

Comments
 (0)