mdns

package
v2.8.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Service specifies the service name
	ServiceName string
	// Service specifies the service type
	Service string
	// Specifies the service domain
	Domain string
	// Port specifies the port the service is listening to
	Port int
	// IPv6 states whether to fetch ipv6 address instead of ipv4
	IPv6 *bool
}

Config represents the mDNS provider discoConfig

func (Config) Validate

func (x Config) Validate() error

Validate checks whether the given discovery configuration is valid

type Discovery

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

Discovery defines the mDNS discovery provider

func NewDiscovery

func NewDiscovery(config *Config) *Discovery

NewDiscovery returns an instance of the mDNS discovery provider

func (*Discovery) Close

func (d *Discovery) Close() error

Close closes the provider

func (*Discovery) Deregister

func (d *Discovery) Deregister() error

Deregister removes this node from a service discovery directory.

func (*Discovery) DiscoverPeers

func (d *Discovery) DiscoverPeers() ([]string, error)

DiscoverPeers returns a list of known nodes.

func (*Discovery) ID

func (d *Discovery) ID() string

ID returns the discovery provider identifier

func (*Discovery) Initialize

func (d *Discovery) Initialize() error

Initialize the discovery provider

func (*Discovery) Register

func (d *Discovery) Register() error

Register registers this node to a service discovery directory.

Jump to

Keyboard shortcuts

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