Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Lookup ¶
func Lookup(service string, entries chan<- *ServiceEntry) error
Lookup is the same as Query, however it uses all the default parameters
func Query ¶
func Query(params *QueryParam) error
Query looks up a given service, in a domain, waiting at most for a timeout before finishing the query. The results are streamed to a channel. Sends will not block, so clients should make sure to either read or buffer.
Types ¶
type Config ¶
type Config struct { // Zone must be provided to support responding to queries Zone Zone // Iface if provided binds the multicast listener to the given // interface. If not provided, the system default multicase interface // is used. Iface *net.Interface }
Config is used to configure the mDNS server
type MDNSService ¶
type MDNSService struct { Instance string // Instance name (e.g. host name) Service string // Service name (e.g. _http._tcp.) Addr net.IP // Service IP Port int // Service Port Info string // Service info served as a TXT record Domain string // If blank, assumes ".local" // contains filtered or unexported fields }
MDNSService is used to export a named service by implementing a Zone
func (*MDNSService) Init ¶
func (m *MDNSService) Init() error
Init should be called to setup the internal state
type QueryParam ¶
type QueryParam struct { Service string // Service to lookup Domain string // Lookup domain, default "local" Timeout time.Duration // Lookup timeout, default 1 second Interface *net.Interface // Multicast interface to use Entries chan<- *ServiceEntry // Entries Channel }
QueryParam is used to customize how a Lookup is performed
func DefaultParams ¶
func DefaultParams(service string) *QueryParam
DefaultParams is used to return a default set of QueryParam's
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
mDNS server is used to listen for mDNS queries and respond if we have a matching local record