dnsimple: add debug option (#1630)
This commit is contained in:
parent
6b8d5a0afc
commit
e83220c1c5
1 changed files with 5 additions and 0 deletions
|
@ -21,6 +21,7 @@ const (
|
|||
|
||||
EnvOAuthToken = envNamespace + "OAUTH_TOKEN"
|
||||
EnvBaseURL = envNamespace + "BASE_URL"
|
||||
EnvDebug = envNamespace + "DEBUG"
|
||||
|
||||
EnvTTL = envNamespace + "TTL"
|
||||
EnvPropagationTimeout = envNamespace + "PROPAGATION_TIMEOUT"
|
||||
|
@ -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
|
||||
|
@ -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),
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue