1
0
mirror of https://github.com/go-acme/lego.git synced 2024-12-26 03:09:37 +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"
"os"
"sort"
"strings"
"text/tabwriter"
)
func allDNSCodes() string {
providers := []string{
"manual",
{{- range $provider := .Providers }}
"{{ $provider.Code }}",
{{- end}}
}
sort.Strings(providers)
return strings.Join(providers, ", ")
}
func displayDNSHelp(name string) error {
2019-05-27 19:20:45 +02:00
w := tabwriter.NewWriter(os.Stdout, 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)
}
if ew.err != nil {
2020-02-27 20:14:46 +02:00
return fmt.Errorf("error: %w", ew.err)
}
return w.Flush()
}