client

package
v0.8.6 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close added in v0.1.11

func Close(client any)

关闭复用客户端

func CloseAwait added in v0.1.12

func CloseAwait(client any)

关闭复用客户端,等待所有请求结束后再关闭

func GetConsumers added in v0.1.21

func GetConsumers() []string

Types

type ClientConn added in v0.1.5

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

func GetConn

func GetConn(serviceName string, multiplex bool) (*ClientConn, error)

func (*ClientConn) Close added in v0.1.5

func (cc *ClientConn) Close() error

func (*ClientConn) Connect added in v0.1.5

func (cc *ClientConn) Connect()

func (*ClientConn) GetMethodConfig added in v0.1.5

func (cc *ClientConn) GetMethodConfig(method string) grpc.MethodConfig

func (*ClientConn) GetState added in v0.1.5

func (cc *ClientConn) GetState() connectivity.State

func (*ClientConn) Invoke added in v0.1.5

func (cc *ClientConn) Invoke(ctx goContext.Context, method string, args, reply any, opts ...grpc.CallOption) (err error)

func (*ClientConn) NewStream added in v0.1.5

func (cc *ClientConn) NewStream(ctx goContext.Context, desc *grpc.StreamDesc, method string, opts ...grpc.CallOption) (grpc.ClientStream, error)

func (*ClientConn) ResetConnectBackoff added in v0.1.5

func (cc *ClientConn) ResetConnectBackoff()

func (*ClientConn) Target added in v0.1.5

func (cc *ClientConn) Target() string

func (*ClientConn) WaitForStateChange added in v0.1.5

func (cc *ClientConn) WaitForStateChange(ctx goContext.Context, sourceState connectivity.State) bool

type ErrCon added in v0.3.10

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

func (ErrCon) Invoke added in v0.3.10

func (c ErrCon) Invoke(ctx context.Context, method string, args any, reply any, opts ...grpc.CallOption) error

func (ErrCon) NewStream added in v0.3.10

func (c ErrCon) NewStream(ctx context.Context, desc *grpc.StreamDesc, method string, opts ...grpc.CallOption) (grpc.ClientStream, error)

type GenerateFun added in v0.8.0

type GenerateFun[t any] func(isMultiplex ...bool) t

func ClientAuto

func ClientAuto[t any](fun func(cc grpc.ClientConnInterface) t) GenerateFun[t]

func NewClient

func NewClient[t any](serviceName string, fun func(cc grpc.ClientConnInterface) t) GenerateFun[t]

Jump to

Keyboard shortcuts

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