mdns

package
v2.0.0-...-be496b8 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package mdns defines the mdns discovery provider

Index

Constants

View Source
const (
	ServiceName = "name"
	Service     = "service"
	Domain      = "domain"
	Port        = "group-port"
	IPv6        = "ipv6"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Discovery

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

Discovery defines the mDNS discovery provider

func NewDiscovery

func NewDiscovery() *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) DiscoverNodes

func (d *Discovery) DiscoverNodes() ([]*discovery.Node, error)

DiscoverNodes 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.

func (*Discovery) SetConfig

func (d *Discovery) SetConfig(config discovery.Options) error

SetConfig registers the underlying discovery configuration

func (*Discovery) Watch

func (d *Discovery) Watch(ctx context.Context) (<-chan discovery.Event, error)

Watch returns event based upon node lifecycle

type Option

type Option struct {
	// Provider specifies the provider name
	Provider string
	// 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
}

Option represents the mDNS provider option

Jump to

Keyboard shortcuts

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