Documentation ¶
Index ¶
- Constants
- type BasicTransport
- type DebugTransport
- type ErrorCode
- type FrameType
- type FramingError
- type Header
- func (b Header) Fin() bool
- func (b Header) Flags() flagsType
- func (b Header) Length() uint16
- func (b Header) SetAll(ftype FrameType, length int, streamId StreamId, flags flagsType) (err error)
- func (b Header) SetFlags(fl flagsType) (err error)
- func (b Header) SetLength(length int) (err error)
- func (b Header) SetStreamId(streamId StreamId) (err error)
- func (b Header) SetType(t FrameType) (err error)
- func (b Header) StreamId() StreamId
- func (b Header) Type() FrameType
- type RFrame
- type RGoAway
- type RStreamData
- type RStreamRst
- type RStreamSyn
- type RStreamWndInc
- type StreamId
- type StreamPriority
- type StreamType
- type Transport
- type WFrame
- type WGoAway
- type WStreamData
- type WStreamRst
- type WStreamSyn
- type WStreamWndInc
Constants ¶
const ( NoError = iota ProtocolError InternalError FlowControlError StreamClosed FrameSizeError RefusedStream Cancel NoSuchError )
const ( TypeStreamSyn = 0x1 TypeStreamRst = 0x2 TypeStreamData = 0x3 TypeStreamWndInc = 0x4 TypeStreamPri = 0x5 TypeGoAway = 0x6 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasicTransport ¶
type BasicTransport struct { io.ReadWriteCloser Header RStreamSyn RStreamRst RStreamData RStreamWndInc RGoAway }
BasicTransport can serialize/deserialize frames on an underlying net.Conn to implement the muxado protocol.
func NewBasicTransport ¶
func NewBasicTransport(rwc io.ReadWriteCloser) *BasicTransport
func (*BasicTransport) ReadFrame ¶
func (t *BasicTransport) ReadFrame() (f RFrame, err error)
ReadFrame reads the next frame from the underlying transport
func (*BasicTransport) WriteFrame ¶
func (t *BasicTransport) WriteFrame(frame WFrame) (err error)
WriteFrame writes the given frame to the underlying transport
type DebugTransport ¶
type DebugTransport struct { *BasicTransport // contains filtered or unexported fields }
func NewDebugTransport ¶
func NewDebugTransport(rwc io.ReadWriteCloser, prefix string) *DebugTransport
func (*DebugTransport) ReadFrame ¶
func (t *DebugTransport) ReadFrame() (f RFrame, err error)
func (*DebugTransport) WriteFrame ¶
func (t *DebugTransport) WriteFrame(frame WFrame) (err error)
type ErrorCode ¶
type ErrorCode uint32
ErrorCode is a 32-bit integer indicating a error condition included in rst/goaway frames
type FrameType ¶
type FrameType uint8
a frameType is a 5-bit integer in the frame header that identifies the type of frame
type FramingError ¶
type FramingError struct {
// contains filtered or unexported fields
}
type RFrame ¶
type RFrame interface { StreamId() StreamId Type() FrameType // contains filtered or unexported methods }
A frame can read and write itself to a serializer/deserializer
type RGoAway ¶
type RGoAway struct { Header // contains filtered or unexported fields }
Instruct the remote side not to initiate new streams
func (*RGoAway) LastStreamId ¶
type RStreamData ¶
type RStreamData struct { Header // contains filtered or unexported fields }
func (*RStreamData) Reader ¶
func (f *RStreamData) Reader() io.Reader
type RStreamRst ¶
type RStreamRst struct { Header // contains filtered or unexported fields }
RsStreamRst is a STREAM_RST frame that is read from a transport
func (*RStreamRst) ErrorCode ¶
func (f *RStreamRst) ErrorCode() ErrorCode
type RStreamSyn ¶
type RStreamSyn struct { Header // contains filtered or unexported fields }
func (*RStreamSyn) StreamPriority ¶
func (f *RStreamSyn) StreamPriority() StreamPriority
StreamPriority returns the stream priority set on this frame
func (*RStreamSyn) StreamType ¶
func (f *RStreamSyn) StreamType() StreamType
StreamType returns the stream's defined type as specified by the remote endpoint
type RStreamWndInc ¶
type RStreamWndInc struct { Header // contains filtered or unexported fields }
Increase a stream's flow control window size
func (*RStreamWndInc) WindowIncrement ¶
func (f *RStreamWndInc) WindowIncrement() (inc uint32)
type StreamId ¶
type StreamId uint32
StreamId is 31-bit integer uniquely identifying a stream within a session
type StreamPriority ¶
type StreamPriority uint32
StreamPriority is 31-bit integer specifying a stream's priority
type WGoAway ¶
type WGoAway struct { Header // contains filtered or unexported fields }
func NewWGoAway ¶
func NewWGoAway() (f *WGoAway)
type WStreamData ¶
type WStreamData struct { Header // contains filtered or unexported fields }
WStreamData is a StreamData frame that you can write It delivers opaque data on a stream to the application layer
func NewWStreamData ¶
func NewWStreamData() (f *WStreamData)
type WStreamRst ¶
type WStreamRst struct { Header // contains filtered or unexported fields }
WStreamRst is a STREAM_RST frame that can be written, it terminate a stream ungracefully
func NewWStreamRst ¶
func NewWStreamRst() (f *WStreamRst)
type WStreamSyn ¶
type WStreamSyn struct { Header // contains filtered or unexported fields }
func NewWStreamSyn ¶
func NewWStreamSyn() (f *WStreamSyn)
func (*WStreamSyn) Set ¶
func (f *WStreamSyn) Set(streamId StreamId, streamPriority StreamPriority, streamType StreamType, fin bool) (err error)
type WStreamWndInc ¶
type WStreamWndInc struct { Header // contains filtered or unexported fields }
func NewWStreamWndInc ¶
func NewWStreamWndInc() (f *WStreamWndInc)