client

package
v0.0.0-...-06bcc1c Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 14 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client contain grpc conn

func NewClient

func NewClient(ctx context.Context, addr string, authConfig types.AuthConfig) (*Client, error)

NewClient new a client

func (*Client) GetConn

func (c *Client) GetConn() *grpc.ClientConn

GetConn return connection

func (*Client) GetRPCClient

func (c *Client) GetRPCClient() pb.CoreRPCClient

GetRPCClient return rpc client

type Pool

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

Pool implement of RPCClientPool

func NewCoreRPCClientPool

func NewCoreRPCClientPool(ctx context.Context, config *PoolConfig) (*Pool, error)

NewCoreRPCClientPool .

func (*Pool) GetClient

func (c *Pool) GetClient() pb.CoreRPCClient

GetClient finds the first *client.Client instance with an active connection. If all connections are dead, returns the first one.

type PoolConfig

type PoolConfig struct {
	EruAddrs          []string
	Auth              types.AuthConfig
	ConnectionTimeout time.Duration
}

PoolConfig config for client pool

Directories

Path Synopsis
resolver
eru

Jump to

Keyboard shortcuts

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