Documentation ¶
Overview ¶
Package mdns provides a multicast dns registry
Index ¶
- Constants
- Variables
- func ProvideRegistryMDNS(name types.ServiceName, version types.ServiceVersion, datas types.ConfigData, ...) (registry.Type, error)
- func WithDomain(domain string) registry.Option
- type Config
- type RegistryMDNS
- func (m *RegistryMDNS) Deregister(service *registry.Service, _ ...registry.DeregisterOption) error
- func (m *RegistryMDNS) GetService(service string, _ ...registry.GetOption) ([]*registry.Service, error)
- func (m *RegistryMDNS) ListServices(_ ...registry.ListOption) ([]*registry.Service, error)
- func (m *RegistryMDNS) Register(service *registry.Service, _ ...registry.RegisterOption) error
- func (m *RegistryMDNS) ServiceName() string
- func (m *RegistryMDNS) ServiceVersion() string
- func (m *RegistryMDNS) Start() error
- func (m *RegistryMDNS) Stop(_ context.Context) error
- func (m *RegistryMDNS) String() string
- func (m *RegistryMDNS) Type() string
- func (m *RegistryMDNS) Watch(opts ...registry.WatchOption) (registry.Watcher, error)
Constants ¶
const Name = "mdns"
Name provides the name of this registry.
Variables ¶
var (
DefaultDomain = "micro"
)
Defaults.
Functions ¶
func ProvideRegistryMDNS ¶
func ProvideRegistryMDNS( name types.ServiceName, version types.ServiceVersion, datas types.ConfigData, logger log.Logger, opts ...registry.Option, ) (registry.Type, error)
ProvideRegistryMDNS creates a new MDNS registry.
Types ¶
type Config ¶
type Config struct { registry.Config `yaml:",inline"` Domain string `json:"domain,omitempty" yaml:"domain,omitempty"` }
Config provides configuration for the mDNS registry.
func NewConfig ¶
func NewConfig( serviceName types.ServiceName, datas types.ConfigData, opts ...registry.Option, ) (Config, error)
NewConfig creates a new config object.
type RegistryMDNS ¶
RegistryMDNS implements the registry interface. It runs a MDNS service registry.
func New ¶
New creates a new mdns registry. This functions should rarely be called manually. To create a new registry use ProvideRegistryMDNS.
func (*RegistryMDNS) Deregister ¶
func (m *RegistryMDNS) Deregister(service *registry.Service, _ ...registry.DeregisterOption) error
Deregister a service from the registry.
func (*RegistryMDNS) GetService ¶
func (m *RegistryMDNS) GetService(service string, _ ...registry.GetOption) ([]*registry.Service, error)
GetService fetches a service from the registry.
func (*RegistryMDNS) ListServices ¶
func (m *RegistryMDNS) ListServices(_ ...registry.ListOption) ([]*registry.Service, error)
ListServices fetches all services in the registry.
func (*RegistryMDNS) Register ¶
func (m *RegistryMDNS) Register(service *registry.Service, _ ...registry.RegisterOption) error
Register registes a service's nodes to the registry.
func (*RegistryMDNS) ServiceName ¶
func (m *RegistryMDNS) ServiceName() string
ServiceName returns the configured name of this service.
func (*RegistryMDNS) ServiceVersion ¶
func (m *RegistryMDNS) ServiceVersion() string
ServiceVersion returns the configured version of this service.
func (*RegistryMDNS) String ¶
func (m *RegistryMDNS) String() string
String returns the plugin name.
func (*RegistryMDNS) Watch ¶
func (m *RegistryMDNS) Watch(opts ...registry.WatchOption) (registry.Watcher, error)
Watch for registration changes.
Directories ¶
Path | Synopsis |
---|---|
Package client provides utility functions for the mdns registry.
|
Package client provides utility functions for the mdns registry. |
Package dns provides mdns dns utilities.
|
Package dns provides mdns dns utilities. |
Package server provides an MDNS server.
|
Package server provides an MDNS server. |
Package util provides utilities.
|
Package util provides utilities. |
Package zone provides mDNS zone utilities.
|
Package zone provides mDNS zone utilities. |