Documentation
¶
Index ¶
- Constants
- type ARecord
- type CacheServer
- type Config
- type DomainRecord
- type LocalNameServer
- type NameServer
- type PendingRequest
- type Server
- type UDPNameServer
- func (this *UDPNameServer) AssignUnusedID(response chan<- *ARecord) uint16
- func (this *UDPNameServer) BuildQueryA(domain string, id uint16) *alloc.Buffer
- func (this *UDPNameServer) Cleanup()
- func (this *UDPNameServer) DispatchQuery(payload *alloc.Buffer)
- func (this *UDPNameServer) HandleResponse(dest v2net.Destination, payload *alloc.Buffer)
- func (this *UDPNameServer) QueryA(domain string) <-chan *ARecord
Constants ¶
View Source
const (
DefaultTTL = uint32(3600)
CleanupInterval = time.Second * 120
CleanupThreshold = 512
)
View Source
const (
APP_ID = app.ID(2)
)
View Source
const (
QueryTimeout = time.Second * 8
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheServer ¶ added in v1.13.1
type CacheServer struct {
sync.RWMutex
// contains filtered or unexported fields
}
func NewCacheServer ¶ added in v1.13.1
func NewCacheServer(space app.Space, config *Config) *CacheServer
type Config ¶ added in v1.13.1
type Config struct {
Hosts map[string]net.IP
NameServers []v2net.Destination
}
type DomainRecord ¶ added in v1.13.1
type DomainRecord struct {
A *ARecord
}
type LocalNameServer ¶ added in v1.13.1
type LocalNameServer struct {
}
type NameServer ¶ added in v1.13.1
type NameServer interface {
QueryA(domain string) <-chan *ARecord
}
type PendingRequest ¶ added in v1.13.1
type PendingRequest struct {
// contains filtered or unexported fields
}
type Server ¶ added in v1.13.1
type Server interface {
Get(domain string) []net.IP
}
A DnsCache is an internal cache of DNS resolutions.
type UDPNameServer ¶ added in v1.13.1
type UDPNameServer struct {
sync.Mutex
// contains filtered or unexported fields
}
func NewUDPNameServer ¶ added in v1.13.1
func NewUDPNameServer(address v2net.Destination, dispatcher dispatcher.PacketDispatcher) *UDPNameServer
func (*UDPNameServer) AssignUnusedID ¶ added in v1.13.1
func (this *UDPNameServer) AssignUnusedID(response chan<- *ARecord) uint16
@Private
func (*UDPNameServer) BuildQueryA ¶ added in v1.17.1
func (this *UDPNameServer) BuildQueryA(domain string, id uint16) *alloc.Buffer
func (*UDPNameServer) DispatchQuery ¶ added in v1.17.1
func (this *UDPNameServer) DispatchQuery(payload *alloc.Buffer)
func (*UDPNameServer) HandleResponse ¶ added in v1.13.1
func (this *UDPNameServer) HandleResponse(dest v2net.Destination, payload *alloc.Buffer)
@Private
Click to show internal directories.
Click to hide internal directories.