Documentation ¶
Index ¶
Constants ¶
const ( TypeSynStream = 0x0001 TypeSynReply = 0x0002 TypeRstStream = 0x0003 TypeSettings = 0x0004 TypeNoop = 0x0005 TypePing = 0x0006 TypeGoaway = 0x0007 TypeHeaders = 0x0008 TypeWindowUpdate = 0x0009 )
Control frame type constants
const ( FlagFin = 0x01 FlagUnidirectional = 0x02 FlagClearPreviouslyPersistedSettings = 0x01 )
Frame flag constants
const MaxDataLength = 1<<24 - 1
MaxDataLength is the maximum number of bytes that can be stored in one frame.
Variables ¶
This section is empty.
Functions ¶
func ListenAndServe ¶
ListenAndServe creates a new Server that serves on the given address. If the handler is nil, then http.DefaultServeMux is used.
Types ¶
type ControlFrame ¶
type ControlFrame struct { Type ControlFrameType Flags FrameFlags Data []byte }
ControlFrame holds a generic control frame.
func (ControlFrame) GetData ¶
func (f ControlFrame) GetData() []byte
func (ControlFrame) GetFlags ¶
func (f ControlFrame) GetFlags() FrameFlags
type ControlFrameType ¶
type ControlFrameType uint16
func (ControlFrameType) String ¶
func (t ControlFrameType) String() string
type DataFrame ¶
type DataFrame struct { StreamID uint32 Flags FrameFlags Data []byte }
A DataFrame stores a data frame and its associated metadata.
func (DataFrame) GetFlags ¶
func (f DataFrame) GetFlags() FrameFlags
type Frame ¶
type Frame interface { io.WriterTo // WriteTo method writes the packet in SPDY format. GetFlags() FrameFlags GetData() []byte }
A Frame is the low-level construct passed over a SPDY connection.
type FrameFlags ¶
type FrameFlags uint8
type HeaderReader ¶
type HeaderReader struct {
// contains filtered or unexported fields
}
A HeaderReader reads zlib-compressed headers from discontiguous sources.
func NewHeaderReader ¶
func NewHeaderReader() (hr *HeaderReader)
NewHeaderReader creates a HeaderReader with the initial dictionary.
func (*HeaderReader) Decode ¶
func (hr *HeaderReader) Decode(data []byte) (h http.Header, err error)
Decode reads a set of headers from a block of bytes.
func (*HeaderReader) ReadHeader ¶
ReadHeader reads a set of headers from a reader.
type HeaderWriter ¶
type HeaderWriter struct {
// contains filtered or unexported fields
}
HeaderWriter will write zlib-compressed headers on different streams.
func NewHeaderWriter ¶
func NewHeaderWriter(level int) (hw *HeaderWriter)
NewHeaderWriter creates a HeaderWriter ready to compress headers.
func (*HeaderWriter) Encode ¶
func (hw *HeaderWriter) Encode(h http.Header) (data []byte)
Encode returns a compressed header block.
func (*HeaderWriter) WriteHeader ¶
WriteHeader writes a header block directly to an output.
type Server ¶
A Server handles incoming SPDY connections with HTTP handlers.
func (*Server) ListenAndServe ¶
ListenAndServe services SPDY requests on the given address. If the handler is nil, then http.DefaultServeMux is used.