Documentation
¶
Overview ¶
Package dnssdbrowser provides a DNS-SD browser.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var MULTICAST_ADDR = netip.AddrPortFrom(netip.AddrFrom4([...]byte{224, 0, 0, 251}), 5353)
Functions ¶
This section is empty.
Types ¶
type Browser ¶
type Browser struct {
// contains filtered or unexported fields
}
Browser represents a DNS-SD browser.
func (*Browser) FullSubscribe ¶
func (b *Browser) FullSubscribe(serviceName string) *FullSubscription
FullSubscribe subscribes to a complete view of the service. The stream will always start with the current state of the service.
func (*Browser) Listen ¶
Listen listens for DNS-SD packets on the given socket. The socket will be closed when the function returns.
func (*Browser) Services ¶
Services returns the currently known services for the given service name.
func (*Browser) Subscribe ¶
func (b *Browser) Subscribe(serviceName string) *Subscription
Subscribe subscribes to a service.
type Change ¶
type Change struct { Type ChangeType Service Service }
Change represents a change to a service.
type ChangeType ¶
type ChangeType int
ChangeType represents the type of change to a service.
const ( Added ChangeType = iota Removed Updated )
type FullSubscription ¶
type FullSubscription struct { Stream <-chan []Service // contains filtered or unexported fields }
FullSubscription represents a subscription to a service.
type Service ¶
type Service struct { // Instance name e.g. MacBouk Pro._http._tcp.local. // Note that it is a fully qualified domain name (FQDN), so it includes a trailing period. InstanceName string // Service name e.g. _http._tcp.local. // Note that it is a fully qualified domain name (FQDN), so it includes a trailing period. ServiceName string // Hostname e.g. MacBouk-Pro.local. // Note that it is a fully qualified domain name (FQDN), so it includes a trailing period. Hostname string // Port Port uint16 // Resolved addresses for hostname Addresses []netip.Addr // TXT record Metadata map[string]*string }
Service represents a service instance.
func (*Service) UserFriendlyName ¶
UserFriendlyName returns a user friendly name for the service.
type Subscription ¶
type Subscription struct { Stream <-chan Change // contains filtered or unexported fields }
Subscription represents a subscription to a service.