Versions in this module Expand all Collapse all v1 v1.2.1 Apr 7, 2017 Changes in this version + const SupportPackageIsVersion4 + const Version + var DefaultBackoffConfig = BackoffConfig + var EnableTracing = true + var ErrClientConnClosing = errors.New("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 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 + type BalancerGetOptions struct + BlockingWait bool + type CallOption interface + func FailFast(failFast bool) CallOption + func Header(md *metadata.MD) CallOption + func Peer(peer *peer.Peer) CallOption + func Trailer(md *metadata.MD) 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 + type ClientStream interface + CloseSend func() error + Header func() (metadata.MD, error) + Trailer func() metadata.MD + func NewClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, ...) (_ ClientStream, err 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 + type ConnectivityState int + const Connecting + const Idle + const Ready + const Shutdown + const TransientFailure + func (s ConnectivityState) String() string + type Decompressor interface + Do func(r io.Reader) ([]byte, error) + Type func() string + func NewGZIPDecompressor() Decompressor + type DialOption func(*dialOptions) + 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 WithBlock() DialOption + func WithCodec(c Codec) DialOption + func WithCompressor(cp Compressor) DialOption + func WithDecompressor(dc Decompressor) DialOption + func WithDialer(f func(string, time.Duration) (net.Conn, error)) DialOption + func WithInsecure() DialOption + func WithKeepaliveParams(kp keepalive.ClientParameters) DialOption + func WithMaxMsgSize(s int) DialOption + func WithPerRPCCredentials(creds credentials.PerRPCCredentials) 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 + type MethodConfig struct + MaxReqSize uint32 + MaxRespSize uint32 + Timeout time.Duration + WaitForReady bool + type MethodDesc struct + Handler methodHandler + MethodName string + type MethodInfo struct + IsClientStream bool + IsServerStream bool + Name string + 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 func(*options) + func Creds(c credentials.TransportCredentials) ServerOption + func CustomCodec(codec Codec) ServerOption + func InTapHandle(h tap.ServerInHandle) ServerOption + func MaxConcurrentStreams(n uint32) ServerOption + func MaxMsgSize(m int) ServerOption + func RPCCompressor(cp Compressor) ServerOption + func RPCDecompressor(dc Decompressor) ServerOption + func StatsHandler(h stats.Handler) ServerOption + func StreamInterceptor(i StreamServerInterceptor) ServerOption + func UnaryInterceptor(i UnaryServerInterceptor) ServerOption + func UnknownServiceHandler(streamHandler StreamHandler) ServerOption + type ServerStream interface + SendHeader func(metadata.MD) error + SetHeader func(metadata.MD) error + SetTrailer func(metadata.MD) + type ServiceConfig struct + LB Balancer + 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 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)