mirror of
https://github.com/taigrr/godns
synced 2025-01-18 04:03:25 -08:00
35 lines
554 B
Go
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 = ¬ifyManager{
|
|
notifications: initNotifications(conf),
|
|
}
|
|
})
|
|
|
|
return instance
|
|
}
|
|
|
|
func initNotifications(conf *godns.Settings) map[string]*INotify {
|
|
return map[string]*INotify{}
|
|
}
|