Documentation ¶
Index ¶
- Variables
- func Check(ctx context.Context, ZkServers []string, scheme string, options ...ZkOption) error
- type Config
- type Resolver
- type ZkClient
- func (s *ZkClient) AddOption(opts ...grpc.DialOption)
- func (s *ZkClient) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error)
- func (s *ZkClient) Close()
- func (s *ZkClient) CloseConn(conn *grpc.ClientConn)
- func (s *ZkClient) CreateRpcRootNodes(serviceNames []string) error
- func (s *ZkClient) CreateTempNode(rpcRegisterName, addr string) (node string, err error)
- func (s *ZkClient) GetClientLocalConns() map[string][]*grpc.ClientConn
- func (s *ZkClient) GetConfFromRegistry(key string) ([]byte, error)
- func (s *ZkClient) GetConn(ctx context.Context, serviceName string, opts ...grpc.DialOption) (*grpc.ClientConn, error)
- func (s *ZkClient) GetConns(ctx context.Context, serviceName string, opts ...grpc.DialOption) ([]*grpc.ClientConn, error)
- func (s *ZkClient) GetConnsRemote(ctx context.Context, serviceName string) (conns []resolver.Address, err error)
- func (s *ZkClient) GetNode() string
- func (s *ZkClient) GetRootPath() string
- func (s *ZkClient) GetSelfConnTarget() string
- func (s *ZkClient) GetUserIdHashGatewayHost(ctx context.Context, userId string) (string, error)
- func (s *ZkClient) GetZkConn() *zk.Conn
- func (s *ZkClient) Register(rpcRegisterName, host string, port int, opts ...grpc.DialOption) error
- func (s *ZkClient) RegisterConf2Registry(key string, conf []byte) error
- func (s *ZkClient) Scheme() string
- func (s *ZkClient) UnRegister() error
- type ZkOption
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrConnIsNil = errs.New("conn is nil") ErrConnIsNilButLocalNotNil = errs.New("conn is nil, but local is not nil") )
Functions ¶
Types ¶
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
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 { ZkServers []string // contains filtered or unexported fields }
func NewZkClient ¶ added in v0.0.47
NewZkClient initializes a new ZkClient with provided options and establishes a Zookeeper connection.
func (*ZkClient) AddOption ¶
func (s *ZkClient) AddOption(opts ...grpc.DialOption)
func (*ZkClient) Build ¶
func (s *ZkClient) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error)
func (*ZkClient) CloseConn ¶
func (s *ZkClient) CloseConn(conn *grpc.ClientConn)
func (*ZkClient) CreateRpcRootNodes ¶
func (*ZkClient) CreateTempNode ¶
func (*ZkClient) GetClientLocalConns ¶
func (s *ZkClient) GetClientLocalConns() map[string][]*grpc.ClientConn
func (*ZkClient) GetConfFromRegistry ¶
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 (*ZkClient) GetRootPath ¶
func (*ZkClient) GetSelfConnTarget ¶
func (*ZkClient) GetUserIdHashGatewayHost ¶
func (*ZkClient) RegisterConf2Registry ¶
func (*ZkClient) UnRegister ¶
type ZkOption ¶
type ZkOption func(*ZkClient)
func WithLogger ¶
func WithOptions ¶
func WithOptions(opts ...grpc.DialOption) ZkOption
func WithRoundRobin ¶
func WithRoundRobin() ZkOption
func WithTimeout ¶
func WithUserNameAndPassword ¶
Click to show internal directories.
Click to hide internal directories.