Versions in this module Expand all Collapse all v1 v1.0.9 Apr 20, 2018 Changes in this version + var ErrConnClosing = connectionErrorf(true, nil, "transport is closing") + var ErrIllegalHeaderWrite = errors.New("transport: the stream is done or WriteHeader was already called") + var ErrStreamDrain = streamErrorf(codes.Unavailable, "the server stops accepting new RPCs") + type CallHdr struct + Creds credentials.PerRPCCredentials + Flush bool + Host string + Method string + RecvCompress string + SendCompress string + type ClientTransport interface + Close func() error + CloseStream func(stream *Stream, err error) + Error func() <-chan struct{} + GetGoAwayReason func() GoAwayReason + GoAway func() <-chan struct{} + GracefulClose func() error + NewStream func(ctx context.Context, callHdr *CallHdr) (*Stream, error) + Write func(s *Stream, data []byte, opts *Options) error + func NewClientTransport(ctx context.Context, target TargetInfo, opts ConnectOptions) (ClientTransport, error) + type ConnectOptions struct + Authority string + Dialer func(context.Context, string) (net.Conn, error) + FailOnNonTempDialError bool + InitialConnWindowSize int32 + InitialWindowSize int32 + KeepaliveParams keepalive.ClientParameters + PerRPCCredentials []credentials.PerRPCCredentials + StatsHandler stats.Handler + TransportCredentials credentials.TransportCredentials + UserAgent string + type ConnectionError struct + Desc string + func (e ConnectionError) Error() string + func (e ConnectionError) Origin() error + func (e ConnectionError) Temporary() bool + type GoAwayReason uint8 + const Invalid + const NoReason + const TooManyPings + type Options struct + Delay bool + Last bool + type ServerConfig struct + AuthInfo credentials.AuthInfo + InTapHandle tap.ServerInHandle + InitialConnWindowSize int32 + InitialWindowSize int32 + KeepaliveParams keepalive.ServerParameters + KeepalivePolicy keepalive.EnforcementPolicy + MaxStreams uint32 + StatsHandler stats.Handler + type ServerTransport interface + Close func() error + Drain func() + HandleStreams func(func(*Stream), func(context.Context, string) context.Context) + RemoteAddr func() net.Addr + Write func(s *Stream, data []byte, opts *Options) error + WriteHeader func(s *Stream, md metadata.MD) error + WriteStatus func(s *Stream, st *status.Status) error + func NewServerHandlerTransport(w http.ResponseWriter, r *http.Request) (ServerTransport, error) + func NewServerTransport(protocol string, conn net.Conn, config *ServerConfig) (ServerTransport, error) + type Stream struct + func StreamFromContext(ctx context.Context) (s *Stream, ok bool) + func (s *Stream) BytesReceived() bool + func (s *Stream) BytesSent() bool + func (s *Stream) Context() context.Context + func (s *Stream) Done() <-chan struct{} + func (s *Stream) GoAway() <-chan struct{} + func (s *Stream) GoString() string + func (s *Stream) Header() (metadata.MD, error) + func (s *Stream) Method() string + func (s *Stream) Read(p []byte) (n int, err error) + func (s *Stream) RecvCompress() string + func (s *Stream) ServerTransport() ServerTransport + func (s *Stream) SetHeader(md metadata.MD) error + func (s *Stream) SetSendCompress(str string) + func (s *Stream) SetTrailer(md metadata.MD) error + func (s *Stream) Status() *status.Status + func (s *Stream) Trailer() metadata.MD + type StreamError struct + Code codes.Code + Desc string + func ContextErr(err error) StreamError + func (e StreamError) Error() string + type TargetInfo struct + Addr string + Metadata interface{}