Documentation ¶
Overview ¶
* Author MALDRU * Email andres.latorre@ing-developers.com * Copyright (c) 2019. All rights reserved.
* Author MALDRU * Email andres.latorre@ing-developers.com * Copyright (c) 2019. All rights reserved.
* Author MALDRU * Email andres.latorre@ing-developers.com * Copyright (c) 2019. All rights reserved.
* Author MALDRU * Email andres.latorre@ing-developers.com * Copyright (c) 2019. All rights reserved. * Para usar la herramienta obtener la dependencia github.com/dgrijalva/jwt-go
* Author MALDRU * Email andres.latorre@ing-developers.com * Copyright (c) 2019. All rights reserved.
Index ¶
- func CleanCache(w http.ResponseWriter)
- func Decode(ruta string, modelo interface{}) error
- func DecodeBody(r *http.Request, modelo interface{}) error
- func DecodeParams(r *http.Request, modelo interface{}) error
- func EsNumerico(valor string) bool
- func RenderTemplate(w http.ResponseWriter, data interface{}, multiples bool, layout string, ...)
- func Responder(w http.ResponseWriter, estado int, error interface{}, mensaje string, ...)
- func ValidarLongitud(valor string, min, max int) bool
- func ValidarValoresPosibles(valor string, posibles ...string) bool
- type Claim
- type JWT
- type UploadSetup
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanCache ¶
func CleanCache(w http.ResponseWriter)
CleanCache Establece encabezados para evitar el cache en el navegador
func DecodeBody ¶
DecodeRequest mapea una peticion con body json a un struct
func DecodeParams ¶
DecodeRequest mapea una peticion con body json a un struct
func RenderTemplate ¶
func RenderTemplate(w http.ResponseWriter, data interface{}, multiples bool, layout string, tpl ...string)
RenderTemplate renderiza template
func Responder ¶
func Responder(w http.ResponseWriter, estado int, error interface{}, mensaje string, datos interface{}, esJSON bool, debug bool)
Responder escribe en el response la respuesta establecida
func ValidarLongitud ¶
ValidarLongitud valida la longitud de un string en un rango especificado, si max es 0 no se toma en cuenta el maximo
func ValidarValoresPosibles ¶
ValidarValoresPosibles valida que el valor este entre algun posible valor
Types ¶
type Claim ¶
type Claim struct { Sesion interface{} jwt.StandardClaims }
Claim modelo para las peticiones