1
0
mirror of https://github.com/go-acme/lego.git synced 2024-12-23 17:21:50 +02:00
lego/internal/dns/providers/dns_providers.go.tmpl

28 lines
781 B
Cheetah
Raw Normal View History

// Code generated by 'make generate-dns'; DO NOT EDIT.
package dns
import (
"fmt"
"github.com/go-acme/lego/v4/challenge"
"github.com/go-acme/lego/v4/challenge/dns01"
{{- range $provider := .Providers }}
"github.com/go-acme/lego/v4/providers/dns/{{ cleanName $provider.Code }}"
{{- end}}
)
// NewDNSChallengeProviderByName Factory for DNS providers.
func NewDNSChallengeProviderByName(name string) (challenge.Provider, error) {
switch name {
case "manual":
return dns01.NewDNSProviderManual()
{{- range $provider := .Providers }}
case "{{ $provider.Code }}"{{range $alias := $provider.Aliases }},"{{ $alias }}"{{end}}:
return {{ cleanName $provider.Code }}.NewDNSProvider()
{{- end}}
default:
return nil, fmt.Errorf("unrecognized DNS provider: %s", name)
}
}