1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-12-18 08:26:38 +02:00
go-micro/registry/mdns/mdns.go

24 lines
511 B
Go
Raw Normal View History

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"
"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)
}
}