Documentation ¶
Index ¶
- Variables
- func BytesToString(b []byte) string
- func DeleteFastHTTPRequestHopHeaders(req *fasthttp.Request)
- func DeleteFastHTTPResponseHopHeaders(res *fasthttp.Response)
- func DeleteHopHeaders(h http.Header)
- func FastHTTPHasHeaderValue(s, value []byte) bool
- func FastHTTPHijackHandler(bufferedEgress *BufferedReadWriteCloser, buffer *bufio.Reader) func(net.Conn)
- func FastHTTPRequestUpgradeType(req *fasthttp.Request) string
- func FastHTTPResponseUpgradeType(res *fasthttp.Response) string
- func FastHTTPUpgradeCopier(ctx *fasthttp.RequestCtx, reqUpType string, ...)
- func FastHTTPUpgradeRespond(ctx *fasthttp.RequestCtx, reqUpType string, ...)
- func Respond(w http.ResponseWriter, req *http.Request, res *http.Response)
- func UpgradeType(h http.Header) string
- type BufferedReadWriteCloser
- type Flusher
Constants ¶
This section is empty.
Variables ¶
View Source
var (
EventStreamBytes = []byte("text/event-stream")
)
View Source
var HopHeaders = []string{
"Connection",
"Upgrade",
"Proxy-Connection",
"Keep-Alive",
"Proxy-Authenticate",
"Proxy-Authorization",
"Te",
"Trailer",
"Transfer-Encoding",
"Server",
}
Functions ¶
func BytesToString ¶
func DeleteHopHeaders ¶
DeleteHopHeaders deletes the given headers from the given request.
func FastHTTPHasHeaderValue ¶
func FastHTTPHijackHandler ¶
func FastHTTPHijackHandler(bufferedEgress *BufferedReadWriteCloser, buffer *bufio.Reader) func(net.Conn)
func FastHTTPUpgradeCopier ¶
func FastHTTPUpgradeRespond ¶
func Respond ¶
Respond responds to the given request using the given response and the http.ResponseWriter.
It deletes Hop Headers, and handles streaming responses.
func UpgradeType ¶
UpgradeType returns the upgrade type (if any) for the given headers.
Types ¶
type BufferedReadWriteCloser ¶
type BufferedReadWriteCloser struct { io.WriteCloser // contains filtered or unexported fields }
func NewBufferedReadWriteCloser ¶
func NewBufferedReadWriteCloser(rwc io.ReadWriteCloser) *BufferedReadWriteCloser
func (*BufferedReadWriteCloser) Buffer ¶
func (b *BufferedReadWriteCloser) Buffer() *bufio.Reader
func (*BufferedReadWriteCloser) Close ¶
func (b *BufferedReadWriteCloser) Close() error
type Flusher ¶
type Flusher struct {
// contains filtered or unexported fields
}
Flusher is a wrapper around an io.Writer that also implements the http.Flusher interface (encapsulated by the f interface) and its Write method calls the underlying Flush method after every write.
func NewFlusher ¶
func NewFlusher(w http.ResponseWriter) (*Flusher, bool)
NewFlusher returns a new flusher that wraps the given http.ResponseWriter.
Click to show internal directories.
Click to hide internal directories.