Go PowerDNS 4.x API Client
context.Context
to all API boundariesThis library now requires context.Context
for all methods which are requesting external APIs. Passing a Context is best practice in the Go ecosystem, which allows you to cancel requests to external APIs under specific circumstances in order to make your application more robust against external factors, such as timeouts.
Migration is simple: Add a Context such as context.Background()
as a first paramter to any API methods.
// Old method (without Context):
zone, err := pdns.Zones.Get("example.com")
// New method (with Context):
zone, err := pdns.Zones.Get(context.Background(), "example.com")
This applies to any API methods.