Documentation ¶
Overview ¶
Package spdy3 contains functionality for SPDY/3.
Index ¶
- func NextProto(s *http.Server, tlsConn *tls.Conn, handler http.Handler)
- func NextProto1(s *http.Server, tlsConn *tls.Conn, handler http.Handler)
- type Conn
- func (c *Conn) Close() (err error)
- func (c *Conn) CloseNotify() <-chan bool
- func (c *Conn) Closed() bool
- func (c *Conn) Conn() net.Conn
- func (c *Conn) Ping() (<-chan bool, error)
- func (c *Conn) Push(resource string, origin common.Stream) (common.PushStream, error)
- func (c *Conn) Request(request *http.Request, receiver common.Receiver, priority common.Priority) (common.Stream, error)
- func (c *Conn) RequestResponse(request *http.Request, receiver common.Receiver, priority common.Priority) (*http.Response, error)
- func (c *Conn) Run() error
- func (c *Conn) SetFlowControl(f common.FlowControl)
- func (c *Conn) SetReadTimeout(d time.Duration)
- func (c *Conn) SetWriteTimeout(d time.Duration)
- type DefaultFlowControl
- type PushStream
- func (s *PushStream) AddFlowControl(f common.FlowControl)
- func (p *PushStream) Close() error
- func (p *PushStream) CloseNotify() <-chan bool
- func (p *PushStream) Conn() common.Conn
- func (p *PushStream) Finish()
- func (p *PushStream) Header() http.Header
- func (p *PushStream) ReceiveFrame(frame common.Frame) error
- func (p *PushStream) Run() error
- func (p *PushStream) State() *common.StreamState
- func (p *PushStream) StreamID() common.StreamID
- func (p *PushStream) Write(inputData []byte) (int, error)
- func (p *PushStream) WriteHeader(int)
- type RequestStream
- func (s *RequestStream) AddFlowControl(f common.FlowControl)
- func (s *RequestStream) Close() error
- func (s *RequestStream) CloseNotify() <-chan bool
- func (s *RequestStream) Conn() common.Conn
- func (s *RequestStream) Header() http.Header
- func (s *RequestStream) ReceiveFrame(frame common.Frame) error
- func (s *RequestStream) Run() error
- func (s *RequestStream) State() *common.StreamState
- func (s *RequestStream) StreamID() common.StreamID
- func (s *RequestStream) Write(inputData []byte) (int, error)
- func (s *RequestStream) WriteHeader(int)
- type ResponseStream
- func (s *ResponseStream) AddFlowControl(f common.FlowControl)
- func (s *ResponseStream) Close() error
- func (s *ResponseStream) CloseNotify() <-chan bool
- func (s *ResponseStream) Conn() common.Conn
- func (s *ResponseStream) Header() http.Header
- func (s *ResponseStream) Priority() common.Priority
- func (s *ResponseStream) ReceiveFrame(frame common.Frame) error
- func (s *ResponseStream) Run() error
- func (s *ResponseStream) State() *common.StreamState
- func (s *ResponseStream) StreamID() common.StreamID
- func (s *ResponseStream) Write(inputData []byte) (int, error)
- func (s *ResponseStream) WriteHeader(code int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Conn ¶
type Conn struct { PushReceiver common.Receiver // Receiver to call for server Pushes. Subversion int // SPDY 3 subversion (eg 0 for SPDY/3, 1 for SPDY/3.1). // contains filtered or unexported fields }
Conn is a spdy.Conn implementing SPDY/3. This is used in both servers and clients, and is created with either NewServerConn, or NewClientConn.
func (*Conn) Close ¶
Close ends the connection, cleaning up relevant resources. Close can be called multiple times safely.
func (*Conn) CloseNotify ¶
func (*Conn) Push ¶
Push is used to issue a server push to the client. Note that this cannot be performed by clients.
func (*Conn) Request ¶
func (c *Conn) Request(request *http.Request, receiver common.Receiver, priority common.Priority) (common.Stream, error)
Request is used to make a client request.
func (*Conn) RequestResponse ¶
func (*Conn) SetFlowControl ¶
func (c *Conn) SetFlowControl(f common.FlowControl)
func (*Conn) SetReadTimeout ¶
func (*Conn) SetWriteTimeout ¶
type DefaultFlowControl ¶
type DefaultFlowControl uint32
func (DefaultFlowControl) InitialWindowSize ¶
func (f DefaultFlowControl) InitialWindowSize() uint32
func (DefaultFlowControl) ReceiveData ¶
type PushStream ¶
PushStream is a structure that implements the Stream and PushWriter interfaces. this is used for performing server pushes.
func NewPushStream ¶
func (*PushStream) AddFlowControl ¶
func (s *PushStream) AddFlowControl(f common.FlowControl)
AddFlowControl initialises flow control for the Stream. If the Stream is running at an older SPDY version than SPDY/3, the flow control has no effect. Multiple calls to AddFlowControl are safe.
func (*PushStream) Close ¶
func (p *PushStream) Close() error
func (*PushStream) CloseNotify ¶
func (p *PushStream) CloseNotify() <-chan bool
func (*PushStream) Conn ¶
func (p *PushStream) Conn() common.Conn
func (*PushStream) Finish ¶
func (p *PushStream) Finish()
func (*PushStream) Header ¶
func (p *PushStream) Header() http.Header
func (*PushStream) ReceiveFrame ¶
func (p *PushStream) ReceiveFrame(frame common.Frame) error
func (*PushStream) Run ¶
func (p *PushStream) Run() error
func (*PushStream) State ¶
func (p *PushStream) State() *common.StreamState
func (*PushStream) StreamID ¶
func (p *PushStream) StreamID() common.StreamID
func (*PushStream) Write ¶
func (p *PushStream) Write(inputData []byte) (int, error)
Write is used for sending data in the push.
func (*PushStream) WriteHeader ¶
func (p *PushStream) WriteHeader(int)
WriteHeader is provided to satisfy the Stream interface, but has no effect.
type RequestStream ¶
type RequestStream struct { sync.Mutex Request *http.Request Receiver common.Receiver // contains filtered or unexported fields }
RequestStream is a structure that implements the Stream and ResponseWriter interfaces. This is used for responding to client requests.
func NewRequestStream ¶
func (*RequestStream) AddFlowControl ¶
func (s *RequestStream) AddFlowControl(f common.FlowControl)
AddFlowControl initialises flow control for the Stream. If the Stream is running at an older SPDY version than SPDY/3, the flow control has no effect. Multiple calls to AddFlowControl are safe.
func (*RequestStream) Close ¶
func (s *RequestStream) Close() error
Close is used to stop the stream safely.
func (*RequestStream) CloseNotify ¶
func (s *RequestStream) CloseNotify() <-chan bool
func (*RequestStream) Conn ¶
func (s *RequestStream) Conn() common.Conn
func (*RequestStream) Header ¶
func (s *RequestStream) Header() http.Header
func (*RequestStream) ReceiveFrame ¶
func (s *RequestStream) ReceiveFrame(frame common.Frame) error
func (*RequestStream) Run ¶
func (s *RequestStream) Run() error
run is the main control path of the stream. Data is recieved, processed, and then the stream is cleaned up and closed.
func (*RequestStream) State ¶
func (s *RequestStream) State() *common.StreamState
func (*RequestStream) StreamID ¶
func (s *RequestStream) StreamID() common.StreamID
func (*RequestStream) Write ¶
func (s *RequestStream) Write(inputData []byte) (int, error)
Write is one method with which request data is sent.
func (*RequestStream) WriteHeader ¶
func (s *RequestStream) WriteHeader(int)
WriteHeader is used to set the HTTP status code.
type ResponseStream ¶
ResponseStream is a structure that implements the Stream interface. This is used for responding to client requests.
func NewResponseStream ¶
func NewResponseStream(conn *Conn, frame *frames.SYN_STREAM, output chan<- common.Frame, handler http.Handler, request *http.Request) *ResponseStream
func (*ResponseStream) AddFlowControl ¶
func (s *ResponseStream) AddFlowControl(f common.FlowControl)
AddFlowControl initialises flow control for the Stream. If the Stream is running at an older SPDY version than SPDY/3, the flow control has no effect. Multiple calls to AddFlowControl are safe.
func (*ResponseStream) Close ¶
func (s *ResponseStream) Close() error
func (*ResponseStream) CloseNotify ¶
func (s *ResponseStream) CloseNotify() <-chan bool
func (*ResponseStream) Conn ¶
func (s *ResponseStream) Conn() common.Conn
func (*ResponseStream) Header ¶
func (s *ResponseStream) Header() http.Header
func (*ResponseStream) Priority ¶
func (s *ResponseStream) Priority() common.Priority
func (*ResponseStream) ReceiveFrame ¶
func (s *ResponseStream) ReceiveFrame(frame common.Frame) error
func (*ResponseStream) Run ¶
func (s *ResponseStream) Run() error
run is the main control path of the stream. It is prepared, the registered handler is called, and then the stream is cleaned up and closed.
func (*ResponseStream) State ¶
func (s *ResponseStream) State() *common.StreamState
func (*ResponseStream) StreamID ¶
func (s *ResponseStream) StreamID() common.StreamID
func (*ResponseStream) Write ¶
func (s *ResponseStream) Write(inputData []byte) (int, error)
Write is the main method with which data is sent.
func (*ResponseStream) WriteHeader ¶
func (s *ResponseStream) WriteHeader(code int)
WriteHeader is used to set the HTTP status code.