mdns

package
v0.0.0-...-b172891 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Announce

func Announce(ctx context.Context, name string, ip net.IP, ttl time.Duration) error

func Resolve

func Resolve(ctx context.Context, name string) (net.IP, error)

func Start

func Start() error

Initialize global mDNS client.

func Stop

func Stop()

Types

type Client

type Client struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewClient

func NewClient() (*Client, error)

func (*Client) Announce

func (c *Client) Announce(ctx context.Context, name string, ip net.IP, ttl time.Duration) error

Announce a newly generated ephemeral domain name over mDNS.

func (*Client) Close

func (c *Client) Close() error

func (*Client) Resolve

func (c *Client) Resolve(ctx context.Context, name string) (net.IP, error)

Resolve the ephemeral mDNS domain to an IP address. Blocks until resolved or until the context is done.

Jump to

Keyboard shortcuts

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