Versions in this module Expand all Collapse all v1 v1.0.0 Jun 24, 2021 Changes in this version + const PickFirstBalancerName + const SupportPackageIsVersion3 + const SupportPackageIsVersion4 + const SupportPackageIsVersion5 + const SupportPackageIsVersion6 + 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") + func Code(err error) codes.Code + func ErrorDesc(err error) string + func Errorf(c codes.Code, format string, a ...interface{}) error + func Invoke(ctx context.Context, method string, args, reply interface{}, 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 SetTrailer(ctx context.Context, md metadata.MD) error + type Address struct + Addr string + Metadata interface{} + type BackoffConfig struct + MaxDelay time.Duration + type Balancer interface + Close func() error + Get func(ctx context.Context, opts BalancerGetOptions) (addr Address, put func(), err error) + Notify func() <-chan []Address + Start func(target string, config BalancerConfig) error + Up func(addr Address) (down func(error)) + func RoundRobin(r naming.Resolver) Balancer + type BalancerConfig struct + DialCreds credentials.TransportCredentials + Dialer func(context.Context, string) (net.Conn, error) + type BalancerGetOptions struct + BlockingWait bool + 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 Header(md *metadata.MD) CallOption + func MaxCallRecvMsgSize(bytes int) CallOption + func MaxCallSendMsgSize(bytes int) CallOption + func MaxRetryRPCBufferSize(bytes int) CallOption + func Peer(p *peer.Peer) CallOption + func PerRPCCredentials(creds credentials.PerRPCCredentials) 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 (cc *ClientConn) Close() error + func (cc *ClientConn) GetMethodConfig(method string) MethodConfig + func (cc *ClientConn) GetState() connectivity.State + func (cc *ClientConn) Invoke(ctx context.Context, method string, args, reply interface{}, ...) 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 interface{}, reply interface{}, ...) 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 interface{}) error + SendMsg func(m interface{}) error + Trailer func() metadata.MD + func NewClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, ...) (ClientStream, error) + type Codec interface + Marshal func(v interface{}) ([]byte, error) + String func() string + Unmarshal func(data []byte, v interface{}) 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 WithBalancer(b Balancer) DialOption + func WithBalancerName(balancerName string) DialOption + func WithBlock() DialOption + func WithChainStreamInterceptor(interceptors ...StreamClientInterceptor) DialOption + func WithChainUnaryInterceptor(interceptors ...UnaryClientInterceptor) DialOption + func WithChannelzParentID(id int64) 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 WithInitialConnWindowSize(s int32) DialOption + func WithInitialWindowSize(s int32) DialOption + func WithInsecure() DialOption + func WithKeepaliveParams(kp keepalive.ClientParameters) 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 WithServiceConfig(c <-chan ServiceConfig) 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 HeaderCallOption struct + HeaderAddr *metadata.MD + type MaxRecvMsgSizeCallOption struct + MaxRecvMsgSize int + type MaxRetryRPCBufferSizeCallOption struct + MaxRetryRPCBufferSize int + type MaxSendMsgSizeCallOption struct + MaxSendMsgSize int + type MethodConfig struct + MaxReqSize *int + MaxRespSize *int + Timeout *time.Duration + WaitForReady *bool + type MethodDesc struct + Handler methodHandler + MethodName string + type MethodInfo struct + IsClientStream bool + IsServerStream bool + Name string + type PeerCallOption struct + PeerAddr *peer.Peer + type PerRPCCredsCallOption struct + Creds credentials.PerRPCCredentials + type PreparedMsg struct + func (p *PreparedMsg) Encode(s Stream, msg interface{}) 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 interface{}) + 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 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 RPCCompressor(cp Compressor) ServerOption + func RPCDecompressor(dc Decompressor) ServerOption + func ReadBufferSize(s int) ServerOption + func StatsHandler(h stats.Handler) ServerOption + func StreamInterceptor(i StreamServerInterceptor) ServerOption + func UnaryInterceptor(i UnaryServerInterceptor) ServerOption + func UnknownServiceHandler(streamHandler StreamHandler) ServerOption + func WriteBufferSize(s int) ServerOption + type ServerStream interface + Context func() context.Context + RecvMsg func(m interface{}) error + SendHeader func(metadata.MD) error + SendMsg func(m interface{}) error + SetHeader func(metadata.MD) error + SetTrailer func(metadata.MD) + 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 + LB *string + Methods map[string]MethodConfig + type ServiceDesc struct + HandlerType interface{} + Metadata interface{} + Methods []MethodDesc + ServiceName string + Streams []StreamDesc + type ServiceInfo struct + Metadata interface{} + Methods []MethodInfo + type Stream interface + Context func() context.Context + RecvMsg func(m interface{}) error + SendMsg func(m interface{}) 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 interface{}, stream ServerStream) error + type StreamServerInfo struct + FullMethod string + IsClientStream bool + IsServerStream bool + type StreamServerInterceptor func(srv interface{}, ss ServerStream, info *StreamServerInfo, ...) 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 interface{}, cc *ClientConn, ...) error + type UnaryHandler func(ctx context.Context, req interface{}) (interface{}, error) + type UnaryInvoker func(ctx context.Context, method string, req, reply interface{}, cc *ClientConn, ...) error + type UnaryServerInfo struct + FullMethod string + Server interface{} + type UnaryServerInterceptor func(ctx context.Context, req interface{}, info *UnaryServerInfo, ...) (resp interface{}, err error)