var ErrPersistEOF … var ErrClosed … var ErrPipeline … var errClosed … type ServerConn … // NewServerConn is an artifact of Go's early HTTP implementation. // It is low-level, old, and unused by Go's current HTTP stack. // We should have deleted it before Go 1. // // Deprecated: Use the Server in package [net/http] instead. func NewServerConn(c net.Conn, r *bufio.Reader) *ServerConn { … } // Hijack detaches the [ServerConn] and returns the underlying connection as well // as the read-side bufio which may have some left over data. Hijack may be // called before Read has signaled the end of the keep-alive logic. The user // should not call Hijack while [ServerConn.Read] or [ServerConn.Write] is in progress. func (sc *ServerConn) Hijack() (net.Conn, *bufio.Reader) { … } // Close calls [ServerConn.Hijack] and then also closes the underlying connection. func (sc *ServerConn) Close() error { … } // Read returns the next request on the wire. An [ErrPersistEOF] is returned if // it is gracefully determined that there are no more requests (e.g. after the // first request on an HTTP/1.0 connection, or after a Connection:close on a // HTTP/1.1 connection). func (sc *ServerConn) Read() (*http.Request, error) { … } // Pending returns the number of unanswered requests // that have been received on the connection. func (sc *ServerConn) Pending() int { … } // Write writes resp in response to req. To close the connection gracefully, set the // Response.Close field to true. Write should be considered operational until // it returns an error, regardless of any errors returned on the [ServerConn.Read] side. func (sc *ServerConn) Write(req *http.Request, resp *http.Response) error { … } type ClientConn … // NewClientConn is an artifact of Go's early HTTP implementation. // It is low-level, old, and unused by Go's current HTTP stack. // We should have deleted it before Go 1. // // Deprecated: Use the Client or Transport in package [net/http] instead. func NewClientConn(c net.Conn, r *bufio.Reader) *ClientConn { … } // NewProxyClientConn is an artifact of Go's early HTTP implementation. // It is low-level, old, and unused by Go's current HTTP stack. // We should have deleted it before Go 1. // // Deprecated: Use the Client or Transport in package [net/http] instead. func NewProxyClientConn(c net.Conn, r *bufio.Reader) *ClientConn { … } // Hijack detaches the [ClientConn] and returns the underlying connection as well // as the read-side bufio which may have some left over data. Hijack may be // called before the user or Read have signaled the end of the keep-alive // logic. The user should not call Hijack while [ClientConn.Read] or ClientConn.Write is in progress. func (cc *ClientConn) Hijack() (c net.Conn, r *bufio.Reader) { … } // Close calls [ClientConn.Hijack] and then also closes the underlying connection. func (cc *ClientConn) Close() error { … } // Write writes a request. An [ErrPersistEOF] error is returned if the connection // has been closed in an HTTP keep-alive sense. If req.Close equals true, the // keep-alive connection is logically closed after this request and the opposing // server is informed. An ErrUnexpectedEOF indicates the remote closed the // underlying TCP connection, which is usually considered as graceful close. func (cc *ClientConn) Write(req *http.Request) error { … } // Pending returns the number of unanswered requests // that have been sent on the connection. func (cc *ClientConn) Pending() int { … } // Read reads the next response from the wire. A valid response might be // returned together with an [ErrPersistEOF], which means that the remote // requested that this be the last request serviced. Read can be called // concurrently with [ClientConn.Write], but not with another Read. func (cc *ClientConn) Read(req *http.Request) (resp *http.Response, err error) { … } // Do is convenience method that writes a request and reads a response. func (cc *ClientConn) Do(req *http.Request) (*http.Response, error) { … }