Documentation ¶
Index ¶
- Constants
- func NewServerDiscovery(option Config) servicediscovery.IServiceDiscovery
- func NewServerDiscoveryWithDI(configuration abstractions.IConfiguration, env *abstractions.HostEnvironment) servicediscovery.IServiceDiscovery
- func UseServiceDiscovery(serviceCollection *dependencyinjection.ServiceCollection)
- type Config
- type Registrar
- func (register Registrar) Destroy() error
- func (register Registrar) GetAllInstances(serviceName string) []servicediscovery.ServiceInstance
- func (register Registrar) GetHealthyInstances(serviceName string) []servicediscovery.ServiceInstance
- func (register Registrar) GetName() string
- func (register *Registrar) Register() error
- func (register Registrar) Unregister() error
- func (register Registrar) Update() error
Constants ¶
View Source
const ( GroupName = "DEFAULT_GROUP" Cluster = "DEFAULT" )
Variables ¶
This section is empty.
Functions ¶
func NewServerDiscovery ¶
func NewServerDiscovery(option Config) servicediscovery.IServiceDiscovery
func NewServerDiscoveryWithDI ¶
func NewServerDiscoveryWithDI(configuration abstractions.IConfiguration, env *abstractions.HostEnvironment) servicediscovery.IServiceDiscovery
func UseServiceDiscovery ¶
func UseServiceDiscovery(serviceCollection *dependencyinjection.ServiceCollection)
Types ¶
type Config ¶
type Config struct { ENV *abstractions.HostEnvironment Url string `mapstructure:"url"` Port uint64 `mapstructure:"port"` NamespaceId string `mapstructure:"namespace"` GroupName string `mapstructure:"group_name"` ClusterName string `mapstructure:"cluster_name"` }
type Registrar ¶
type Registrar struct {
// contains filtered or unexported fields
}
func (Registrar) GetAllInstances ¶
func (register Registrar) GetAllInstances(serviceName string) []servicediscovery.ServiceInstance
func (Registrar) GetHealthyInstances ¶
func (register Registrar) GetHealthyInstances(serviceName string) []servicediscovery.ServiceInstance
func (Registrar) Unregister ¶
Click to show internal directories.
Click to hide internal directories.