Documentation ¶
Index ¶
- func DeRegisterServiceInstance(param vo.DeregisterInstanceParam)
- func GetInstance(app string) string
- func InitDiscovery(discoveryType string, app string, config ...interface{})
- func RegisterServiceInstance(param vo.RegisterInstanceParam)
- type Discovery
- type Eureka
- type Nacos
- func (n *Nacos) GetAllService(param vo.GetAllServiceInfoParam) model.ServiceList
- func (n *Nacos) GetInstance(serviceName string) (string, error)
- func (n *Nacos) GetService(param vo.GetServiceParam)
- func (n *Nacos) SelectAllInstances(param vo.SelectAllInstancesParam)
- func (n *Nacos) SelectInstances(param vo.SelectInstancesParam)
- func (n *Nacos) SelectOneHealthyInstance(param vo.SelectOneHealthInstanceParam) *model.Instance
- func (n *Nacos) Subscribe(param *vo.SubscribeParam)
- func (n *Nacos) UnSubscribe(param *vo.SubscribeParam)
- type Registry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeRegisterServiceInstance ¶
func DeRegisterServiceInstance(param vo.DeregisterInstanceParam)
func GetInstance ¶ added in v0.0.6
func InitDiscovery ¶
InitDiscovery 初始化注册中心
discoveryType 为 eureka 时,config 参数共 4 个,依次为:"用户名", "密码", "eureka地址:7000/eureka/", 应用端口
discoveryType 为 nacos时,config 参数共 5个,依次为:nacos地址, contextPath, nameSpaceID, nacosPort, appPort
func RegisterServiceInstance ¶
func RegisterServiceInstance(param vo.RegisterInstanceParam)
Types ¶
type Nacos ¶
type Nacos struct { }
func CreateNacos ¶
CreateNacos 初始化nacos 并将应用注册到nacos
func (*Nacos) GetAllService ¶
func (n *Nacos) GetAllService(param vo.GetAllServiceInfoParam) model.ServiceList
func (*Nacos) GetService ¶
func (n *Nacos) GetService(param vo.GetServiceParam)
func (*Nacos) SelectAllInstances ¶
func (n *Nacos) SelectAllInstances(param vo.SelectAllInstancesParam)
func (*Nacos) SelectInstances ¶
func (n *Nacos) SelectInstances(param vo.SelectInstancesParam)
func (*Nacos) SelectOneHealthyInstance ¶
func (n *Nacos) SelectOneHealthyInstance(param vo.SelectOneHealthInstanceParam) *model.Instance
func (*Nacos) Subscribe ¶
func (n *Nacos) Subscribe(param *vo.SubscribeParam)
func (*Nacos) UnSubscribe ¶
func (n *Nacos) UnSubscribe(param *vo.SubscribeParam)
Click to show internal directories.
Click to hide internal directories.