type Pipeline(struct)
A Pipeline manages a pipelined in-order request/response sequence.
To use a Pipeline p to manage multiple clients on a connection,
each client should run:
id := p.Next() // take a number
p.StartRequest(id) // wait for turn to send request
«send request»
p.EndRequest(id) // notify Pipeline that request is sent
p.StartResponse(id) // wait for turn to read response
«read response»
p.EndResponse(id) // notify Pipeline that response is read
A pipelined server can use the same calls to ensure that
responses computed in parallel are written in the correct order.
(*T) EndRequest(id uint)
(*T) EndResponse(id uint)
(*T) Next() uint
(*T) StartRequest(id uint)
(*T) StartResponse(id uint)
type ProtocolErrorstring
A ProtocolError describes a protocol violation such
as an invalid response or a hung-up connection.
(T) Error() string
T : error
func CanonicalMIMEHeaderKey(s string) string
CanonicalMIMEHeaderKey returns the canonical format of the
MIME header key s. The canonicalization converts the first
letter and any letter following a hyphen to upper case;
the rest are converted to lowercase. For example, the
canonical key for "accept-encoding" is "Accept-Encoding".
MIME header keys are assumed to be ASCII only.
If s contains a space or invalid header field bytes, it is
returned without modifications.
func Dial(network, addr string) (*Conn, error)
Dial connects to the given address on the given network using net.Dial
and then returns a new Conn for the connection.
func NewReader(r *bufio.Reader) *Reader
NewReader returns a new Reader reading from r.
To avoid denial of service attacks, the provided bufio.Reader
should be reading from an io.LimitReader or similar Reader to bound
the size of responses.
func TrimBytes(b []byte) []byte
TrimBytes returns b without leading and trailing ASCII space.
func TrimString(s string) string
TrimString returns s without leading and trailing ASCII space.
The pages are generated with Goldsv0.1.6. (GOOS=darwin GOARCH=amd64)
Golds is a Go 101 project and developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds.