Documentation ¶
Index ¶
- Constants
- type Conn
- func (conn *Conn) EncodeHeaders(headers []hpack.HeaderField) []byte
- func (conn *Conn) Handshake() error
- func (conn *Conn) MaxFrameSize() int
- func (conn *Conn) ReadClientPreface() (string, error)
- func (conn *Conn) ReadRequest() (*Request, error)
- func (conn *Conn) Send(payload []byte) error
- func (conn *Conn) SetMaxDynamicTableSize(v uint32)
- func (conn *Conn) WaitEvent() Event
- func (conn *Conn) WaitEventByType(evt EventType) (Event, bool)
- func (conn *Conn) WriteContinuation(streamID uint32, endHeaders bool, headerBlockFragment []byte) error
- func (conn *Conn) WriteData(streamID uint32, endStream bool, data []byte) error
- func (conn *Conn) WriteDataPadded(streamID uint32, endStream bool, data, pad []byte) error
- func (conn *Conn) WriteGoAway(maxStreamID uint32, code http.ErrCode, debugData []byte) error
- func (conn *Conn) WriteHeaders(p http.HeadersFrameParam) error
- func (conn *Conn) WritePing(ack bool, data [8]byte) error
- func (conn *Conn) WritePriority(streamID uint32, p http.PriorityParam) error
- func (conn *Conn) WritePushPromise(p http.PushPromiseParam) error
- func (conn *Conn) WriteRSTStream(streamID uint32, code http.ErrCode) error
- func (conn *Conn) WriteRawFrame(t http.FrameType, flags http.Flags, streamID uint32, payload []byte) error
- func (conn *Conn) WriteSettings(settings ...http.Setting) error
- func (conn *Conn) WriteSettingsAck() error
- func (conn *Conn) WriteSuccessResponse(streamID uint32, c *config.Config)
- func (conn *Conn) WriteWindowUpdate(streamID, incr uint32) error
- type Request
Constants ¶
const ( // DefaultWindowSize is the value of default connection window size. DefaultWindowSize = 65535 // DefaultFrameSize is the value of default frame size. DefaultFrameSize = 16384 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct { net.Conn Settings map[http.SettingID]uint32 Timeout time.Duration Verbose bool Closed bool WindowUpdate bool WindowSize map[uint32]int // contains filtered or unexported fields }
Conn represent a HTTP/2 connection. This struct contains settings information, current window size, encoder of HPACK and frame encoder.
func (*Conn) EncodeHeaders ¶
EncodeHeaders encodes header and returns encoded bytes. Conn retains encoding context and next call of EncodeHeaders will be performed using the same encoding context.
func (*Conn) MaxFrameSize ¶
MaxFrameSize returns value of Handshake performs HTTP/2 handshake with the server.
func (*Conn) ReadClientPreface ¶
func (*Conn) ReadRequest ¶
func (*Conn) SetMaxDynamicTableSize ¶
SetMaxDynamicTableSize changes the dynamic header table size to v.
func (*Conn) WaitEvent ¶
func (conn *Conn) WaitEvent() Event
WaitEvent returns a event occured on connection. This function is used to wait the next event on the connection.
func (*Conn) WaitEventByType ¶
WaitEventByType returns a specified event occured on connection. This function is used to wait the next event that has specified type on the connection.
func (*Conn) WriteContinuation ¶
func (conn *Conn) WriteContinuation(streamID uint32, endHeaders bool, headerBlockFragment []byte) error
WriteContinuation sends a CONTINUATION frame.
func (*Conn) WriteDataPadded ¶
WriteDataPadded sends a DATA frame with padding.
func (*Conn) WriteGoAway ¶
WriteGoAway sends a GOAWAY frame.
func (*Conn) WriteHeaders ¶
func (conn *Conn) WriteHeaders(p http.HeadersFrameParam) error
WriteHeaders sends a HEADERS frame.
func (*Conn) WritePriority ¶
func (conn *Conn) WritePriority(streamID uint32, p http.PriorityParam) error
WritePriority sends a PRIORITY frame.
func (*Conn) WritePushPromise ¶
func (conn *Conn) WritePushPromise(p http.PushPromiseParam) error
WritePushPromise sends a PUSH_PROMISE frame.
func (*Conn) WriteRSTStream ¶
WriteRSTStream sends a RST_STREAM frame.
func (*Conn) WriteRawFrame ¶
func (*Conn) WriteSettings ¶
WriteSettings sends a SETTINGS frame.
func (*Conn) WriteSettingsAck ¶
WriteSettingsAck sends a SETTINGS frame with ACK flag.
func (*Conn) WriteSuccessResponse ¶
func (*Conn) WriteWindowUpdate ¶
WriteWindowUpdate sends a WINDOW_UPDATE frame.