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 ¶
type Resolver struct {
// contains filtered or unexported fields
}
func (*Resolver) Close ¶
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 ¶
func (m *Resolver) Init(metadata nameresolution.Metadata) error
Init registers service for mDNS.
func (*Resolver) ResolveID ¶
func (m *Resolver) ResolveID(req nameresolution.ResolveRequest) (string, error)
ResolveID resolves name to address via mDNS.
type Subscriber ¶
func NewSubscriber ¶
func NewSubscriber() Subscriber
func (*Subscriber) Close ¶
func (s *Subscriber) Close()
type SubscriberPool ¶
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 ¶
func NewSubscriberPool(w Subscriber) *SubscriberPool
func (*SubscriberPool) Add ¶
func (p *SubscriberPool) Add(sub Subscriber)