zookeeper

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrConnIsNil               = errors.New("conn is nil")
	ErrConnIsNilButLocalNotNil = errors.New("conn is nil, but local is not nil")
)

Functions

This section is empty.

Types

type Logger

type Logger interface {
	Printf(string, ...interface{})
}

type Resolver

type Resolver struct {
	// contains filtered or unexported fields
}

func (*Resolver) Close

func (s *Resolver) Close()

func (*Resolver) ResolveNow

func (r *Resolver) ResolveNow(o resolver.ResolveNowOptions)

func (*Resolver) ResolveNowZK

func (r *Resolver) ResolveNowZK(o resolver.ResolveNowOptions)

type ZkClient

type ZkClient struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(zkServers []string, zkRoot string, options ...ZkOption) (*ZkClient, error)

func (*ZkClient) AddOption

func (s *ZkClient) AddOption(opts ...grpc.DialOption)

func (*ZkClient) Build

func (*ZkClient) CloseConn

func (s *ZkClient) CloseConn(conn grpc.ClientConnInterface)

func (*ZkClient) CloseZK

func (s *ZkClient) CloseZK()

func (*ZkClient) CreateRpcRootNodes

func (s *ZkClient) CreateRpcRootNodes(serviceNames []string) error

func (*ZkClient) CreateTempNode

func (s *ZkClient) CreateTempNode(rpcRegisterName, addr string) (node string, err error)

func (*ZkClient) GetClientLocalConns

func (s *ZkClient) GetClientLocalConns() map[string][]grpc.ClientConnInterface

func (*ZkClient) GetConfFromRegistry

func (s *ZkClient) GetConfFromRegistry(key string) ([]byte, error)

func (*ZkClient) GetConn

func (s *ZkClient) GetConn(ctx context.Context, serviceName string, opts ...grpc.DialOption) (grpc.ClientConnInterface, error)

func (*ZkClient) GetConns

func (s *ZkClient) GetConns(ctx context.Context, serviceName string, opts ...grpc.DialOption) ([]grpc.ClientConnInterface, error)

func (*ZkClient) GetConnsRemote

func (s *ZkClient) GetConnsRemote(serviceName string) (conns []resolver.Address, err error)

func (*ZkClient) GetNode

func (s *ZkClient) GetNode() string

func (*ZkClient) GetRootPath

func (s *ZkClient) GetRootPath() string

func (*ZkClient) GetZkConn

func (s *ZkClient) GetZkConn() *zk.Conn

func (*ZkClient) Register

func (s *ZkClient) Register(rpcRegisterName, host string, port int, opts ...grpc.DialOption) error

func (*ZkClient) RegisterConf2Registry

func (s *ZkClient) RegisterConf2Registry(key string, conf []byte) error

func (*ZkClient) Scheme

func (s *ZkClient) Scheme() string

func (*ZkClient) UnRegister

func (s *ZkClient) UnRegister() error

type ZkOption

type ZkOption func(*ZkClient)

func WithFreq

func WithFreq(freq time.Duration) ZkOption

func WithLogger

func WithLogger(logger Logger) ZkOption

func WithOptions

func WithOptions(opts ...grpc.DialOption) ZkOption

func WithRoundRobin

func WithRoundRobin() ZkOption

func WithTimeout

func WithTimeout(timeout int) ZkOption

func WithUserNameAndPassword

func WithUserNameAndPassword(userName, password string) ZkOption

Jump to

Keyboard shortcuts

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