github.com/micro/go-micro/v2@v2.9.1/registry/mdns/mdns.go (about)

     1  // Package mdns provides a multicast dns registry
     2  package mdns
     3  
     4  import (
     5  	"context"
     6  
     7  	"github.com/micro/go-micro/v2/registry"
     8  )
     9  
    10  // NewRegistry returns a new mdns registry
    11  func NewRegistry(opts ...registry.Option) registry.Registry {
    12  	return registry.NewRegistry(opts...)
    13  }
    14  
    15  // Domain sets the mdnsDomain
    16  func Domain(d string) registry.Option {
    17  	return func(o *registry.Options) {
    18  		if o.Context == nil {
    19  			o.Context = context.Background()
    20  		}
    21  		o.Context = context.WithValue(o.Context, "mdns.domain", d)
    22  	}
    23  }