maddy

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

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

 1//go:build libdns_metaname || libdns_all
 2// +build libdns_metaname libdns_all
 3
 4package libdns
 5
 6import (
 7	"github.com/foxcpp/maddy/framework/config"
 8	"github.com/foxcpp/maddy/framework/module"
 9	"github.com/libdns/metaname"
10)
11
12func init() {
13	module.Register("libdns.metaname", func(modName, instName string, _, _ []string) (module.Module, error) {
14		p := metaname.Provider{
15			Endpoint: "https://metaname.net/api/1.1",
16		}
17		return &ProviderModule{
18			RecordDeleter:  &p,
19			RecordAppender: &p,
20			setConfig: func(c *config.Map) {
21				c.String("api_key", false, false, "", &p.APIKey)
22				c.String("account_ref", false, false, "", &p.AccountReference)
23			},
24			instName: instName,
25			modName:  modName,
26		}, nil
27	})
28}