maddy

Fork https://github.com/foxcpp/maddy

git clone git://git.lin.moe/go/maddy.git

 1//go:build go1.16
 2// +build go1.16
 3
 4package libdns
 5
 6import (
 7	"github.com/foxcpp/maddy/framework/config"
 8	"github.com/foxcpp/maddy/framework/module"
 9	"github.com/libdns/namecheap"
10)
11
12func init() {
13	module.Register("libdns.namecheap", func(modName, instName string, _, _ []string) (module.Module, error) {
14		p := namecheap.Provider{}
15		return &ProviderModule{
16			RecordDeleter:  &p,
17			RecordAppender: &p,
18			setConfig: func(c *config.Map) {
19				c.String("api_key", false, true, "", &p.APIKey)
20				c.String("api_username", false, true, "", &p.User)
21				c.String("endpoint", false, false, "", &p.APIEndpoint)
22				c.String("client_ip", false, false, "", &p.ClientIP)
23			},
24			instName: instName,
25			modName:  modName,
26		}, nil
27	})
28}