xgrpc

package
v0.0.0-...-d80f745 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnableReflectionIfNecessary

func EnableReflectionIfNecessary(c zrpc.RpcServerConf, s *grpc.Server)

func MustNewClient

func MustNewClient[T any, P func(cc grpc.ClientConnInterface) T](
	conf xconf.Discovery, constructor P) (ret T)

func NewClient

func NewClient[T any, P func(cc grpc.ClientConnInterface) T](
	conf xconf.Discovery, constructor P) (ret T, err error)

泛型版本 快速创建带通用来拦截器的grpc客户端连接

func NewClientConn

func NewClientConn(conf xconf.Discovery) (*grpc.ClientConn, error)

创建带通用拦截器的grpc客户端连接

func NewClientFromDiscovery

func NewClientFromDiscovery(conf xconf.Discovery) (zrpc.Client, error)

快速创建带通用拦截器的grpc客户端连接

func NewRecoverableClient

func NewRecoverableClient[T any](c xconf.Discovery, getter func(grpc.ClientConnInterface) T, fallback func(T)) T

func RetryConnectConn

func RetryConnectConn(c xconf.Discovery, connecter func(cc grpc.ClientConnInterface))

重新连接

func RetryConnectConnInBackground

func RetryConnectConnInBackground(c xconf.Discovery, connect func(cc grpc.ClientConnInterface))

Types

type UnreadyClientConn

type UnreadyClientConn struct {
}

func NewUnreadyClientConn

func NewUnreadyClientConn() *UnreadyClientConn

func (*UnreadyClientConn) Invoke

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

func (*UnreadyClientConn) NewStream

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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