Documentation
¶
Index ¶
- Constants
- func BindToDevice(fd int, device string) error
- type Cache
- type CacheOptions
- type Item
- type Server
- func (s *Server) Addr() string
- func (s *Server) HandleForwarding(w mdns.ResponseWriter, r *mdns.Msg) (bool, error)
- func (s *Server) HandleVIC(w mdns.ResponseWriter, r *mdns.Msg) (bool, error)
- func (s *Server) SeenBefore(w mdns.ResponseWriter, r *mdns.Msg) (bool, error)
- func (s *Server) ServeDNS(w mdns.ResponseWriter, r *mdns.Msg)
- func (s *Server) Start()
- func (s *Server) Stop()
- func (s *Server) Wait()
- type ServerOptions
- type SetOfDomains
Constants ¶
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cache ¶
type Cache struct { CacheOptions // Protects following map sync.RWMutex // contains filtered or unexported fields }
Cache stores dns.Msgs and their expiration time
func (*Cache) Get ¶
Get returns the dns.Msg from the cache
func (*Cache) Remove ¶
Remove removes the dns.Msg from the cache
type CacheOptions ¶
type CacheOptions struct {
// contains filtered or unexported fields
}
CacheOptions represents the cache options
type Item ¶
Item represents an item in the cache
type Server ¶
type Server struct { ServerOptions // contains filtered or unexported fields }
Server represents udp/tcp server and clients
func (*Server) HandleForwarding ¶
HandleForwarding forwards a request to the nameservers and returns the response
func (*Server) HandleVIC ¶
HandleVIC returns a response to a container name/id request
func (*Server) SeenBefore ¶
SeenBefore returns the cached response
type ServerOptions ¶
type ServerOptions struct { IP string Port int Interface string Nameservers flagMultipleVar Timeout time.Duration TTL time.Duration CacheSize int Debug bool }
ServerOptions represents the server options
type SetOfDomains ¶
SetOfDomains is a type for storing string-type domain names as an unsorted set
var f SetOfDomains f = make(map[string]bool)
Store in the set
f["foo.com"] = true
then to check to see if something is in the 'set':
if f["foo.com"] {
func ReverseLookup ¶
func ReverseLookup(ipAddr string) (domains SetOfDomains)
ReverseLookup returns a set of FQDNs for ipAddr from nameservers in /etc/resolv.conf /etc/hosts and /etc/nsswitch.conf are ignored by this function
Source Files
¶
- cache.go
- dns.go
- syscall_linux.go