Versions in this module Expand all Collapse all v0 v0.2.0 Feb 25, 2016 Changes in this version + var EnableTracing = true + var ErrClientConnClosing = errors.New("grpc: the client connection is closing") + var ErrClientConnTimeout = errors.New("grpc: timed out trying to connect") + var ErrCredentialsMisuse = errors.New(...) + var ErrNoTransportSecurity = errors.New(...) + var ErrServerStopped = errors.New("grpc: the server has been stopped") + var ErrTransientFailure = errors.New("grpc: transient connection failure") + var ErrUnspecTarget = errors.New("grpc: target is unspecified") + 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 CallOption interface + 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 + func (cc *ClientConn) State() ConnectivityState + func (cc *ClientConn) WaitForStateChange(timeout time.Duration, sourceState ConnectivityState) bool + 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 Conn struct + func NewConn(cc *ClientConn) (*Conn, error) + func (cc *Conn) Close() error + func (cc *Conn) State() ConnectivityState + func (cc *Conn) Wait(ctx context.Context) (transport.ClientTransport, error) + func (cc *Conn) WaitForStateChange(timeout time.Duration, sourceState ConnectivityState) bool + type ConnectivityState int + const Connecting + const Idle + const Ready + const Shutdown + const TransientFailure + func (s ConnectivityState) String() string + type DialOption func(*dialOptions) + func WithBlock() DialOption + func WithCodec(c Codec) DialOption + func WithDialer(f func(addr string, timeout time.Duration) (net.Conn, error)) DialOption + func WithInsecure() DialOption + func WithPerRPCCredentials(creds credentials.Credentials) DialOption + func WithTimeout(d time.Duration) DialOption + func WithTransportCredentials(creds credentials.TransportAuthenticator) DialOption + func WithUserAgent(s string) DialOption + type MethodDesc struct + Handler methodHandler + MethodName string + type Picker interface + Close func() error + Init func(cc *ClientConn) error + Pick func() (*Conn, error) + State func() ConnectivityState + WaitForStateChange func(timeout time.Duration, sourceState ConnectivityState) bool + type Server struct + func NewServer(opt ...ServerOption) *Server + func (s *Server) RegisterService(sd *ServiceDesc, ss interface{}) + func (s *Server) Serve(lis net.Listener) error + func (s *Server) Stop() + func (s *Server) TestingCloseConns() + type ServerOption func(*options) + func Creds(c credentials.Credentials) ServerOption + func CustomCodec(codec Codec) ServerOption + func MaxConcurrentStreams(n uint32) ServerOption + type ServerStream interface + SendHeader func(metadata.MD) error + SetTrailer func(metadata.MD) + type ServiceDesc struct + HandlerType interface{} + Methods []MethodDesc + ServiceName string + Streams []StreamDesc + 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