Documentation ¶
Index ¶
- Variables
- func AuthorizationHeader(ctx *fasthttp.RequestCtx) (payload []byte, exist bool)
- func BasicAuth(payload []byte) (user, pass []byte, exist bool)
- func DecompressRequestHandler(h fasthttp.RequestHandler) fasthttp.RequestHandler
- func JSON(ctx *fasthttp.RequestCtx, response interface{})
- type Response
- type Server
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ContentTypeJSON = []byte("application/json") ContentTypeText = []byte("text/plain; charset=utf-8") )
View Source
var (
CommonValidationErrors = map[string]validationErrors{
"ru": {
"ek": "Ошибка валидации для свойства `%s` с правилом `%s`",
"required": "Свойство `%s` обязательно для заполнения",
"gt": "Свойство `%s` должно содержать более `%s` элементов",
},
}
)
Functions ¶
func AuthorizationHeader ¶
func AuthorizationHeader(ctx *fasthttp.RequestCtx) (payload []byte, exist bool)
func BasicAuth ¶
BasicAuth returns the username and password provided in the request's Authorization header, if the request uses HTTP Basic Authentication. See RFC 2617, Section 2.
func DecompressRequestHandler ¶
func DecompressRequestHandler(h fasthttp.RequestHandler) fasthttp.RequestHandler
func JSON ¶
func JSON(ctx *fasthttp.RequestCtx, response interface{})
JSON makes common response in json.
Types ¶
type Response ¶
type Response struct { Error *errs.ErrorObject `json:"error,omitempty"` Data interface{} `json:"data,omitempty"` }
Click to show internal directories.
Click to hide internal directories.