grpc

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrConnNotReady = errors.ErrorCode_InternalError.WithMessage("connection is not ready")
)

Functions

This section is empty.

Types

type ClientConn

type ClientConn struct {
	*grpc.ClientConn
	// contains filtered or unexported fields
}

func NewClientConn

func NewClientConn(insecure bool, opts ...kratosGrpc.ClientOption) *ClientConn

func (*ClientConn) Close

func (c *ClientConn) Close() error

func (*ClientConn) Connect

func (c *ClientConn) Connect() error

type ConnPool

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

func NewConnPool

func NewConnPool(opts ...PoolOption) (*ConnPool, error)

TODO: conn pool should not be blocked and should try to reconnect

func (*ConnPool) Get

func (c *ConnPool) Get() (*ClientConn, error)

func (*ConnPool) Len

func (c *ConnPool) Len() int

func (*ConnPool) Release

func (c *ConnPool) Release() error

type PoolOption

type PoolOption func(opts *poolOptions)

func WithClientOption

func WithClientOption(opts ...kratosGrpc.ClientOption) PoolOption

func WithInsecure

func WithInsecure() PoolOption

func WithPoolSize

func WithPoolSize(size int) PoolOption

Jump to

Keyboard shortcuts

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