mirror of
https://github.com/foxcpp/maddy.git
synced 2025-04-04 21:47:40 +03:00
35 lines
606 B
Go
35 lines
606 B
Go
package libdns
|
|
|
|
import (
|
|
"github.com/foxcpp/maddy/framework/config"
|
|
"github.com/libdns/libdns"
|
|
)
|
|
|
|
type ProviderModule struct {
|
|
libdns.RecordDeleter
|
|
libdns.RecordAppender
|
|
setConfig func(c *config.Map)
|
|
afterConfig func() error
|
|
|
|
instName string
|
|
modName string
|
|
}
|
|
|
|
func (p *ProviderModule) Init(cfg *config.Map) error {
|
|
p.setConfig(cfg)
|
|
_, err := cfg.Process()
|
|
if p.afterConfig != nil {
|
|
if err := p.afterConfig(); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
return err
|
|
}
|
|
|
|
func (p *ProviderModule) Name() string {
|
|
return p.modName
|
|
}
|
|
|
|
func (p *ProviderModule) InstanceName() string {
|
|
return p.instName
|
|
}
|