SpringCloudConsul

package
v0.0.0-...-99ef4e9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2019 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsulDiscoveryClient

type ConsulDiscoveryClient struct {
	Client *ConsulApi.Client
	Config *ConsulDiscoveryConfig `autowire:"ConsulDiscoveryConfig"`

	CheckPath    string
	CheckHandler func(http.ResponseWriter, *http.Request) `json:"-"`
}

consul 服务发现客户端

func (*ConsulDiscoveryClient) GetInstances

func (client *ConsulDiscoveryClient) GetInstances(serviceId string) ([]*SpringCloudDiscovery.ServiceInstance, error)

func (*ConsulDiscoveryClient) GetServices

func (client *ConsulDiscoveryClient) GetServices() ([]string, error)

func (*ConsulDiscoveryClient) InitBean

func (client *ConsulDiscoveryClient) InitBean(context SpringCore.SpringContext) (err error)

type ConsulDiscoveryConfig

type ConsulDiscoveryConfig struct {
	// 服务发现地址
	Address string `value:"${consul.address}"`

	// 健康检查配置
	CheckPort int32 `value:"${consul.check.port}"`
}

consul 服务发现配置

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL