responses

package
v0.0.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearCookie

func ClearCookie(ctx *fasthttp.RequestCtx, name string)

ClearCookie removes a cookie from client

func DummyResponseHandler

func DummyResponseHandler(ctx *fasthttp.RequestCtx)

func ErrorJSON

func ErrorJSON(ctx *fasthttp.RequestCtx, status int) error

ErrorJSON todo descr

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 SuccessJSON

func SuccessJSON(ctx *fasthttp.RequestCtx, status int, data interface{}, count int, offset int) error

SuccessJSON todo descr

Types

type Cookie struct {
	Name    string
	Value   string
	Path    string
	Expires time.Time
}

Cookie simple cookie type

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL