Documentation
¶
Index ¶
- Constants
- func IsPublicFrameType(ft uint32) bool
- func WithLogger(ctx context.Context, log Logger) context.Context
- type Conn
- func (c *Conn) Close() error
- func (c *Conn) ReadStream(frameType uint32, closeConnOnClose bool) (_ *StreamReader, err error)
- func (c *Conn) ReadStreamedMessage(ctx context.Context, maxSize uint32, frameType uint32) (_ []byte, err *ReadStreamError)
- func (c *Conn) SendStream(ctx context.Context, stream io.ReadCloser, frameType uint32) (err error)
- func (c *Conn) WriteStreamedMessage(ctx context.Context, buf io.Reader, frameType uint32) (err error)
- type Logger
- type ReadStreamError
- type ReadStreamErrorKind
- type StreamReader
Constants ¶
View Source
const ( StreamErrTrailer uint32 = 1 << (16 + iota) End )
Frame types used by this package. 4 MSBs are reserved for frameconn, next 4 MSB for heartbeatconn, next 4 MSB for us.
View Source
const FramePayloadShift = 19
Variables ¶
This section is empty.
Functions ¶
func IsPublicFrameType ¶
Check whether the given frame type is allowed to be used by consumers of this package. Intended for use in unit tests.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
func (*Conn) ReadStream ¶ added in v0.3.0
func (c *Conn) ReadStream(frameType uint32, closeConnOnClose bool) (_ *StreamReader, err error)
WriteStreamTo reads a stream from Conn and writes it to w.
func (*Conn) ReadStreamedMessage ¶
func (*Conn) SendStream ¶
type ReadStreamError ¶
type ReadStreamError struct {
Kind ReadStreamErrorKind
Err error
}
func (*ReadStreamError) Error ¶
func (e *ReadStreamError) Error() string
func (ReadStreamError) IsReadError ¶
func (e ReadStreamError) IsReadError() bool
func (ReadStreamError) IsWriteError ¶
func (e ReadStreamError) IsWriteError() bool
func (ReadStreamError) Temporary ¶
func (e ReadStreamError) Temporary() bool
func (ReadStreamError) Timeout ¶
func (e ReadStreamError) Timeout() bool
type ReadStreamErrorKind ¶
type ReadStreamErrorKind int
const ( ReadStreamErrorKindConn ReadStreamErrorKind = 1 + iota ReadStreamErrorKindWrite ReadStreamErrorKindSource ReadStreamErrorKindStreamErrTrailerEncoding ReadStreamErrorKindUnexpectedFrameType )
type StreamReader ¶ added in v0.3.0
type StreamReader struct {
*io.PipeReader
// contains filtered or unexported fields
}
func (*StreamReader) Close ¶ added in v0.3.0
func (r *StreamReader) Close() error
Click to show internal directories.
Click to hide internal directories.