mdns

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Lookup

func Lookup(service string, entries chan<- *AirplayFlagsEntry) 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 AirplayFlagsEntry

type AirplayFlagsEntry struct {
	HostName   string
	DeviceName string
	RawFlags   string
	Flags      uint64
}

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<- *AirplayFlagsEntry // Entries Channel
	WantUnicastResponse bool                      // Unicast response desired, as per 5.4 in RFC
	DisableIPv4         bool                      // Whether to disable usage of IPv4 for MDNS operations. Does not affect discovered addresses.
	DisableIPv6         bool                      // Whether to disable usage of IPv6 for MDNS operations. Does not affect discovered addresses.
}

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 ServiceEntry

type ServiceEntry struct {
	Name       string
	Host       string
	AddrV4     net.IP
	AddrV6     net.IP
	Port       int
	Info       string
	InfoFields []string

	Addr net.IP // @Deprecated
	// contains filtered or unexported fields
}

ServiceEntry is returned after we query for a service

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL