Versions in this module Expand all Collapse all v0 v0.1.0 Oct 9, 2022 Changes in this version + var AddrIPv4LinkLocalMulticast = &net.UDPAddr + var AddrIPv6LinkLocalMulticast = &net.UDPAddr + var IPv4LinkLocalMulticast = net.ParseIP("224.0.0.251") + var IPv6LinkLocalMulticast = net.ParseIP("ff02::fb") + var TTLDefault uint32 = 75 * 60 + var TTLHostname uint32 = 120 + func A(srv Service, iface *net.Interface) []*dns.A + func AAAA(srv Service, iface *net.Interface) []*dns.AAAA + func DNSSDServicesPTR(srv Service) *dns.PTR + func LookupType(ctx context.Context, service string, add AddFunc, rmv RmvFunc) (err error) + func NSEC(rr dns.RR, srv Service, iface *net.Interface) *dns.NSEC + func PTR(srv Service) *dns.PTR + func SRV(srv Service) *dns.SRV + func TXT(srv Service) *dns.TXT + type AddFunc func(BrowseEntry) + type BrowseEntry struct + Domain string + Host string + IPs []net.IP + IfaceName string + Name string + Port int + Text map[string]string + Type string + func (e BrowseEntry) ServiceInstanceName() string + type Cache struct + func NewCache() *Cache + func (c *Cache) Services() []*Service + func (c *Cache) UpdateFrom(msg *dns.Msg, iface *net.Interface) (adds []*Service, rmvs []*Service) + type Config struct + Domain string + Host string + IPs []net.IP + Ifaces []string + Name string + Port int + Text map[string]string + Type string + func (c Config) Copy() Config + type MDNSConn interface + Close func() + Drain func(ctx context.Context) + Read func(ctx context.Context) <-chan *Request + SendQuery func(q *Query) error + SendResponse func(resp *Response) error + func NewMDNSConn() (MDNSConn, error) + type Query struct + func (q Query) IfaceName() string + type ReadFunc func(*Request) + type Request struct + func (r Request) From() *net.UDPAddr + func (r Request) IfaceName() string + func (r Request) Raw() *dns.Msg + func (r Request) String() string + type Responder interface + Add func(srv Service) (ServiceHandle, error) + Debug func(ctx context.Context, fn ReadFunc) + Remove func(srv ServiceHandle) + Respond func(ctx context.Context) error + func NewResponder() (Responder, error) + type Response struct + type RmvFunc func(BrowseEntry) + type Service struct + Domain string + Host string + IPs []net.IP + Ifaces []string + Name string + Port int + TTL time.Duration + Text map[string]string + Type string + func LookupInstance(ctx context.Context, instance string) (Service, error) + func NewService(cfg Config) (s Service, err error) + func ProbeService(ctx context.Context, srv Service) (Service, error) + func ReprobeService(ctx context.Context, srv Service) (Service, error) + func (s *Service) IPsAtInterface(iface *net.Interface) []net.IP + func (s *Service) Interfaces() []*net.Interface + func (s *Service) SetHostname(hostname string) + func (s Service) Copy() *Service + func (s Service) Hostname() string + func (s Service) ServiceInstanceName() string + func (s Service) ServiceName() string + func (s Service) ServicesMetaQueryName() string + type ServiceHandle interface + Service func() Service + UpdateText func(text map[string]string, r Responder)