zookeeper

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 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) Close

func (s *ZkClient) Close()

func (*ZkClient) CloseConn

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

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.ClientConn

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.ClientConn, error)

func (*ZkClient) GetConns

func (s *ZkClient) GetConns(ctx context.Context, serviceName string, opts ...grpc.DialOption) ([]*grpc.ClientConn, 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) GetSelfConnTarget

func (s *ZkClient) GetSelfConnTarget() string

func (*ZkClient) GetUserIdHashGatewayHost

func (s *ZkClient) GetUserIdHashGatewayHost(ctx context.Context, userId string) (string, error)

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