1
0
mirror of https://github.com/go-acme/lego.git synced 2024-12-25 11:02:56 +02:00
lego/internal/dnsdocs/dns.go.tmpl

63 lines
1.5 KiB
Cheetah
Raw Normal View History

package cmd
// CODE GENERATED AUTOMATICALLY
// THIS FILE MUST NOT BE EDITED BY HAND
import (
"fmt"
2023-01-08 15:53:15 +02: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 15:53:15 +02: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-25 01:27:40 +02: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 15:53:15 +02:00
if flusher, ok := w.(interface{ Flush() error }); ok {
return flusher.Flush()
}
2023-01-08 15:53:15 +02:00
return nil
}