Documentation ¶
Index ¶
Constants ¶
View Source
const ( // 5 Hours MinStaleTime = 600 * 5 MaxLogRecords = 5000 )
View Source
const ( Timeout = 360000 NanoConv = 1_000_000 BlockedIp = "Blocked!" NoServer = "127.0.0.1" Ok int8 = 0 Block int8 = 1 NotFound int8 = 2 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ContextualDnsServer ¶
type ContextualDnsServer struct {
// contains filtered or unexported fields
}
func MakeContextualServer ¶
func MakeContextualServer(handler ContextualHandler, context interface{}) *ContextualDnsServer
func (*ContextualDnsServer) ServeDNS ¶
func (server *ContextualDnsServer) ServeDNS(w dns.ResponseWriter, r *dns.Msg)
type ContextualHandler ¶
type ContextualHandler interface {
ServeDNS(w dns.ResponseWriter, r *dns.Msg, context interface{})
}
Handler is implemented by any value that implements ServeDNS.
type Domain ¶
type Domain struct { Name string `json:"name"` Time int64 `json:"time"` Ip string `json:"ip"` Block bool `json:"block"` Requests int64 `json:"requests"` Server string `json:"server"` Type uint16 `json:"type"` Ttl uint32 `json:"ttl"` Managed bool `json:"managed"` LastRequested int64 `json:"lastRequested"` History []string `json:"-"` }
func (*Domain) SecondsSinceLastRequest ¶
type LatencyStats ¶
type LogCallback ¶
type LogCallback = func(*Log)
type LogHook ¶
type LogHook struct {
// contains filtered or unexported fields
}
func Hook ¶
func Hook(callback LogCallback) LogHook
type RequestLog ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) GetMessages ¶
type Stats ¶
type Stats struct { Started int64 Running *string `json:"running"` Requests int64 `json:"requests"` LookupRequests int64 `json:"lookupRequests"` CachedRequests int64 `json:"cachedRequests"` BlockedRequests int64 `json:"blockedRequests"` FailedRequests int64 `json:"failedRequests"` LatencyStats LatencyStats `json:"latency"` UnhandledRequests map[uint16]int `json:"unhandled"` Domains []*Domain `json:"domains"` FailedDomains []string `json:"failedDomains"` RequestLog RequestLog `json:"ipLog"` Metrics []Metric `json:"metrics"` Info []string `json:"info"` Latencies []int64 `json:"-"` }
Click to show internal directories.
Click to hide internal directories.