Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ServiceDiscovery ¶
type ServiceDiscovery interface { // QueryAllServices get all service from remote registry center QueryAllServices() ([]ServiceInstance, error) // QueryServicesByName get service by serviceName from remote registry center QueryServicesByName(serviceNames []string) ([]ServiceInstance, error) // Register register to remote registry center Register() error // UnRegister unregister to remote registry center UnRegister() error // Subscribe subscribe the service event from remote registry center Subscribe() error // Unsubscribe unsubscribe from remote registry center Unsubscribe() error }
type ServiceEventListener ¶
type ServiceEventListener interface { OnAddServiceInstance(r *ServiceInstance) OnDeleteServiceInstance(r *ServiceInstance) OnUpdateServiceInstance(r *ServiceInstance) GetServiceNames() []string }
type ServiceInstance ¶
type ServiceInstance struct { ID string ServiceName string // host:port Host string Port int Healthy bool CLusterName string Enable bool // extra info such as label or other meta data Metadata map[string]string }
ServiceInstance the service instance info fetched from registry such as nacos consul
func (*ServiceInstance) GetUniqKey ¶
func (i *ServiceInstance) GetUniqKey() string
func (*ServiceInstance) ToEndpoint ¶
func (i *ServiceInstance) ToEndpoint() *model.Endpoint
ToEndpoint
func (*ServiceInstance) ToRoute ¶
func (i *ServiceInstance) ToRoute() *model.Router
ToRoute route ID is cluster name, so equal with endpoint name and routerMatch prefix is also service name
Click to show internal directories.
Click to hide internal directories.