Documentation
¶
Index ¶
- Variables
- type BlockReader
- type Client
- type CompressionMethod
- type Conn
- type ConnectionResetError
- type DataFrame
- type ErrorCode
- type FairMutex
- type Frame
- type FrameKind
- type FrameReader
- type FrameTypeMismatchError
- type Framer
- type GoAwayFrame
- type HelloFrame
- type InvalidFrameError
- type InvalidFrameLengthError
- type MakeStreamFrame
- type PingFrame
- type ResetStreamFrame
- type Server
- type Stream
- type StreamCanceledError
- type StreamHandler
- type StreamResetError
- type UnexpectedAssociatedFrameError
- type UnexpectedUnassociatedFrameError
- type UnknownFrameKindError
Constants ¶
This section is empty.
Variables ¶
View Source
var ClosedStreamErr = fmt.Errorf("stream is closed")
Functions ¶
This section is empty.
Types ¶
type BlockReader ¶
type BlockReader struct {
// contains filtered or unexported fields
}
func NewBlockReader ¶
func NewBlockReader() *BlockReader
func (*BlockReader) Close ¶
func (r *BlockReader) Close() error
func (*BlockReader) Enqueue ¶
func (r *BlockReader) Enqueue(data []byte)
type Client ¶
type Client interface {
Configure(compression CompressionMethod) error
Close() error
Write(*Frame) error
NewStream() (Stream, error)
Terminate(reason ErrorCode) error
}
func NewClient ¶
func NewClient(conn io.ReadWriteCloser) Client
type CompressionMethod ¶
type CompressionMethod int
const ( CompressionMethodNone CompressionMethod = iota CompressionMethodGzip )
func (CompressionMethod) Compress ¶
func (c CompressionMethod) Compress(buf []byte) []byte
func (CompressionMethod) Decompress ¶
func (c CompressionMethod) Decompress(data []byte) ([]byte, error)
func (CompressionMethod) String ¶
func (i CompressionMethod) String() string
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn represents a single active connection to a server
type ConnectionResetError ¶
func (*ConnectionResetError) Error ¶
func (c *ConnectionResetError) Error() string
type ErrorCode ¶
type ErrorCode uint32
const ( ErrorCodeNoError ErrorCode = 0x00 ErrorCodeProtocolError ErrorCode = 0x01 ErrorCodeInternalError ErrorCode = 0x02 ErrorCodeStreamClosed ErrorCode = 0x03 ErrorCodeFrameSizeError ErrorCode = 0x04 ErrorCodeRefusedStream ErrorCode = 0x05 ErrorCodeCancel ErrorCode = 0x06 ErrorCodeCompressionError ErrorCode = 0x07 ErrorCodeEnhanceYourCalm ErrorCode = 0x08 ErrorCodeInadequateSecurity ErrorCode = 0x09 )
type FairMutex ¶
type FairMutex struct {
// contains filtered or unexported fields
}
func NewFairMutex ¶
func NewFairMutex() *FairMutex
type Frame ¶
func (*Frame) Bytes ¶
func (f *Frame) Bytes(method CompressionMethod) []byte
func (*Frame) Decompress ¶
func (f *Frame) Decompress(method CompressionMethod) (err error)
func (*Frame) ValidateKind ¶
func (*Frame) ValidateSize ¶
type FrameReader ¶
type FrameReader struct {
// contains filtered or unexported fields
}
func NewFrameReader ¶
func NewFrameReader(r io.Reader) *FrameReader
func (*FrameReader) Read ¶
func (f *FrameReader) Read() (*Frame, error)
type FrameTypeMismatchError ¶
type FrameTypeMismatchError struct {
Expected, Received FrameKind
}
func (*FrameTypeMismatchError) Error ¶
func (f *FrameTypeMismatchError) Error() string
type GoAwayFrame ¶
func (*GoAwayFrame) FrameKind ¶
func (*GoAwayFrame) FrameKind() FrameKind
func (*GoAwayFrame) FromFrame ¶
func (g *GoAwayFrame) FromFrame(f *Frame) error
func (*GoAwayFrame) IntoFrame ¶
func (g *GoAwayFrame) IntoFrame() *Frame
type HelloFrame ¶
func (*HelloFrame) FrameKind ¶
func (*HelloFrame) FrameKind() FrameKind
func (*HelloFrame) FromFrame ¶
func (s *HelloFrame) FromFrame(f *Frame) error
func (*HelloFrame) IntoFrame ¶
func (s *HelloFrame) IntoFrame() *Frame
type InvalidFrameError ¶
type InvalidFrameError struct {
// contains filtered or unexported fields
}
func (*InvalidFrameError) Error ¶
func (i *InvalidFrameError) Error() string
type InvalidFrameLengthError ¶
type InvalidFrameLengthError struct {
// contains filtered or unexported fields
}
func (*InvalidFrameLengthError) Error ¶
func (i *InvalidFrameLengthError) Error() string
type MakeStreamFrame ¶
type MakeStreamFrame struct {
StreamID uint32
}
func (*MakeStreamFrame) FrameKind ¶
func (*MakeStreamFrame) FrameKind() FrameKind
func (*MakeStreamFrame) FromFrame ¶
func (r *MakeStreamFrame) FromFrame(f *Frame) error
func (*MakeStreamFrame) IntoFrame ¶
func (r *MakeStreamFrame) IntoFrame() *Frame
type ResetStreamFrame ¶
func (*ResetStreamFrame) FrameKind ¶
func (*ResetStreamFrame) FrameKind() FrameKind
func (*ResetStreamFrame) FromFrame ¶
func (r *ResetStreamFrame) FromFrame(f *Frame) error
func (*ResetStreamFrame) IntoFrame ¶
func (r *ResetStreamFrame) IntoFrame() *Frame
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) CancelStream ¶
func (*Server) ServiceStream ¶
type Stream ¶
type StreamCanceledError ¶
type StreamCanceledError struct {
Reason ErrorCode
}
func (*StreamCanceledError) Error ¶
func (c *StreamCanceledError) Error() string
type StreamHandler ¶
type StreamResetError ¶
type StreamResetError struct {
Reason ErrorCode
}
func (*StreamResetError) Error ¶
func (c *StreamResetError) Error() string
type UnexpectedAssociatedFrameError ¶
type UnexpectedAssociatedFrameError struct {
Kind FrameKind
}
func (*UnexpectedAssociatedFrameError) Error ¶
func (u *UnexpectedAssociatedFrameError) Error() string
type UnexpectedUnassociatedFrameError ¶
type UnexpectedUnassociatedFrameError struct {
Kind FrameKind
}
func (*UnexpectedUnassociatedFrameError) Error ¶
func (u *UnexpectedUnassociatedFrameError) Error() string
type UnknownFrameKindError ¶
type UnknownFrameKindError struct {
ReceivedKind byte
}
func (*UnknownFrameKindError) Error ¶
func (e *UnknownFrameKindError) Error() string
Click to show internal directories.
Click to hide internal directories.