Skip to content

Commit

Permalink
dnsimple: add debug option (#1630)
Browse files Browse the repository at this point in the history
  • Loading branch information
msporleder-work authored Apr 25, 2022
1 parent 6b8d5a0 commit e83220c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions providers/dns/dnsimple/dnsimple.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const (

EnvOAuthToken = envNamespace + "OAUTH_TOKEN"
EnvBaseURL = envNamespace + "BASE_URL"
EnvDebug = envNamespace + "DEBUG"

EnvTTL = envNamespace + "TTL"
EnvPropagationTimeout = envNamespace + "PROPAGATION_TIMEOUT"
Expand All @@ -29,6 +30,7 @@ const (

// Config is used to configure the creation of the DNSProvider.
type Config struct {
Debug bool
AccessToken string
BaseURL string
PropagationTimeout time.Duration
Expand All @@ -40,6 +42,7 @@ type Config struct {
func NewDefaultConfig() *Config {
return &Config{
TTL: env.GetOrDefaultInt(EnvTTL, dns01.DefaultTTL),
Debug: env.GetOrDefaultBool(EnvDebug, false),
PropagationTimeout: env.GetOrDefaultSecond(EnvPropagationTimeout, dns01.DefaultPropagationTimeout),
PollingInterval: env.GetOrDefaultSecond(EnvPollingInterval, dns01.DefaultPollingInterval),
}
Expand Down Expand Up @@ -81,6 +84,8 @@ func NewDNSProviderConfig(config *Config) (*DNSProvider, error) {
client.BaseURL = config.BaseURL
}

client.Debug = config.Debug

return &DNSProvider{client: client, config: config}, nil
}

Expand Down

0 comments on commit e83220c

Please sign in to comment.