mdns

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Query(params *QueryParam) error
	Lookup(service string, entries chan<- *ServiceEntry) error
}

Client ...

type MulticastDNS

type MulticastDNS struct {
	// contains filtered or unexported fields
}

MulticastDNS ...

func New

func New(cfg *config.Config, opts ...OptionConfigFunc) (mdns *MulticastDNS, err error)

New ...

func (*MulticastDNS) Client

func (dns *MulticastDNS) Client() (c Client, err error)

Client ...

func (*MulticastDNS) Server

func (dns *MulticastDNS) Server() (s Server, err error)

Server ...

type OptionConfig

type OptionConfig struct {
	NetInterface      *net.Interface
	IPv4Addr          *net.UDPAddr
	IPv6Addr          *net.UDPAddr
	WildcardAddrIPv4  *net.UDPAddr
	WildcardAddrIPv6  *net.UDPAddr
	LogEmptyResponses bool
	HostName          string
	CustomPort        int
	Port              uint16
	TTL               uint32
	TXT               []string
	IPs               []net.IP
	Instance          string
	Service           string
	Enum              string
	Domain            string
	// contains filtered or unexported fields
}

OptionConfig ...

func (*OptionConfig) RegisterLocalIP

func (cfg *OptionConfig) RegisterLocalIP(c *config.Config)

RegisterLocalIP ...

type OptionConfigFunc

type OptionConfigFunc func(cfg *OptionConfig)

OptionConfigFunc ...

type QueryParam

type QueryParam struct {
	Service             string               // Service to lookup
	Domain              string               // Lookup domain, default "local"
	Type                uint16               // Lookup type, defaults to dns.TypePTR
	Context             context.Context      // Context
	Timeout             time.Duration        // Lookup timeout, default 1 second. Ignored if Context is provided
	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 interface {
	Start()
	Stop() error
}

Server ...

type ServiceEntry

type ServiceEntry struct {
	Name       string
	Host       string
	AddrV4     []net.IP
	AddrV6     []net.IP
	Port       int
	Info       string
	InfoFields []string
	TTL        int
	Type       uint16
	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