1
0
mirror of https://github.com/taigrr/godns synced 2025-01-18 04:03:25 -08:00
godns/handler/handler.go
2017-10-27 11:59:57 +08:00

24 lines
514 B
Go

package handler
import "github.com/TimothyYe/godns"
// IHandler is the interface for all DNS handlers
type IHandler interface {
SetConfiguration(*godns.Settings)
DomainLoop(domain *godns.Domain, panicChan chan<- godns.Domain)
}
// CreateHandler creates dns handler by different providers
func CreateHandler(provider string) IHandler {
var handler IHandler
switch provider {
case godns.DNSPOD:
handler = IHandler(&DNSPodHandler{})
case godns.HE:
handler = IHandler(&HEHandler{})
}
return handler
}