func (e ErrCNAMERequired) Error() string {
	return fmt.Sprintf("acme-dns: new account created for %q. "+
		"To complete setup for %q you must provision the following "+
		"CNAME in your DNS zone and re-run this provider when it is "+
		"in place:\n"+
		"%s CNAME %s.",
		e.Domain, e.Domain, e.FQDN, e.Target)
}
Error returns a descriptive message for the ErrCNAMERequired instance telling
the user that a CNAME needs to be added to the DNS zone of c.Domain before
the ACME-DNS hook will work. The CNAME to be created should be of the form:
{{ c.FQDN }} 	CNAME	{{ c.Target }}
package acmedns
import (
	"errors"
	"fmt"
	"github.com/cpu/goacmedns"
	"github.com/go-acme/lego/v4/challenge/dns01"
	"github.com/go-acme/lego/v4/platform/config/env"
)
const (
	envNamespace = "ACME_DNS_"
	EnvAPIBase = envNamespace + "API_BASE"
	EnvStoragePath = envNamespace + "STORAGE_PATH"
)
type acmeDNSClient interface {
	UpdateTXTRecord(goacmedns.Account, string) error
	RegisterAccount([]string) (goacmedns.Account, error)
}
type DNSProvider struct {
	client  acmeDNSClient
	storage goacmedns.Storage
}
func NewDNSProvider() (*DNSProvider, error) {
	values, err := env.Get(EnvAPIBase, EnvStoragePath)
	if err != nil {
		return nil, fmt.Errorf("acme-dns: %w", err)
	}
	client := goacmedns.NewClient(values[EnvAPIBase])
	storage := goacmedns.NewFileStorage(values[EnvStoragePath], 0o600)
	return NewDNSProviderClient(client, storage)
}
func NewDNSProviderClient(client acmeDNSClient, storage goacmedns.Storage) (*DNSProvider, error) {
	if client == nil {
		return nil, errors.New("ACME-DNS Client must be not nil")
	}
	if storage == nil {
		return nil, errors.New("ACME-DNS Storage must be not nil")
	}
	return &DNSProvider{
		client:  client,
		storage: storage,
	}, nil
}
type ErrCNAMERequired struct {
	Domain string
	FQDN string
	Target string
}