Releases: joeig/go-powerdns
Releases · joeig/go-powerdns
v3.14.1
v3.14.0
v3.13.1
v3.13.0
New
New
with functional options (#93).
Deprecate
NewClient
is now deprecated and will be removed with the next major release (#93). Please see the migration path below.NewClient
internally usesNew
.
How do I migrate NewClient
to New
?
The functionality of NewClient
and New
is identical, but their signature is not. This is the function signature of NewClient
:
// Deprecated!
func NewClient(baseURL string, vHost string, headers map[string]string, httpClient *http.Client) *Client
New
replaces the headers
and httpClient
parameters with options
:
func New(baseURL string, vHost string, options ...NewOption) *Client
Possible options:
func WithHeaders(headers map[string]string) NewOption // Corresponds to the `headers` parameter
func WithHTTPClient(httpClient *http.Client) NewOption // Corresponds to the `httpClient` parameter
func WithAPIKey(key string) NewOption // Corresponds to the `headers` parameter with `map[string]string{"X-API-Key": key}`
I need neither an API key, custom headers, nor a custom http.Client
.
Omit the options completely.
- client := powerdns.NewClient("http://localhost:80", "localhost", nil, nil)
+ client := powerdns.New("http://localhost:80", "localhost")
I only need the X-API-Key
header.
Use the WithAPIKey
option.
- client := powerdns.NewClient("http://localhost:80", "localhost", map[string]string{"X-API-Key": "apipw"}, nil)
+ client := powerdns.New("http://localhost:80", "localhost", powerdns.WithAPIKey("apipw"))
I need custom headers and a custom http.Client
.
Use the WithHeaders
and WithHTTPClient
options.
- client := powerdns.NewClient("http://localhost:80", "localhost", map[string]string{"X-Custom": "foo"}, &http.Client{})
+ client := powerdns.New("http://localhost:80", "localhost", powerdns.WithHeaders(map[string]string{"X-Custom": "foo"}), powerdns.WithHTTPClient(&http.Client{}))
v3.12.0
v3.11.0
v3.10.0
v3.9.0
v3.8.0
v3.7.0
New
Deprecate
- Deprecate Go 1.18 in accordance with Go's version support policy (#64)
Note that the minimum Go version that is required to compile this module is unaffected and remains 1.16. - Deprecate support for PowerDNS Authoritative Server 4.5 (#65)