SpringCloudZookeeper

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: 6 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ZOOKEEPER_DISCOVERY_ROOT = "/discovery_service"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ZookeeperDiscoveryClient

type ZookeeperDiscoveryClient struct {
	Config *ZookeeperDiscoveryConfig `autowire:""`
	Conn   *zk.Conn
	AppId  string // 当前应用程序的ID
}

func (*ZookeeperDiscoveryClient) CreateNode

func (client *ZookeeperDiscoveryClient) CreateNode(path string, data []byte, flags int32) error

func (*ZookeeperDiscoveryClient) GetInstances

func (client *ZookeeperDiscoveryClient) GetInstances(serviceId string) (instances []*SpringCloudDiscovery.ServiceInstance, err error)

func (*ZookeeperDiscoveryClient) GetServices

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

func (*ZookeeperDiscoveryClient) InitBean

func (client *ZookeeperDiscoveryClient) InitBean(context SpringCore.SpringContext) error

func (*ZookeeperDiscoveryClient) PrintNode

func (client *ZookeeperDiscoveryClient) PrintNode(path string) error

func (*ZookeeperDiscoveryClient) WalkNode

func (client *ZookeeperDiscoveryClient) WalkNode(path string) error

type ZookeeperDiscoveryConfig

type ZookeeperDiscoveryConfig struct {
	// 服务发现地址
	Address string `value:"${zookeeper.address:=127.0.0.1:2181}"`

	AppName string `value:"${spring.application.name}"`
}

zookeeper 服务发现配置

Jump to

Keyboard shortcuts

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