mdns

package
v1.13.1 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 13 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewResolver

func NewResolver(logger logger.Logger) nameresolution.Resolver

NewResolver creates the instance of mDNS name resolver.

Types

type Resolver added in v1.7.0

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

func (*Resolver) Close added in v1.7.0

func (m *Resolver) Close() error

Close is not formally part of the name resolution interface as proposed in https://github.com/dapr/components-contrib/issues/1472 but this is used in the tests to clean up the mDNS registration.

func (*Resolver) Init added in v1.7.0

func (m *Resolver) Init(ctx context.Context, metadata nameresolution.Metadata) error

Init registers service for mDNS.

func (*Resolver) ResolveID added in v1.7.0

func (m *Resolver) ResolveID(parentCtx context.Context, req nameresolution.ResolveRequest) (string, error)

ResolveID resolves name to address via mDNS.

type Subscriber added in v1.7.0

type Subscriber struct {
	AddrChan chan string
	ErrChan  chan error
}

func NewSubscriber added in v1.7.0

func NewSubscriber() Subscriber

func (*Subscriber) Close added in v1.7.0

func (s *Subscriber) Close()

type SubscriberPool added in v1.7.0

type SubscriberPool struct {
	Once        *sync.Once
	Subscribers []Subscriber
}

SubscriberPool is used to manage a pool of subscribers for a given app id. 'Once' belongs to the first subscriber as it is their responsibility to fetch the address associated with the app id and publish it to the other subscribers. WARN: pools are not thread safe and intended to be accessed only when using subMu lock.

func NewSubscriberPool added in v1.7.0

func NewSubscriberPool(w Subscriber) *SubscriberPool

func (*SubscriberPool) Add added in v1.7.0

func (p *SubscriberPool) Add(sub Subscriber)

Jump to

Keyboard shortcuts

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