forked from foxcpp/maddy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgcore.go
More file actions
34 lines (29 loc) · 756 Bytes
/
gcore.go
File metadata and controls
34 lines (29 loc) · 756 Bytes
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
34
//go:build libdns_gcore || !libdns_separate
// +build libdns_gcore !libdns_separate
package libdns
import (
"fmt"
"github.com/foxcpp/maddy/framework/config"
"github.com/foxcpp/maddy/framework/module"
"github.com/libdns/gcore"
)
func init() {
module.Register("libdns.gcore", func(modName, instName string, _, _ []string) (module.Module, error) {
p := gcore.Provider{}
return &ProviderModule{
RecordDeleter: &p,
RecordAppender: &p,
setConfig: func(c *config.Map) {
c.String("api_key", false, false, "", &p.APIKey)
},
afterConfig: func() error {
if p.APIKey == "" {
return fmt.Errorf("libdns.gcore: api_key should be specified")
}
return nil
},
instName: instName,
modName: modName,
}, nil
})
}