Documentation ¶
Index ¶
- Constants
- func ClearCookie(ctx *fasthttp.RequestCtx, name string)
- func ErrorJSON(ctx *fasthttp.RequestCtx, status int, message string, errors []string) error
- func ErrorResponse(ctx *fasthttp.RequestCtx, status int)
- func NewCookie(ctx *fasthttp.RequestCtx, cookie *Cookie) *fasthttp.Cookie
- func SetRootCookie(ctx *fasthttp.RequestCtx, name, value string, ttl time.Duration)
- func SuccessHTML(ctx *fasthttp.RequestCtx, data interface{})
- func SuccessJSON(ctx *fasthttp.RequestCtx, status int, message string, data interface{}, ...) error
- func SuccessXML(ctx *fasthttp.RequestCtx, contentType string, data interface{})
- type Cookie
Constants ¶
View Source
const ( // ContentTypeRss application/rss+xml ContentTypeRss = "application/rss+xml" // ContentTypeAtom application/atom+xml ContentTypeAtom = "application/atom+xml" // ContentTypeApplicationXML application/xml ContentTypeApplicationXML = "application/xml" )
Variables ¶
This section is empty.
Functions ¶
func ClearCookie ¶
func ClearCookie(ctx *fasthttp.RequestCtx, name string)
ClearCookie removes a cookie from client
func ErrorResponse ¶
func ErrorResponse(ctx *fasthttp.RequestCtx, status int)
ErrorResponse writes to ResponseWriter error with a corresponding template or serialized payload
func NewCookie ¶
func NewCookie(ctx *fasthttp.RequestCtx, cookie *Cookie) *fasthttp.Cookie
NewCookie builds a cookie instance
func SetRootCookie ¶
func SetRootCookie(ctx *fasthttp.RequestCtx, name, value string, ttl time.Duration)
SetRootCookie sets prebuilt cookie to response headers
func SuccessHTML ¶ added in v0.0.20
func SuccessHTML(ctx *fasthttp.RequestCtx, data interface{})
SuccessHTML writes []byte data to ResponseWriter setting status 200 and content type
func SuccessJSON ¶
func SuccessJSON(ctx *fasthttp.RequestCtx, status int, message string, data interface{}, count int, offset int) error
SuccessJSON todo descr
func SuccessXML ¶ added in v0.0.20
func SuccessXML(ctx *fasthttp.RequestCtx, contentType string, data interface{})
SuccessXML writes []byte data to ResponseWriter setting status 200 and content type
Types ¶
Click to show internal directories.
Click to hide internal directories.