utils

package
v0.0.0-...-50c2691 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckJWT

func CheckJWT(reciebedToken string) (string, error)

Comprobar el jwt, parsearlo, revisar la firma y la validez del token. Retorna el nombre de usuario contenido dentro del token

func ComparePasw

func ComparePasw(hashedPassword, password string) error

CompareBcryptHash compares a bcrypt hash with the given password string

func EncriptPasw

func EncriptPasw(password string) (string, error)

GenerateBcryptHash generates a bcrypt hash of the given password string

func ExtractToken

func ExtractToken(r *http.Request) (string, error)

Funcion para extraer el token de una llamada http con Authorization Bearer como header. Retorna el token aislado

func GenerateHttpError

func GenerateHttpError(w http.ResponseWriter, status int, err error, msg string) types.HttpError

To generate a new http error and a new log message

func GenerateJWT

func GenerateJWT(username string) (*string, error)

generar un nuevo jwt para la autenticacion del usuario

func JwtMidleware

func JwtMidleware(next http.Handler) http.Handler

jwt midleware to protect authentication

func SearchForNewSheets

func SearchForNewSheets()

Funcion que orquesta la busqueda, la descarga y posterior parseo y cargado en la base de datos de los archivos excel disponibles en le pagina de la POlitecnica

func WriteJsonResponse

func WriteJsonResponse(w http.ResponseWriter, status int, msg interface{})

small function to boilerplate json response

Types

This section is empty.

Jump to

Keyboard shortcuts

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