Documentation
¶
Overview ¶
Package dnssd browses DNS-SD services through Avahi's D-Bus API on the system bus, with no mDNS library: a browser per service type reports the services that come and go, each resolved to its host, port and TXT record.
Index ¶
Constants ¶
const ( BusName = "org.freedesktop.Avahi" ServerIface = BusName + ".Server" BrowserIface = BusName + ".ServiceBrowser" )
Avahi's names.
Variables ¶
var ErrNoAvahi = errors.New("dnssd: no Avahi on the system bus")
ErrNoAvahi is a system bus without Avahi on it.
Functions ¶
This section is empty.
Types ¶
type Browser ¶
type Browser struct {
// contains filtered or unexported fields
}
Browser is a browse running: Stop frees its Avahi browsers.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an Avahi client on a system bus connection the caller owns.
func (*Client) Browse ¶
func (c *Client) Browse(ctx context.Context, types []string, found func(Service), removed func(key string)) (*Browser, error)
Browse browses types, calling found with each service resolved and removed with the key of each that went, from one goroutine, until Stop. Without Avahi on the bus it is ErrNoAvahi.
type Service ¶
type Service struct {
Name, Type, Domain string
Host string
Address netip.Addr
Port uint16
TXT map[string]string
}
Service is one resolved service: its instance name, type and domain, its host name, the address it is reached at (with its interface as the zone where link-local) and port, and its TXT record by key.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package dnssdtest is a fake Avahi on a private bus: the services a test announces are reported to every browser of their type, once per address, on the interface and protocol the address names, and resolve to what the test set; the browsers made and freed are counted.
|
Package dnssdtest is a fake Avahi on a private bus: the services a test announces are reported to every browser of their type, once per address, on the interface and protocol the address names, and resolve to what the test set; the browsers made and freed are counted. |