frame

package
v0.0.0-...-1b17f28 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlagDataFin = 0x1
	FlagDataSyn = 0x2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	// contains filtered or unexported fields
}

func (*Data) Bytes

func (f *Data) Bytes() []byte

Returns the data this

func (*Data) Fin

func (f *Data) Fin() bool

func (*Data) Flags

func (f *Data) Flags() Flags

func (*Data) Length

func (f *Data) Length() uint32

func (*Data) Pack

func (f *Data) Pack(streamId StreamId, data []byte, fin bool, syn bool) (err error)

func (*Data) Reader

func (f *Data) Reader() io.Reader

func (*Data) StreamId

func (f *Data) StreamId() StreamId

func (*Data) String

func (f *Data) String() string

func (*Data) Syn

func (f *Data) Syn() bool

func (*Data) Type

func (f *Data) Type() Type

type Error

type Error struct {
	// contains filtered or unexported fields
}

func (Error) Err

func (e Error) Err() error

func (Error) Type

func (e Error) Type() ErrorType

type ErrorCode

type ErrorCode uint32

ErrorCode is a 32-bit integer indicating an error condition on a stream or session

type ErrorType

type ErrorType int
const (
	ErrorFrameSize ErrorType = iota
	ErrorProtocol
	ErrorProtocolStream
)

type Flags

type Flags uint8

Flags is a 4-bit integer containing frame-specific flag bits in the frame header

func (Flags) IsSet

func (f Flags) IsSet(g Flags) bool

func (*Flags) Set

func (f *Flags) Set(g Flags)

func (*Flags) Unset

func (f *Flags) Unset(g Flags)

type Frame

type Frame interface {
	StreamId() StreamId
	Type() Type
	Flags() Flags
	Length() uint32
	// contains filtered or unexported methods
}

type Framer

type Framer interface {
	// WriteFrame writes the given frame to the underlying transport
	WriteFrame(Frame) error

	// ReadFrame reads the next frame from the underlying transport
	ReadFrame() (Frame, error)
}

A Framer serializes/deserializer frames to/from an io.ReadWriter

func NewDebugFramer

func NewDebugFramer(wr io.Writer, fr Framer) Framer

func NewFramer

func NewFramer(r io.Reader, w io.Writer) Framer

func NewNamedDebugFramer

func NewNamedDebugFramer(name string, wr io.Writer, fr Framer) Framer

type GoAway

type GoAway struct {
	// contains filtered or unexported fields
}

func (*GoAway) Debug

func (f *GoAway) Debug() io.Reader

func (*GoAway) ErrorCode

func (f *GoAway) ErrorCode() ErrorCode

func (*GoAway) Flags

func (f *GoAway) Flags() Flags

func (*GoAway) LastStreamId

func (f *GoAway) LastStreamId() StreamId

func (*GoAway) Length

func (f *GoAway) Length() uint32

func (*GoAway) Pack

func (f *GoAway) Pack(lastStreamId StreamId, errCode ErrorCode, debug []byte) (err error)

func (*GoAway) StreamId

func (f *GoAway) StreamId() StreamId

func (*GoAway) String

func (f *GoAway) String() string

func (*GoAway) Type

func (f *GoAway) Type() Type

type RPing

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

Ping message

func (*RPing) Body

func (f *RPing) Body() []byte

type Rst

type Rst struct {
	// contains filtered or unexported fields
}

Rst is a frame sent to forcibly close a stream

func (*Rst) ErrorCode

func (f *Rst) ErrorCode() ErrorCode

func (*Rst) Flags

func (f *Rst) Flags() Flags

func (*Rst) Length

func (f *Rst) Length() uint32

func (*Rst) Pack

func (f *Rst) Pack(streamId StreamId, errorCode ErrorCode) (err error)

func (*Rst) StreamId

func (f *Rst) StreamId() StreamId

func (*Rst) String

func (f *Rst) String() string

func (*Rst) Type

func (f *Rst) Type() Type

type StreamId

type StreamId uint32

StreamId is 31-bit integer uniquely identifying a stream within a session

type Type

type Type uint8

Type is a 4-bit integer in the frame header that identifies the type of frame

const (
	TypeRst    Type = 0x0
	TypeData   Type = 0x1
	TypeWndInc Type = 0x2
	TypeGoAway Type = 0x3
)

func (Type) String

func (t Type) String() string

type Unknown

type Unknown struct {
	// contains filtered or unexported fields
}

func (*Unknown) Flags

func (f *Unknown) Flags() Flags

func (*Unknown) Length

func (f *Unknown) Length() uint32

func (*Unknown) PayloadReader

func (f *Unknown) PayloadReader() io.Reader

func (*Unknown) StreamId

func (f *Unknown) StreamId() StreamId

func (*Unknown) String

func (f *Unknown) String() string

func (*Unknown) Type

func (f *Unknown) Type() Type

type WPing

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

func NewWPing

func NewWPing() (f *WPing)

func (*WPing) Set

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

type WndInc

type WndInc struct {
	// contains filtered or unexported fields
}

Increase a stream's flow control window size

func (*WndInc) Flags

func (f *WndInc) Flags() Flags

func (*WndInc) Length

func (f *WndInc) Length() uint32

func (*WndInc) Pack

func (f *WndInc) Pack(streamId StreamId, inc uint32) (err error)

func (*WndInc) StreamId

func (f *WndInc) StreamId() StreamId

func (*WndInc) String

func (f *WndInc) String() string

func (*WndInc) Type

func (f *WndInc) Type() Type

func (*WndInc) WindowIncrement

func (f *WndInc) WindowIncrement() uint32

Jump to

Keyboard shortcuts

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