lego/internal/dnsdocs/dns.go.tmpl

62 lines
1.5 KiB
Cheetah
Raw Permalink Normal View History

// Code generated by 'make generate-dns'; DO NOT EDIT.
package cmd
import (
"fmt"
2023-01-08 13:53:15 +00:00
"io"
"sort"
"strings"
"text/tabwriter"
)
func allDNSCodes() string {
providers := []string{
"manual",
{{- range $provider := .Providers }}
"{{ $provider.Code }}",
{{- end}}
}
sort.Strings(providers)
return strings.Join(providers, ", ")
}
2023-01-08 13:53:15 +00:00
func displayDNSHelp(w io.Writer, name string) error {
w = tabwriter.NewWriter(w, 0, 0, 2, ' ', 0)
ew := &errWriter{w: w}
switch name {
2019-10-24 23:27:40 +00:00
{{- range $provider := .Providers }}
case "{{ $provider.Code }}":
// generated from: {{ .GeneratedFrom }}
ew.writeln(`Configuration for {{ $provider.Name }}.`)
ew.writeln(`Code: '{{ $provider.Code }}'`)
ew.writeln(`Since: '{{ $provider.Since }}'`)
ew.writeln()
{{if $provider.Configuration }}{{if $provider.Configuration.Credentials }}
ew.writeln(`Credentials:`)
{{- range $k, $v := $provider.Configuration.Credentials }}
ew.writeln(` - "{{ $k }}": {{ safe $v }}`)
{{- end}}
ew.writeln()
{{end}}{{if $provider.Configuration.Additional }}
ew.writeln(`Additional Configuration:`)
{{- range $k, $v := $provider.Configuration.Additional }}
ew.writeln(` - "{{ $k }}": {{ safe $v }}`)
{{- end}}
{{end}}{{end}}
ew.writeln()
ew.writeln(`More information: https://go-acme.github.io/lego/dns/{{ $provider.Code }}`)
{{end}}
case "manual":
ew.writeln(`Solving the DNS-01 challenge using CLI prompt.`)
default:
return fmt.Errorf("%q is not yet supported", name)
}
2023-01-08 13:53:15 +00:00
if flusher, ok := w.(interface{ Flush() error }); ok {
return flusher.Flush()
}
2023-01-08 13:53:15 +00:00
return nil
}