func NewDNSProvider() (*DNSProvider, error) {
	values, err := env.Get(EnvAPIKey)
	if err != nil {
		return nil, fmt.Errorf("dreamhost: %w", err)
	}
	config := NewDefaultConfig()
	config.APIKey = values[EnvAPIKey]
	return NewDNSProviderConfig(config)
}
NewDNSProvider returns a new DNS provider using
environment variable DREAMHOST_API_KEY for adding and removing the DNS record.
package dreamhost
import (
	"errors"
	"fmt"
	"net/http"
	"time"
	"github.com/go-acme/lego/v4/challenge/dns01"
	"github.com/go-acme/lego/v4/platform/config/env"
)
const (
	envNamespace = "DREAMHOST_"
	EnvAPIKey = envNamespace + "API_KEY"
	EnvPropagationTimeout = envNamespace + "PROPAGATION_TIMEOUT"
	EnvPollingInterval    = envNamespace + "POLLING_INTERVAL"
	EnvHTTPTimeout        = envNamespace + "HTTP_TIMEOUT"
)
type Config struct {
	BaseURL            string
	APIKey             string
	PropagationTimeout time.Duration
	PollingInterval    time.Duration
	HTTPClient         *http.Client
}
func NewDefaultConfig() *Config {
	return &Config{
		BaseURL:            defaultBaseURL,
		PropagationTimeout: env.GetOrDefaultSecond(EnvPropagationTimeout, 60*time.Minute),
		PollingInterval:    env.GetOrDefaultSecond(EnvPollingInterval, 1*time.Minute),
		HTTPClient: &http.Client{
			Timeout: env.GetOrDefaultSecond(EnvHTTPTimeout, 30*time.Second),
		},
	}
}
type DNSProvider struct {
	config *Config
}