-
Notifications
You must be signed in to change notification settings - Fork 0
/
module.go
33 lines (27 loc) · 908 Bytes
/
module.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package caddy_dnsimple
import (
"github.com/caddyserver/caddy/v2"
"github.com/hack-as-a-service/caddy_dnsimple/provider"
)
// Provider lets Caddy read and manipulate DNS records hosted by this DNS provider.
type Provider struct{ *provider.Provider }
func init() {
caddy.RegisterModule(Provider{})
}
// CaddyModule returns the Caddy module information.
func (Provider) CaddyModule() caddy.ModuleInfo {
return caddy.ModuleInfo{
ID: "dns.providers.dnsimple",
New: func() caddy.Module { return &Provider{new(provider.Provider)} },
}
}
// Provision sets up the module. Implements caddy.Provisioner.
func (p *Provider) Provision(ctx caddy.Context) error {
p.Provider.APIToken = caddy.NewReplacer().ReplaceAll(p.Provider.APIToken, "")
p.Provider.AccountID = caddy.NewReplacer().ReplaceAll(p.Provider.AccountID, "")
return nil
}
// Interface guards
var (
_ caddy.Provisioner = (*Provider)(nil)
)