Documentation ¶
Index ¶
- Variables
- func GetMaxFrameSize(fs uint32) uint32
- type ClientSettings
- type Connection
- func (c *Connection) Close() error
- func (c *Connection) Handshake() error
- func (c *Connection) Ping() error
- func (c *Connection) Read([]byte) (int, error)
- func (c *Connection) Stream() (net.Conn, error)
- func (c *Connection) Upgrade(host string) error
- func (c *Connection) Write([]byte) (n int, err error)
- type Stream
Constants ¶
This section is empty.
Variables ¶
var (
ErrStreamCancelled = wrapErr{"request cancelled", nil}
)
Functions ¶
func GetMaxFrameSize ¶
Types ¶
type ClientSettings ¶
type ClientSettings struct { HeaderTableSize uint32 EnablePush uint32 MaxConcurrentStreams uint32 InitialWindowSize uint32 MaxReadFrameSize uint32 MaxWriteFrameSize uint32 MaxReadHeaderListSize uint32 MaxWriteHeaderListSize uint32 // contains filtered or unexported fields }
ClientSettings is a set of http2 settings used for *clients*
func NewSettings ¶
func NewSettings() *ClientSettings
NewSettings creates a settings instance with default values
func (*ClientSettings) On ¶
func (s *ClientSettings) On(id http2.SettingID, do func(value uint32))
On registers callback on server pushed settings to client
func (*ClientSettings) UpdateFrom ¶
func (s *ClientSettings) UpdateFrom(frame *http2.SettingsFrame)
type Connection ¶
Connection holds the same purpose as golang.org/x/net/http.ClientConn, yet it couples with net/http.Transport deeply, so we are re-implementing it.
func NewConn ¶
func NewConn(c net.Conn) *Connection
func (*Connection) Close ¶
func (c *Connection) Close() error
Close on *Framer should try to gracefully shutdown the underlying connection asynchronously
func (*Connection) Handshake ¶
func (c *Connection) Handshake() error
Handshake performs PRI handshake on the underlying net.Conn
func (*Connection) Ping ¶
func (c *Connection) Ping() error
Ping could fail due to unstable connection when the server doesn't acknoledge it in 10 seconds, try not make connection state change decisions based on the Ping results. This is mostly used for debugging and keeping connection alive. Ping shouldn't be called rapidly or a large number of channels would be created.
type Stream ¶
type Stream struct { *Connection // contains filtered or unexported fields }