2019-01-15 18:50:37 +02:00
|
|
|
// Package mdns provides a multicast dns registry
|
2016-04-27 19:21:05 +02:00
|
|
|
package mdns
|
|
|
|
|
|
|
|
import (
|
2019-09-09 14:11:25 +02:00
|
|
|
"context"
|
|
|
|
|
2020-01-30 13:39:00 +02:00
|
|
|
"github.com/micro/go-micro/v2/registry"
|
2016-04-27 19:21:05 +02:00
|
|
|
)
|
|
|
|
|
2019-01-15 18:50:37 +02:00
|
|
|
// NewRegistry returns a new mdns registry
|
2016-04-27 19:21:05 +02:00
|
|
|
func NewRegistry(opts ...registry.Option) registry.Registry {
|
2019-01-15 18:50:37 +02:00
|
|
|
return registry.NewRegistry(opts...)
|
2016-04-27 19:21:05 +02:00
|
|
|
}
|
2019-09-09 14:11:25 +02:00
|
|
|
|
|
|
|
// Domain sets the mdnsDomain
|
|
|
|
func Domain(d string) registry.Option {
|
|
|
|
return func(o *registry.Options) {
|
|
|
|
if o.Context == nil {
|
|
|
|
o.Context = context.Background()
|
|
|
|
}
|
|
|
|
o.Context = context.WithValue(o.Context, "mdns.domain", d)
|
|
|
|
}
|
|
|
|
}
|