utils

package
v0.0.0-...-4f9ff06 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2022 License: BSD-2-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorAuthHeaderNotFound = "X-Authorization not found in headers"
	ErrorInvalidToken       = "invalid token"
	ErrorUnauthorized       = "Unauthorized"
	ErrorDatabaseConn       = "ERROR DATABASE -> Connection:"
	ErrorDatabaseMigrate    = "ERROR DATABASE MIGRATE -> Migrations:"
	ErrorNonImplemented     = "non implemented error"
)

Variables

This section is empty.

Functions

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

func GenerateHashPassword

func GenerateHashPassword(password string) (string, error)

func GenerateJWT

func GenerateJWT(secret string, userId int64) (string, error)

func GenerateNodeID

func GenerateNodeID() int64

func GeneratedID

func GeneratedID() int64

func LogMiddleware

func LogMiddleware(logger logrus.FieldLogger) gin.HandlerFunc

Logger is the logrus logger handler

func ValidateJWT

func ValidateJWT(token, secret string) (string, error)

Types

type Logger

type Logger struct {
}

func (*Logger) Debug

func (l *Logger) Debug(i ...interface{})

func (*Logger) Error

func (l *Logger) Error(i ...interface{})

func (*Logger) Info

func (l *Logger) Info(i ...interface{})

type LoggerInterface

type LoggerInterface interface {
	Debug(i ...interface{})
	Info(i ...interface{})
	Error(i ...interface{})
}

Jump to

Keyboard shortcuts

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