Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DisableLogging bool
DisableLogging disables all log messages
Functions ¶
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 QueryParam ¶
type QueryParam struct { Service string // Service to lookup Domain string // Lookup domain, default "local" Interface *net.Interface // Multicast interface to use Entries chan<- *ServiceEntry // Entries Channel WantUnicastResponse bool // Unicast response desired, as per 5.4 in RFC }
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
}
Server is used to listen for mDNS queries and respond if we have a matching local record
type Service ¶
type Service struct { Instance string // Instance name (e.g. "hostService name") Service string // Service name (e.g. "_http._tcp.") Domain string // If blank, assumes "local" HostName string // Host machine DNS name (e.g. "mymachine.net.") Port int // Service Port IPs []net.IP // IP addresses for the service's host TXT []string // Service TXT records // contains filtered or unexported fields }
Service is used to export a named service by implementing a Zone
func NewService ¶
func NewService(instance, service, domain, hostName string, port int, ips []net.IP, txt []string) (*Service, error)
NewService returns a new instance of Service.
If domain, hostName, or ips is set to the zero value, then a default value will be inferred from the operating system.
TODO(reddaly): This interface may need to change to account for "unique record" conflict rules of the mDNS protocol. Upon startup, the server should check to ensure that the instance name does not conflict with other instance names, and, if required, select a new name. There may also be conflicting hostName A/AAAA records.