1
0
mirror of https://github.com/taigrr/godns synced 2025-01-18 04:03:25 -08:00
godns/notify/manager.go
2021-03-02 17:31:26 +08:00

35 lines
554 B
Go

package notify
import (
"sync"
"github.com/TimothyYe/godns"
)
var (
instance *notifyManager
once sync.Once
)
type INotify interface {
Send(conf *godns.Settings, domain, currentIP string) error
}
type notifyManager struct {
notifications map[string]*INotify
}
func GetNotifyManager(conf *godns.Settings) *notifyManager {
once.Do(func() {
instance = &notifyManager{
notifications: initNotifications(conf),
}
})
return instance
}
func initNotifications(conf *godns.Settings) map[string]*INotify {
return map[string]*INotify{}
}