Documentation
¶
Index ¶
- func EnableReflectionIfNecessary(c zrpc.RpcServerConf, s *grpc.Server)
- func MustNewClient[T any, P func(cc grpc.ClientConnInterface) T](conf xconf.Discovery, constructor P) (ret T)
- func NewClient[T any, P func(cc grpc.ClientConnInterface) T](conf xconf.Discovery, constructor P) (ret T, err error)
- func NewClientConn(conf xconf.Discovery) (*grpc.ClientConn, error)
- func NewClientFromDiscovery(conf xconf.Discovery) (zrpc.Client, error)
- func NewRecoverableClient[T any](c xconf.Discovery, getter func(grpc.ClientConnInterface) T, fallback func(T)) T
- func RetryConnectConn(c xconf.Discovery, connecter func(cc grpc.ClientConnInterface))
- func RetryConnectConnInBackground(c xconf.Discovery, connect func(cc grpc.ClientConnInterface))
- type UnreadyClientConn
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 ¶
快速创建带通用拦截器的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)
Click to show internal directories.
Click to hide internal directories.