Versions in this module Expand all Collapse all v1 v1.0.1-GA Aug 19, 2016 v1.0.0 Jul 11, 2016 Changes in this version + const SupportPackageIsVersion3 + 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, ...) (err error) + func SendHeader(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) error + Up func(addr Address) (down func(error)) + func RoundRobin(r naming.Resolver) Balancer + type BalancerGetOptions struct + BlockingWait bool + type CallOption interface + func FailFast(failFast bool) CallOption + func Header(md *metadata.MD) CallOption + func Trailer(md *metadata.MD) CallOption + type ClientConn struct + func Dial(target string, opts ...DialOption) (*ClientConn, 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, 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 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(addr string, timeout time.Duration) (net.Conn, error)) DialOption + func WithInsecure() DialOption + func WithPerRPCCredentials(creds credentials.PerRPCCredentials) DialOption + func WithTimeout(d time.Duration) DialOption + func WithTransportCredentials(creds credentials.TransportCredentials) DialOption + func WithUserAgent(s string) DialOption + 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) 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 MaxConcurrentStreams(n uint32) ServerOption + func RPCCompressor(cp Compressor) ServerOption + func RPCDecompressor(dc Decompressor) ServerOption + func StreamInterceptor(i StreamServerInterceptor) ServerOption + func UnaryInterceptor(i UnaryServerInterceptor) ServerOption + type ServerStream interface + SendHeader func(metadata.MD) error + SetTrailer func(metadata.MD) + 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 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 UnaryHandler func(ctx context.Context, req interface{}) (interface{}, error) + type UnaryServerInfo struct + FullMethod string + Server interface{} + type UnaryServerInterceptor func(ctx context.Context, req interface{}, info *UnaryServerInfo, ...) (resp interface{}, err error)