func NewDNSProviderConfig(config *Config) (*DNSProvider, error) {
	if config == nil {
		return nil, errors.New("simply: the configuration of the DNS provider is nil")
	}
	if config.AccountName == "" {
		return nil, errors.New("simply: missing credentials: account name")
	}
	if config.APIKey == "" {
		return nil, errors.New("simply: missing credentials: api key")
	}
	client, err := internal.NewClient(config.AccountName, config.APIKey)
	if err != nil {
		return nil, fmt.Errorf("simply: failed to create client: %w", err)
	}
	if config.HTTPClient != nil {
		client.HTTPClient = config.HTTPClient
	}
	return &DNSProvider{
		config:    config,
		client:    client,
		recordIDs: make(map[string]int64),
	}, nil
}
NewDNSProviderConfig return a DNSProvider instance configured for Simply.com.
package simply
import (
	"errors"
	"fmt"
	"net/http"
	"strings"
	"sync"
	"time"
	"github.com/go-acme/lego/v4/challenge/dns01"
	"github.com/go-acme/lego/v4/platform/config/env"
	"github.com/go-acme/lego/v4/providers/dns/simply/internal"
)
const (
	envNamespace = "SIMPLY_"
	EnvAccountName = envNamespace + "ACCOUNT_NAME"
	EnvAPIKey      = envNamespace + "API_KEY"
	EnvTTL                = envNamespace + "TTL"
	EnvPropagationTimeout = envNamespace + "PROPAGATION_TIMEOUT"
	EnvPollingInterval    = envNamespace + "POLLING_INTERVAL"
	EnvHTTPTimeout        = envNamespace + "HTTP_TIMEOUT"
)
type Config struct {
	AccountName        string
	APIKey             string
	PropagationTimeout time.Duration
	PollingInterval    time.Duration
	TTL                int
	HTTPClient         *http.Client
}
func NewDefaultConfig() *Config {
	return &Config{
		TTL:                env.GetOrDefaultInt(EnvTTL, dns01.DefaultTTL),
		PropagationTimeout: env.GetOrDefaultSecond(EnvPropagationTimeout, 5*time.Minute),
		PollingInterval:    env.GetOrDefaultSecond(EnvPollingInterval, 10*time.Second),
		HTTPClient: &http.Client{
			Timeout: env.GetOrDefaultSecond(EnvHTTPTimeout, 30*time.Second),
		},
	}
}
type DNSProvider struct {
	config *Config
	client *internal.Client
	recordIDs   map[string]int64
	recordIDsMu sync.Mutex
}
func NewDNSProvider() (*DNSProvider, error) {
	values, err := env.Get(EnvAccountName, EnvAPIKey)
	if err != nil {
		return nil, fmt.Errorf("simply: %w", err)
	}
	config := NewDefaultConfig()
	config.AccountName = values[EnvAccountName]
	config.APIKey = values[EnvAPIKey]
	return NewDNSProviderConfig(config)
}