frame

package
v0.0.0-...-29a4dac Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2015 License: Apache-2.0, Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NoError = iota
	ProtocolError
	InternalError
	FlowControlError
	StreamClosed
	FrameSizeError
	RefusedStream
	Cancel
	NoSuchError
)
View Source
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

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) Write

func (t *DebugTransport) Write(buf []byte) (int, 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 Header []byte

func (Header) Fin

func (b Header) Fin() bool

func (Header) Flags

func (b Header) Flags() flagsType

func (Header) Length

func (b Header) Length() uint16

func (Header) SetAll

func (b Header) SetAll(ftype FrameType, length int, streamId StreamId, flags flagsType) (err error)

func (Header) SetFlags

func (b Header) SetFlags(fl flagsType) (err error)

func (Header) SetLength

func (b Header) SetLength(length int) (err error)

func (Header) SetStreamId

func (b Header) SetStreamId(streamId StreamId) (err error)

func (Header) SetType

func (b Header) SetType(t FrameType) (err error)

func (Header) StreamId

func (b Header) StreamId() StreamId

func (Header) Type

func (b Header) Type() FrameType

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) Debug

func (f *RGoAway) Debug() []byte

func (*RGoAway) ErrorCode

func (f *RGoAway) ErrorCode() ErrorCode

func (*RGoAway) LastStreamId

func (f *RGoAway) LastStreamId() StreamId

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 StreamType

type StreamType uint32

StreamType is 32-bit integer specifying a stream's type

type Transport

type Transport interface {
	WriteFrame(WFrame) error
	ReadFrame() (RFrame, error)
	Close() error
}

type WFrame

type WFrame interface {
	// contains filtered or unexported methods
}

type WGoAway

type WGoAway struct {
	Header
	// contains filtered or unexported fields
}

func NewWGoAway

func NewWGoAway() (f *WGoAway)

func (*WGoAway) Set

func (f *WGoAway) Set(lastStreamId StreamId, errorCode ErrorCode, debug []byte) (err error)

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)

func (*WStreamData) Set

func (f *WStreamData) Set(streamId StreamId, data []byte, fin bool) (err error)

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)

func (*WStreamRst) Set

func (f *WStreamRst) Set(streamId StreamId, errorCode ErrorCode) (err error)

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)

func (*WStreamWndInc) Set

func (f *WStreamWndInc) Set(streamId StreamId, inc uint32) (err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL