Versions in this module Expand all Collapse all v0 v0.3.0 Apr 26, 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 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, error) + func (cc *ClientConn) WaitForStateChange(ctx context.Context, sourceState ConnectivityState) (ConnectivityState, 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 Conn struct + func NewConn(cc *ClientConn) (*Conn, error) + func (cc *Conn) Close() error + func (cc *Conn) NotifyReset() + func (cc *Conn) State() ConnectivityState + func (cc *Conn) Wait(ctx context.Context) (transport.ClientTransport, error) + func (cc *Conn) WaitForStateChange(ctx context.Context, sourceState ConnectivityState) (ConnectivityState, error) + 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 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.Credentials) DialOption + func WithPicker(p Picker) 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(ctx context.Context) (transport.ClientTransport, error) + PickAddr func() (string, error) + State func() (ConnectivityState, error) + WaitForStateChange func(ctx context.Context, sourceState ConnectivityState) (ConnectivityState, error) + func NewUnicastNamingPicker(r naming.Resolver) Picker + 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) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (s *Server) Stop() + func (s *Server) TestingCloseConns() + func (s *Server) TestingUseHandlerImpl() + type ServerOption func(*options) + func Creds(c credentials.Credentials) ServerOption + func CustomCodec(codec Codec) ServerOption + func MaxConcurrentStreams(n uint32) ServerOption + func RPCCompressor(cp Compressor) ServerOption + func RPCDecompressor(dc Decompressor) 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