Documentation ¶
Index ¶
- type DiscoveryClient
- type KitDiscoverClient
- func (consulClient *KitDiscoverClient) DeRegister(instanceId string, logger *log.Logger) bool
- func (consulClient *KitDiscoverClient) DiscoverServices(serviceName string, logger *log.Logger) []interface{}
- func (consulClient *KitDiscoverClient) Register(serviceName, instanceId, healthCheckUrl string, instanceHost string, ...) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiscoveryClient ¶
type DiscoveryClient interface { /** * 服务注册接口 * @param serviceName 服务名 * @param instanceId 服务实例Id * @param instancePort 服务实例端口 * @param healthCheckUrl 健康检查地址 * @param instanceHost 服务实例地址 * @param meta 服务实例元数据 */ Register(serviceName, instanceId, healthCheckUrl string, instanceHost string, instancePort int, meta map[string]string, logger *log.Logger) bool /** * 服务注销接口 * @param instanceId 服务实例Id */ DeRegister(instanceId string, logger *log.Logger) bool /** * 发现服务实例接口 * @param serviceName 服务名 */ DiscoverServices(serviceName string, logger *log.Logger) []interface{} }
func NewKitDiscoverClient ¶
func NewKitDiscoverClient(consulHost string, consulPort int) (DiscoveryClient, error)
type KitDiscoverClient ¶
type KitDiscoverClient struct { Host string // Consul Host Port int // Consul Port // contains filtered or unexported fields }
func (*KitDiscoverClient) DeRegister ¶
func (consulClient *KitDiscoverClient) DeRegister(instanceId string, logger *log.Logger) bool
func (*KitDiscoverClient) DiscoverServices ¶
func (consulClient *KitDiscoverClient) DiscoverServices(serviceName string, logger *log.Logger) []interface{}
Click to show internal directories.
Click to hide internal directories.