Documentation ¶
Overview ¶
Package mdns implements mDNS (multicast DNS)
Index ¶
Constants ¶
View Source
const ( // DefaultAddress is the default used by mDNS // and in most cases should be the address that the // net.Conn passed to Server is bound to DefaultAddress = "224.0.0.0:5353" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // QueryInterval controls how often we sends Queries until we // get a response for the requested name QueryInterval time.Duration // LocalNames are the names that we will generate answers for // when we get questions LocalNames []string LoggerFactory logging.LoggerFactory }
Config is used to configure a mDNS client or server.
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn represents a mDNS Server
func Server ¶
func Server(conn *ipv4.PacketConn, config *Config) (*Conn, error)
Server establishes a mDNS connection over an existing conn
func (*Conn) Query ¶
func (c *Conn) Query(ctx context.Context, name string) (dnsmessage.ResourceHeader, net.Addr, error)
Query sends mDNS Queries for the following name until either the Context is canceled/expires or we get a result
func (*Conn) ReverseLookup ¶
func (c *Conn) ReverseLookup(ctx context.Context, ip net.IP) (dnsmessage.ResourceHeader, string, error)
Click to show internal directories.
Click to hide internal directories.