cherryGRPC

package
v1.1.16 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildRpcClientConn added in v1.1.9

func BuildRpcClientConn(address string, timeout time.Duration, opts ...grpc.DialOption) (*grpc.ClientConn, error)

func GetIP

func GetIP(ctx context.Context) string

Types

type ClientConn added in v1.1.9

type ClientConn struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewClientConn added in v1.1.9

func NewClientConn(nodeId, address string) *ClientConn

func (*ClientConn) Address added in v1.1.9

func (c *ClientConn) Address() string

func (*ClientConn) Connect added in v1.1.9

func (c *ClientConn) Connect() error

func (*ClientConn) Disconnect added in v1.1.9

func (c *ClientConn) Disconnect()

func (*ClientConn) GetGRPCClientConn added in v1.1.9

func (c *ClientConn) GetGRPCClientConn() *grpc.ClientConn

func (*ClientConn) IsConnect added in v1.1.9

func (c *ClientConn) IsConnect() bool

func (*ClientConn) NodeId added in v1.1.9

func (c *ClientConn) NodeId() string

func (*ClientConn) String added in v1.1.9

func (c *ClientConn) String() string

type ConnPool added in v1.1.9

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

func NewPool added in v1.1.9

func NewPool(opts ...grpc.DialOption) *ConnPool

func (*ConnPool) AddConn added in v1.1.9

func (c *ConnPool) AddConn(nodeId string, address string)

func (*ConnPool) Close added in v1.1.9

func (c *ConnPool) Close()

func (*ConnPool) Contains added in v1.1.9

func (c *ConnPool) Contains(nodeId string) bool

func (*ConnPool) GetConn added in v1.1.9

func (c *ConnPool) GetConn(nodeId string) (*ClientConn, bool)

func (*ConnPool) Remove added in v1.1.9

func (c *ConnPool) Remove(nodeId string)

Jump to

Keyboard shortcuts

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