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 Auth
- type Config
- type Registrar
- func (registrar *Registrar) Destroy() error
- func (registrar *Registrar) GetAllInstances(serviceName string) []servicediscovery.ServiceInstance
- func (registrar *Registrar) GetAllServices() ([]*servicediscovery.Service, error)
- func (registrar *Registrar) GetHealthyInstances(serviceName string) []servicediscovery.ServiceInstance
- func (registrar Registrar) GetName() string
- func (registrar *Registrar) Register() error
- func (registrar *Registrar) Unregister() error
- func (registrar *Registrar) Update() error
- func (registrar *Registrar) Watch(opts ...servicediscovery.WatchOption) (servicediscovery.Watcher, error)
- type Watcher
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 Auth ¶
type Auth struct { Enable bool `mapstructure:"enable" config:"enable"` User string `mapstructure:"username" config:"username"` Password string `mapstructure:"password" config:"password"` // ACM Endpoint Endpoint string `mapstructure:"endpoint" config:"endpoint"` // ACM RegionId RegionId string `mapstructure:"regionId" config:"regionId"` // ACM AccessKey AccessKey string `mapstructure:"accessKey" config:"accessKey"` // ACM SecretKey SecretKey string `mapstructure:"secretKey" config:"secretKey"` // ACM OpenKMS OpenKMS bool `mapstructure:"openKMS" config:"openKMS"` }
type Config ¶
type Config struct { ENV *abstractions.HostEnvironment Url string `mapstructure:"url" config:"url"` Port uint64 `mapstructure:"port" config:"port"` NamespaceId string `mapstructure:"namespace" config:"namespace"` GroupName string `mapstructure:"group" config:"group"` Cluster string `mapstructure:"cluster" config:"cluster"` Auth *Auth `mapstructure:"auth" config:"auth"` }
type Registrar ¶
type Registrar struct {
// contains filtered or unexported fields
}
func (*Registrar) GetAllInstances ¶
func (registrar *Registrar) GetAllInstances(serviceName string) []servicediscovery.ServiceInstance
func (*Registrar) GetAllServices ¶
func (registrar *Registrar) GetAllServices() ([]*servicediscovery.Service, error)
func (*Registrar) GetHealthyInstances ¶
func (registrar *Registrar) GetHealthyInstances(serviceName string) []servicediscovery.ServiceInstance
func (*Registrar) Unregister ¶
func (*Registrar) Watch ¶
func (registrar *Registrar) Watch(opts ...servicediscovery.WatchOption) (servicediscovery.Watcher, error)
Click to show internal directories.
Click to hide internal directories.