Versions in this module Expand all Collapse all v1 v1.70.1 Apr 30, 2025 Changes in this version + const SupportPackageIsVersion3 + const SupportPackageIsVersion4 + const SupportPackageIsVersion5 + const SupportPackageIsVersion6 + const SupportPackageIsVersion7 + const SupportPackageIsVersion8 + const SupportPackageIsVersion9 + const Version + var DefaultBackoffConfig = BackoffConfig + var EnableTracing bool + var ErrClientConnClosing = status.Error(codes.Canceled, "grpc: the client connection is closing") + var ErrClientConnTimeout = errors.New("grpc: timed out when dialing") + var ErrServerStopped = errors.New("grpc: the server has been stopped") + var PickFirstBalancerName = pickfirst.Name + func ClientSupportedCompressors(ctx context.Context) ([]string, error) + func Code(err error) codes.Code + func ErrorDesc(err error) string + func Errorf(c codes.Code, format string, a ...any) error + func Invoke(ctx context.Context, method string, args, reply any, cc *ClientConn, ...) error + func Method(ctx context.Context) (string, bool) + func MethodFromServerStream(stream ServerStream) (string, bool) + func NewContextWithServerTransportStream(ctx context.Context, stream ServerTransportStream) context.Context + func SendHeader(ctx context.Context, md metadata.MD) error + func SetHeader(ctx context.Context, md metadata.MD) error + func SetSendCompressor(ctx context.Context, name string) error + func SetTrailer(ctx context.Context, md metadata.MD) error + type BackoffConfig struct + MaxDelay time.Duration + type BidiStreamingClient interface + Recv func() (*Res, error) + Send func(*Req) error + type BidiStreamingServer interface + Recv func() (*Req, error) + Send func(*Res) error + type CallOption interface + func CallContentSubtype(contentSubtype string) CallOption + func CallCustomCodec(codec Codec) CallOption + func FailFast(failFast bool) CallOption + func ForceCodec(codec encoding.Codec) CallOption + func ForceCodecV2(codec encoding.CodecV2) CallOption + func Header(md *metadata.MD) CallOption + func MaxCallRecvMsgSize(bytes int) CallOption + func MaxCallSendMsgSize(bytes int) CallOption + func MaxRetryRPCBufferSize(bytes int) CallOption + func OnFinish(onFinish func(err error)) CallOption + func Peer(p *peer.Peer) CallOption + func PerRPCCredentials(creds credentials.PerRPCCredentials) CallOption + func StaticMethod() CallOption + func Trailer(md *metadata.MD) CallOption + func UseCompressor(name string) CallOption + func WaitForReady(waitForReady bool) CallOption + type ClientConn struct + func Dial(target string, opts ...DialOption) (*ClientConn, error) + func DialContext(ctx context.Context, target string, opts ...DialOption) (conn *ClientConn, err error) + func NewClient(target string, opts ...DialOption) (conn *ClientConn, err error) + func (cc *ClientConn) CanonicalTarget() string + func (cc *ClientConn) Close() error + func (cc *ClientConn) Connect() + func (cc *ClientConn) GetMethodConfig(method string) MethodConfig + func (cc *ClientConn) GetState() connectivity.State + func (cc *ClientConn) Invoke(ctx context.Context, method string, args, reply any, opts ...CallOption) error + func (cc *ClientConn) NewStream(ctx context.Context, desc *StreamDesc, method string, opts ...CallOption) (ClientStream, error) + func (cc *ClientConn) ResetConnectBackoff() + func (cc *ClientConn) Target() string + func (cc *ClientConn) WaitForStateChange(ctx context.Context, sourceState connectivity.State) bool + type ClientConnInterface interface + Invoke func(ctx context.Context, method string, args any, reply any, opts ...CallOption) error + NewStream func(ctx context.Context, desc *StreamDesc, method string, opts ...CallOption) (ClientStream, error) + type ClientStream interface + CloseSend func() error + Context func() context.Context + Header func() (metadata.MD, error) + RecvMsg func(m any) error + SendMsg func(m any) error + Trailer func() metadata.MD + func NewClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, ...) (ClientStream, error) + type ClientStreamingClient interface + CloseAndRecv func() (*Res, error) + Send func(*Req) error + type ClientStreamingServer interface + Recv func() (*Req, error) + SendAndClose func(*Res) error + type Codec interface + Marshal func(v any) ([]byte, error) + String func() string + Unmarshal func(data []byte, v any) error + type Compressor interface + Do func(w io.Writer, p []byte) error + Type func() string + func NewGZIPCompressor() Compressor + func NewGZIPCompressorWithLevel(level int) (Compressor, error) + type CompressorCallOption struct + CompressorType string + type ConnectParams struct + Backoff backoff.Config + MinConnectTimeout time.Duration + type ContentSubtypeCallOption struct + ContentSubtype string + type CustomCodecCallOption struct + Codec Codec + type Decompressor interface + Do func(r io.Reader) ([]byte, error) + Type func() string + func NewGZIPDecompressor() Decompressor + type DialOption interface + func FailOnNonTempDialError(f bool) DialOption + func WithAuthority(a string) DialOption + func WithBackoffConfig(b BackoffConfig) DialOption + func WithBackoffMaxDelay(md time.Duration) DialOption + func WithBlock() DialOption + func WithChainStreamInterceptor(interceptors ...StreamClientInterceptor) DialOption + func WithChainUnaryInterceptor(interceptors ...UnaryClientInterceptor) DialOption + func WithChannelzParentID(c channelz.Identifier) DialOption + func WithCodec(c Codec) DialOption + func WithCompressor(cp Compressor) DialOption + func WithConnectParams(p ConnectParams) DialOption + func WithContextDialer(f func(context.Context, string) (net.Conn, error)) DialOption + func WithCredentialsBundle(b credentials.Bundle) DialOption + func WithDecompressor(dc Decompressor) DialOption + func WithDefaultCallOptions(cos ...CallOption) DialOption + func WithDefaultServiceConfig(s string) DialOption + func WithDialer(f func(string, time.Duration) (net.Conn, error)) DialOption + func WithDisableHealthCheck() DialOption + func WithDisableRetry() DialOption + func WithDisableServiceConfig() DialOption + func WithIdleTimeout(d time.Duration) DialOption + func WithInitialConnWindowSize(s int32) DialOption + func WithInitialWindowSize(s int32) DialOption + func WithInsecure() DialOption + func WithKeepaliveParams(kp keepalive.ClientParameters) DialOption + func WithLocalDNSResolution() DialOption + func WithMaxCallAttempts(n int) DialOption + func WithMaxHeaderListSize(s uint32) DialOption + func WithMaxMsgSize(s int) DialOption + func WithNoProxy() DialOption + func WithPerRPCCredentials(creds credentials.PerRPCCredentials) DialOption + func WithReadBufferSize(s int) DialOption + func WithResolvers(rs ...resolver.Builder) DialOption + func WithReturnConnectionError() DialOption + func WithSharedWriteBuffer(val bool) DialOption + func WithStatsHandler(h stats.Handler) DialOption + func WithStreamInterceptor(f StreamClientInterceptor) DialOption + func WithTimeout(d time.Duration) DialOption + func WithTransportCredentials(creds credentials.TransportCredentials) DialOption + func WithUnaryInterceptor(f UnaryClientInterceptor) DialOption + func WithUserAgent(s string) DialOption + func WithWriteBufferSize(s int) DialOption + type EmptyCallOption struct + type EmptyDialOption struct + type EmptyServerOption struct + type FailFastCallOption struct + FailFast bool + type ForceCodecCallOption struct + Codec encoding.Codec + type ForceCodecV2CallOption struct + CodecV2 encoding.CodecV2 + type GenericClientStream struct + func (x *GenericClientStream[Req, Res]) CloseAndRecv() (*Res, error) + func (x *GenericClientStream[Req, Res]) Recv() (*Res, error) + func (x *GenericClientStream[Req, Res]) Send(m *Req) error + type GenericServerStream struct + func (x *GenericServerStream[Req, Res]) Recv() (*Req, error) + func (x *GenericServerStream[Req, Res]) Send(m *Res) error + func (x *GenericServerStream[Req, Res]) SendAndClose(m *Res) error + type HeaderCallOption struct + HeaderAddr *metadata.MD + type MaxHeaderListSizeDialOption struct + MaxHeaderListSize uint32 + type MaxHeaderListSizeServerOption struct + MaxHeaderListSize uint32 + type MaxRecvMsgSizeCallOption struct + MaxRecvMsgSize int + type MaxRetryRPCBufferSizeCallOption struct + MaxRetryRPCBufferSize int + type MaxSendMsgSizeCallOption struct + MaxSendMsgSize int + type MethodConfig = internalserviceconfig.MethodConfig + type MethodDesc struct + Handler MethodHandler + MethodName string + type MethodHandler func(srv any, ctx context.Context, dec func(any) error, ...) (any, error) + type MethodInfo struct + IsClientStream bool + IsServerStream bool + Name string + type OnFinishCallOption struct + OnFinish func(error) + type PeerCallOption struct + PeerAddr *peer.Peer + type PerRPCCredsCallOption struct + Creds credentials.PerRPCCredentials + type PreparedMsg struct + func (p *PreparedMsg) Encode(s Stream, msg any) error + type Server struct + func NewServer(opt ...ServerOption) *Server + func (s *Server) GetServiceInfo() map[string]ServiceInfo + func (s *Server) GracefulStop() + func (s *Server) RegisterService(sd *ServiceDesc, ss any) + func (s *Server) Serve(lis net.Listener) error + func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (s *Server) Stop() + type ServerOption interface + func ChainStreamInterceptor(interceptors ...StreamServerInterceptor) ServerOption + func ChainUnaryInterceptor(interceptors ...UnaryServerInterceptor) ServerOption + func ConnectionTimeout(d time.Duration) ServerOption + func Creds(c credentials.TransportCredentials) ServerOption + func CustomCodec(codec Codec) ServerOption + func ForceServerCodec(codec encoding.Codec) ServerOption + func ForceServerCodecV2(codecV2 encoding.CodecV2) ServerOption + func HeaderTableSize(s uint32) ServerOption + func InTapHandle(h tap.ServerInHandle) ServerOption + func InitialConnWindowSize(s int32) ServerOption + func InitialWindowSize(s int32) ServerOption + func KeepaliveEnforcementPolicy(kep keepalive.EnforcementPolicy) ServerOption + func KeepaliveParams(kp keepalive.ServerParameters) ServerOption + func MaxConcurrentStreams(n uint32) ServerOption + func MaxHeaderListSize(s uint32) ServerOption + func MaxMsgSize(m int) ServerOption + func MaxRecvMsgSize(m int) ServerOption + func MaxSendMsgSize(m int) ServerOption + func NumStreamWorkers(numServerWorkers uint32) ServerOption + func RPCCompressor(cp Compressor) ServerOption + func RPCDecompressor(dc Decompressor) ServerOption + func ReadBufferSize(s int) ServerOption + func SharedWriteBuffer(val bool) ServerOption + func StatsHandler(h stats.Handler) ServerOption + func StreamInterceptor(i StreamServerInterceptor) ServerOption + func UnaryInterceptor(i UnaryServerInterceptor) ServerOption + func UnknownServiceHandler(streamHandler StreamHandler) ServerOption + func WaitForHandlers(w bool) ServerOption + func WriteBufferSize(s int) ServerOption + type ServerStream interface + Context func() context.Context + RecvMsg func(m any) error + SendHeader func(metadata.MD) error + SendMsg func(m any) error + SetHeader func(metadata.MD) error + SetTrailer func(metadata.MD) + type ServerStreamingClient interface + Recv func() (*Res, error) + type ServerStreamingServer interface + Send func(*Res) error + type ServerTransportStream interface + Method func() string + SendHeader func(md metadata.MD) error + SetHeader func(md metadata.MD) error + SetTrailer func(md metadata.MD) error + func ServerTransportStreamFromContext(ctx context.Context) ServerTransportStream + type ServiceConfig struct + Methods map[string]MethodConfig + type ServiceDesc struct + HandlerType any + Metadata any + Methods []MethodDesc + ServiceName string + Streams []StreamDesc + type ServiceInfo struct + Metadata any + Methods []MethodInfo + type ServiceRegistrar interface + RegisterService func(desc *ServiceDesc, impl any) + type StaticMethodCallOption struct + type Stream interface + Context func() context.Context + RecvMsg func(m any) error + SendMsg func(m any) error + type StreamClientInterceptor func(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, ...) (ClientStream, error) + type StreamDesc struct + ClientStreams bool + Handler StreamHandler + ServerStreams bool + StreamName string + type StreamHandler func(srv any, stream ServerStream) error + type StreamServerInfo struct + FullMethod string + IsClientStream bool + IsServerStream bool + type StreamServerInterceptor func(srv any, ss ServerStream, info *StreamServerInfo, handler StreamHandler) error + type Streamer func(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, ...) (ClientStream, error) + type TrailerCallOption struct + TrailerAddr *metadata.MD + type UnaryClientInterceptor func(ctx context.Context, method string, req, reply any, cc *ClientConn, ...) error + type UnaryHandler func(ctx context.Context, req any) (any, error) + type UnaryInvoker func(ctx context.Context, method string, req, reply any, cc *ClientConn, ...) error + type UnaryServerInfo struct + FullMethod string + Server any + type UnaryServerInterceptor func(ctx context.Context, req any, info *UnaryServerInfo, handler UnaryHandler) (resp any, err error)