Documentation ¶
Index ¶
- Constants
- func AddIpReverseDnsToStorage(storage DnsStorage, ipStr, domain string) error
- func FromIPAddressToPtrFqdn(ipStr string) string
- func IsValidIPAddress(ipStr string) bool
- type DnsCache
- type DnsEndpoint
- type DnsHttp
- type DnsMemCache
- type DnsRecordHandler
- func NewRecordAHandler(parent DnsRecordHandler, storage DnsStorage, debug bool) DnsRecordHandler
- func NewRecordPtrHandler(parent DnsRecordHandler, storage DnsStorage, debug bool) DnsRecordHandler
- func NewRecordSRVHandler(parent DnsRecordHandler, storage DnsStorage, debug bool) DnsRecordHandler
- func NewRecordTxtHandler(parent DnsRecordHandler, storage DnsStorage, debug bool) DnsRecordHandler
- type DnsStorage
- type NotFoundUpstreamDns
- type ParentRecordHandler
- type RecordAHandler
- type RecordPtrHandler
- type RecordSRVHandler
- type RecordTxtHandler
- type RequestContext
- type UpstreamDns
Constants ¶
View Source
const (
USER_AGENT = "DNS-over-HTTPS/1.0 NekoQ-Bootstrap"
)
Variables ¶
This section is empty.
Functions ¶
func AddIpReverseDnsToStorage ¶
func AddIpReverseDnsToStorage(storage DnsStorage, ipStr, domain string) error
func FromIPAddressToPtrFqdn ¶
func IsValidIPAddress ¶
Types ¶
type DnsCache ¶
func NewDnsMemCache ¶
func NewDnsMemCache() DnsCache
type DnsEndpoint ¶
type DnsEndpoint struct { Storage DnsStorage Server *dns.Server Cache DnsCache Addr string DebugPrintDnsRequest bool HandlerMapping map[uint16]DnsRecordHandler }
func NewDnsEndpoint ¶
func NewDnsEndpoint(addr string, storage DnsStorage, upstreams []string, enclosureDomainSuffixes []struct { Type string Suffix string }, debug bool) (*DnsEndpoint, error)
func (*DnsEndpoint) ProcessDnsMsg ¶
func (d *DnsEndpoint) ProcessDnsMsg(r *dns.Msg, ctx *RequestContext) *dns.Msg
func (*DnsEndpoint) ServeDNS ¶
func (d *DnsEndpoint) ServeDNS(w dns.ResponseWriter, r *dns.Msg)
func (*DnsEndpoint) StartSync ¶
func (d *DnsEndpoint) StartSync() error
type DnsHttp ¶
type DnsHttp struct { Router *httprouter.Router Addr string DebugPrintDnsRequest bool // contains filtered or unexported fields }
func NewHttpDns ¶
func NewHttpDns(addr string, endpoint *DnsEndpoint, debug bool) (*DnsHttp, error)
type DnsMemCache ¶
type DnsMemCache struct {
// contains filtered or unexported fields
}
func (*DnsMemCache) Put ¶
func (d *DnsMemCache) Put(req, res *dns.Msg)
type DnsRecordHandler ¶
type DnsRecordHandler interface {
HandleQuestion(m *dns.Msg, ctx *RequestContext) (*dns.Msg, error)
}
func NewRecordAHandler ¶
func NewRecordAHandler(parent DnsRecordHandler, storage DnsStorage, debug bool) DnsRecordHandler
func NewRecordPtrHandler ¶
func NewRecordPtrHandler(parent DnsRecordHandler, storage DnsStorage, debug bool) DnsRecordHandler
func NewRecordSRVHandler ¶
func NewRecordSRVHandler(parent DnsRecordHandler, storage DnsStorage, debug bool) DnsRecordHandler
func NewRecordTxtHandler ¶
func NewRecordTxtHandler(parent DnsRecordHandler, storage DnsStorage, debug bool) DnsRecordHandler
type DnsStorage ¶
type DnsStorage interface { ResolveDomain(domain string, domainType shared.DomainType) (string, error) PutDomain(domain, resolve string, domainType shared.DomainType) }
type NotFoundUpstreamDns ¶
type NotFoundUpstreamDns struct { }
func (NotFoundUpstreamDns) HandleQuestion ¶
func (u NotFoundUpstreamDns) HandleQuestion(m *dns.Msg, ctx *RequestContext) (*dns.Msg, error)
type ParentRecordHandler ¶
type ParentRecordHandler struct {
Handler DnsRecordHandler
}
func (*ParentRecordHandler) HandleQuestion ¶
func (c *ParentRecordHandler) HandleQuestion(m *dns.Msg, ctx *RequestContext) (*dns.Msg, error)
type RecordAHandler ¶
type RecordAHandler struct { *ParentRecordHandler DnsStorage // contains filtered or unexported fields }
func (*RecordAHandler) HandleQuestion ¶
func (r *RecordAHandler) HandleQuestion(m *dns.Msg, ctx *RequestContext) (*dns.Msg, error)
type RecordPtrHandler ¶
type RecordPtrHandler struct { *ParentRecordHandler DnsStorage // contains filtered or unexported fields }
func (*RecordPtrHandler) HandleQuestion ¶
func (r *RecordPtrHandler) HandleQuestion(m *dns.Msg, ctx *RequestContext) (*dns.Msg, error)
type RecordSRVHandler ¶
type RecordSRVHandler struct { *ParentRecordHandler DnsStorage // contains filtered or unexported fields }
func (*RecordSRVHandler) HandleQuestion ¶
func (r *RecordSRVHandler) HandleQuestion(m *dns.Msg, ctx *RequestContext) (*dns.Msg, error)
type RecordTxtHandler ¶
type RecordTxtHandler struct { *ParentRecordHandler DnsStorage // contains filtered or unexported fields }
func (*RecordTxtHandler) HandleQuestion ¶
func (r *RecordTxtHandler) HandleQuestion(m *dns.Msg, ctx *RequestContext) (*dns.Msg, error)
type RequestContext ¶
func NewRequestContext ¶
func NewRequestContext() *RequestContext
func (*RequestContext) AddTraceInfo ¶
func (r *RequestContext) AddTraceInfo(info string)
func (*RequestContext) AddTraceInfoWithDnsAnswersIfNoError ¶
func (r *RequestContext) AddTraceInfoWithDnsAnswersIfNoError(info string, msg *dns.Msg, err error)
func (*RequestContext) GetTraceInfoString ¶
func (r *RequestContext) GetTraceInfoString() string
type UpstreamDns ¶
type UpstreamDns struct {
// contains filtered or unexported fields
}
func NewUpstreamDNSWithSingle ¶
func NewUpstreamDNSWithSingle(server []string, suffixes []struct { Type string Suffix string }) *UpstreamDns
func (*UpstreamDns) HandleQuestion ¶
func (u *UpstreamDns) HandleQuestion(m *dns.Msg, ctx *RequestContext) (*dns.Msg, error)
Click to show internal directories.
Click to hide internal directories.