diff --git a/mdns.go b/mdns.go index 6739c69..f84e896 100644 --- a/mdns.go +++ b/mdns.go @@ -2,6 +2,8 @@ package mdns import ( + "context" + "github.com/micro/go-micro/registry" ) @@ -9,3 +11,13 @@ import ( func NewRegistry(opts ...registry.Option) registry.Registry { return registry.NewRegistry(opts...) } + +// 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) + } +}