Documentation
¶
Index ¶
- func NewResReqFastHTTP(ctx *fasthttp.RequestCtx) (ResponseFastHTTP, *RequestFastHTTP)
- func NewResReqNetHTTP(res http.ResponseWriter, req *http.Request) (ResponseNetHTTP, *RequestNetHTTP)
- func WriteSimpleJSON(w Response, status int, message string) (int, error)
- type Addr
- type Args
- type ArgsFastHTTP
- type ArgsFastHTTPMulti
- func (args ArgsFastHTTPMulti) GetBytes(key string) []byte
- func (args ArgsFastHTTPMulti) GetBytesSlice(key string) [][]byte
- func (args ArgsFastHTTPMulti) GetString(key string) string
- func (args ArgsFastHTTPMulti) GetStringSlice(key string) []string
- func (args ArgsFastHTTPMulti) GetURLValues() url.Values
- type ArgsMapStringString
- type ArgsURLValues
- type Cookie
- type MapStringString
- type Request
- type RequestFastHTTP
- func (r RequestFastHTTP) AllArgs() Args
- func (r RequestFastHTTP) Header(s string) []byte
- func (r RequestFastHTTP) HeaderString(s string) string
- func (r RequestFastHTTP) Method() []byte
- func (r RequestFastHTTP) MultipartForm() (*multipart.Form, error)
- func (r RequestFastHTTP) ParseForm() error
- func (r RequestFastHTTP) PostArgs() Args
- func (r RequestFastHTTP) PostBody() ([]byte, error)
- func (r RequestFastHTTP) QueryArgs() Args
- func (r RequestFastHTTP) RemoteAddr() net.Addr
- func (r RequestFastHTTP) RemoteAddress() string
- func (r RequestFastHTTP) RequestURI() []byte
- func (r RequestFastHTTP) RequestURIVar(s string) string
- func (r RequestFastHTTP) UserAgent() []byte
- type RequestNetHTTP
- func (r RequestNetHTTP) AllArgs() Args
- func (r RequestNetHTTP) Form() url.Values
- func (r RequestNetHTTP) Header(s string) []byte
- func (r RequestNetHTTP) HeaderString(s string) string
- func (r RequestNetHTTP) Headers() http.Header
- func (r RequestNetHTTP) Method() []byte
- func (r *RequestNetHTTP) MultipartForm() (*multipart.Form, error)
- func (r *RequestNetHTTP) ParseForm() error
- func (r RequestNetHTTP) PostArgs() Args
- func (r RequestNetHTTP) PostBody() ([]byte, error)
- func (r RequestNetHTTP) QueryArgs() Args
- func (r RequestNetHTTP) RemoteAddr() net.Addr
- func (r RequestNetHTTP) RemoteAddress() string
- func (r RequestNetHTTP) RequestURI() []byte
- func (r RequestNetHTTP) RequestURIVar(s string) string
- func (r RequestNetHTTP) UserAgent() []byte
- type Response
- type ResponseFastHTTP
- func (w ResponseFastHTTP) GetHeader(k string) []byte
- func (w ResponseFastHTTP) SetBodyBytes(body []byte) (int, error)
- func (w ResponseFastHTTP) SetBodyStream(bodyStream io.Reader, bodySize int) error
- func (w ResponseFastHTTP) SetContentType(ct string)
- func (w ResponseFastHTTP) SetCookie(cookie *Cookie)
- func (w ResponseFastHTTP) SetHeader(k, v string)
- func (w ResponseFastHTTP) SetStatusCode(code int)
- type ResponseNetHTTP
- func (w ResponseNetHTTP) GetHeader(k string) []byte
- func (w ResponseNetHTTP) SetBodyBytes(body []byte) (int, error)
- func (w ResponseNetHTTP) SetBodyStream(bodyStream io.Reader, bodySize int) error
- func (w ResponseNetHTTP) SetContentType(ct string)
- func (w ResponseNetHTTP) SetCookie(cookie *Cookie)
- func (w ResponseNetHTTP) SetHeader(k, v string)
- func (w ResponseNetHTTP) SetStatusCode(code int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewResReqFastHTTP ¶ added in v0.2.0
func NewResReqFastHTTP(ctx *fasthttp.RequestCtx) (ResponseFastHTTP, *RequestFastHTTP)
func NewResReqNetHTTP ¶ added in v0.2.0
func NewResReqNetHTTP(res http.ResponseWriter, req *http.Request) (ResponseNetHTTP, *RequestNetHTTP)
Types ¶
type ArgsFastHTTP ¶ added in v0.2.0
func NewArgsFastHTTP ¶ added in v0.2.0
func NewArgsFastHTTP(args *fasthttp.Args) ArgsFastHTTP
func (ArgsFastHTTP) GetBytes ¶ added in v0.2.0
func (a ArgsFastHTTP) GetBytes(key string) []byte
func (ArgsFastHTTP) GetBytesSlice ¶ added in v0.2.0
func (a ArgsFastHTTP) GetBytesSlice(key string) [][]byte
func (ArgsFastHTTP) GetString ¶ added in v0.2.0
func (a ArgsFastHTTP) GetString(key string) string
func (ArgsFastHTTP) GetStringSlice ¶ added in v0.2.0
func (a ArgsFastHTTP) GetStringSlice(key string) []string
func (ArgsFastHTTP) GetURLValues ¶ added in v0.2.0
func (a ArgsFastHTTP) GetURLValues() url.Values
type ArgsFastHTTPMulti ¶ added in v0.2.0
func NewArgsFastHTTPMulti ¶ added in v0.2.0
func NewArgsFastHTTPMulti(args []*fasthttp.Args) ArgsFastHTTPMulti
func (ArgsFastHTTPMulti) GetBytes ¶ added in v0.2.0
func (args ArgsFastHTTPMulti) GetBytes(key string) []byte
func (ArgsFastHTTPMulti) GetBytesSlice ¶ added in v0.2.0
func (args ArgsFastHTTPMulti) GetBytesSlice(key string) [][]byte
func (ArgsFastHTTPMulti) GetString ¶ added in v0.2.0
func (args ArgsFastHTTPMulti) GetString(key string) string
func (ArgsFastHTTPMulti) GetStringSlice ¶ added in v0.2.0
func (args ArgsFastHTTPMulti) GetStringSlice(key string) []string
func (ArgsFastHTTPMulti) GetURLValues ¶ added in v0.2.0
func (args ArgsFastHTTPMulti) GetURLValues() url.Values
type ArgsMapStringString ¶
type ArgsMapStringString struct{ Raw MapStringString }
func NewArgsMapStringString ¶
func NewArgsMapStringString(args MapStringString) ArgsMapStringString
func (ArgsMapStringString) GetBytes ¶
func (args ArgsMapStringString) GetBytes(key string) []byte
func (ArgsMapStringString) GetBytesSlice ¶
func (args ArgsMapStringString) GetBytesSlice(key string) [][]byte
func (ArgsMapStringString) GetString ¶
func (args ArgsMapStringString) GetString(key string) string
func (ArgsMapStringString) GetStringSlice ¶
func (args ArgsMapStringString) GetStringSlice(key string) []string
type ArgsURLValues ¶ added in v0.2.0
func NewArgsURLValues ¶ added in v0.2.0
func NewArgsURLValues(args url.Values) ArgsURLValues
func (ArgsURLValues) GetBytes ¶ added in v0.2.0
func (args ArgsURLValues) GetBytes(key string) []byte
func (ArgsURLValues) GetBytesSlice ¶ added in v0.2.0
func (args ArgsURLValues) GetBytesSlice(key string) [][]byte
func (ArgsURLValues) GetString ¶ added in v0.2.0
func (args ArgsURLValues) GetString(key string) string
func (ArgsURLValues) GetStringSlice ¶ added in v0.2.0
func (args ArgsURLValues) GetStringSlice(key string) []string
func (ArgsURLValues) GetURLValues ¶ added in v0.2.0
func (args ArgsURLValues) GetURLValues() url.Values
type Cookie ¶
func (*Cookie) ToFastHTTP ¶ added in v0.2.0
type MapStringString ¶
func (MapStringString) Get ¶
func (m MapStringString) Get(key string) string
func (MapStringString) GetSlice ¶
func (m MapStringString) GetSlice(key string) []string
type Request ¶
type Request interface { Header(s string) []byte HeaderString(s string) string RemoteAddr() net.Addr RemoteAddress() string UserAgent() []byte Method() []byte ParseForm() error AllArgs() Args QueryArgs() Args PostArgs() Args MultipartForm() (*multipart.Form, error) RequestURI() []byte RequestURIVar(s string) string PostBody() ([]byte, error) }
type RequestFastHTTP ¶ added in v0.2.0
type RequestFastHTTP struct { Raw *fasthttp.RequestCtx // contains filtered or unexported fields }
func NewRequestFastHTTP ¶ added in v0.2.0
func NewRequestFastHTTP(ctx *fasthttp.RequestCtx) *RequestFastHTTP
func (RequestFastHTTP) AllArgs ¶ added in v0.2.0
func (r RequestFastHTTP) AllArgs() Args
func (RequestFastHTTP) Header ¶ added in v0.2.0
func (r RequestFastHTTP) Header(s string) []byte
func (RequestFastHTTP) HeaderString ¶ added in v0.2.0
func (r RequestFastHTTP) HeaderString(s string) string
func (RequestFastHTTP) Method ¶ added in v0.2.0
func (r RequestFastHTTP) Method() []byte
func (RequestFastHTTP) MultipartForm ¶ added in v0.2.0
func (r RequestFastHTTP) MultipartForm() (*multipart.Form, error)
func (RequestFastHTTP) ParseForm ¶ added in v0.2.0
func (r RequestFastHTTP) ParseForm() error
func (RequestFastHTTP) PostArgs ¶ added in v0.2.0
func (r RequestFastHTTP) PostArgs() Args
func (RequestFastHTTP) PostBody ¶ added in v0.2.0
func (r RequestFastHTTP) PostBody() ([]byte, error)
func (RequestFastHTTP) QueryArgs ¶ added in v0.2.0
func (r RequestFastHTTP) QueryArgs() Args
func (RequestFastHTTP) RemoteAddr ¶ added in v0.2.0
func (r RequestFastHTTP) RemoteAddr() net.Addr
func (RequestFastHTTP) RemoteAddress ¶ added in v0.2.0
func (r RequestFastHTTP) RemoteAddress() string
func (RequestFastHTTP) RequestURI ¶ added in v0.2.0
func (r RequestFastHTTP) RequestURI() []byte
func (RequestFastHTTP) RequestURIVar ¶ added in v0.2.0
func (r RequestFastHTTP) RequestURIVar(s string) string
func (RequestFastHTTP) UserAgent ¶ added in v0.2.0
func (r RequestFastHTTP) UserAgent() []byte
type RequestNetHTTP ¶ added in v0.2.0
func NewRequestNetHTTP ¶ added in v0.2.0
func NewRequestNetHTTP(req *http.Request) *RequestNetHTTP
func (RequestNetHTTP) AllArgs ¶ added in v0.2.0
func (r RequestNetHTTP) AllArgs() Args
func (RequestNetHTTP) Form ¶ added in v0.2.0
func (r RequestNetHTTP) Form() url.Values
func (RequestNetHTTP) Header ¶ added in v0.2.0
func (r RequestNetHTTP) Header(s string) []byte
func (RequestNetHTTP) HeaderString ¶ added in v0.2.0
func (r RequestNetHTTP) HeaderString(s string) string
func (RequestNetHTTP) Headers ¶ added in v0.2.0
func (r RequestNetHTTP) Headers() http.Header
func (RequestNetHTTP) Method ¶ added in v0.2.0
func (r RequestNetHTTP) Method() []byte
func (*RequestNetHTTP) MultipartForm ¶ added in v0.2.0
func (r *RequestNetHTTP) MultipartForm() (*multipart.Form, error)
func (*RequestNetHTTP) ParseForm ¶ added in v0.2.0
func (r *RequestNetHTTP) ParseForm() error
func (RequestNetHTTP) PostArgs ¶ added in v0.2.0
func (r RequestNetHTTP) PostArgs() Args
func (RequestNetHTTP) PostBody ¶ added in v0.2.0
func (r RequestNetHTTP) PostBody() ([]byte, error)
func (RequestNetHTTP) QueryArgs ¶ added in v0.2.0
func (r RequestNetHTTP) QueryArgs() Args
func (RequestNetHTTP) RemoteAddr ¶ added in v0.2.0
func (r RequestNetHTTP) RemoteAddr() net.Addr
func (RequestNetHTTP) RemoteAddress ¶ added in v0.2.0
func (r RequestNetHTTP) RemoteAddress() string
func (RequestNetHTTP) RequestURI ¶ added in v0.2.0
func (r RequestNetHTTP) RequestURI() []byte
func (RequestNetHTTP) RequestURIVar ¶ added in v0.2.0
func (r RequestNetHTTP) RequestURIVar(s string) string
func (RequestNetHTTP) UserAgent ¶ added in v0.2.0
func (r RequestNetHTTP) UserAgent() []byte
type ResponseFastHTTP ¶ added in v0.2.0
type ResponseFastHTTP struct {
Raw *fasthttp.RequestCtx
}
func NewResponseFastHTTP ¶ added in v0.2.0
func NewResponseFastHTTP(ctx *fasthttp.RequestCtx) ResponseFastHTTP
func (ResponseFastHTTP) GetHeader ¶ added in v0.2.0
func (w ResponseFastHTTP) GetHeader(k string) []byte
func (ResponseFastHTTP) SetBodyBytes ¶ added in v0.2.0
func (w ResponseFastHTTP) SetBodyBytes(body []byte) (int, error)
func (ResponseFastHTTP) SetBodyStream ¶ added in v0.2.0
func (w ResponseFastHTTP) SetBodyStream(bodyStream io.Reader, bodySize int) error
SetBodyStream takes an `io.Reader` and an optional `bodySize`. If bodySize is >= 0, then bodySize bytes must be provided by bodyStream before returning io.EOF. If bodySize < 0, then bodyStream is read until io.EOF.
func (ResponseFastHTTP) SetContentType ¶ added in v0.2.0
func (w ResponseFastHTTP) SetContentType(ct string)
func (ResponseFastHTTP) SetCookie ¶ added in v0.2.0
func (w ResponseFastHTTP) SetCookie(cookie *Cookie)
func (ResponseFastHTTP) SetHeader ¶ added in v0.2.0
func (w ResponseFastHTTP) SetHeader(k, v string)
func (ResponseFastHTTP) SetStatusCode ¶ added in v0.2.0
func (w ResponseFastHTTP) SetStatusCode(code int)
type ResponseNetHTTP ¶ added in v0.2.0
type ResponseNetHTTP struct{ Raw http.ResponseWriter }
func NewResponseNetHTTP ¶ added in v0.2.0
func NewResponseNetHTTP(w http.ResponseWriter) ResponseNetHTTP
func (ResponseNetHTTP) GetHeader ¶ added in v0.2.0
func (w ResponseNetHTTP) GetHeader(k string) []byte
func (ResponseNetHTTP) SetBodyBytes ¶ added in v0.2.0
func (w ResponseNetHTTP) SetBodyBytes(body []byte) (int, error)
func (ResponseNetHTTP) SetBodyStream ¶ added in v0.2.0
func (w ResponseNetHTTP) SetBodyStream(bodyStream io.Reader, bodySize int) error
SetBodyStream takes an `io.Reader`. `bodySize` is accepted but ignored to fulfill the `Response` interface requirement.
func (ResponseNetHTTP) SetContentType ¶ added in v0.2.0
func (w ResponseNetHTTP) SetContentType(ct string)
func (ResponseNetHTTP) SetCookie ¶ added in v0.2.0
func (w ResponseNetHTTP) SetCookie(cookie *Cookie)
func (ResponseNetHTTP) SetHeader ¶ added in v0.2.0
func (w ResponseNetHTTP) SetHeader(k, v string)
func (ResponseNetHTTP) SetStatusCode ¶ added in v0.2.0
func (w ResponseNetHTTP) SetStatusCode(code int)
Click to show internal directories.
Click to hide internal directories.