util

package
v0.0.0-...-fb81480 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateHash

func GenerateHash(password string, salt string) string

func GenerateToken

func GenerateToken(user *model.User, tokenTTL time.Duration) (string, error)

func NewErrorResponse

func NewErrorResponse(ctx *gin.Context, logger *slog.Logger, statusCode int, message string)

func ParseToken

func ParseToken(access string) (int, error)

Types

type TokenClaims

type TokenClaims struct {
	jwt.StandardClaims
	UserId int `json:"user_id"`
}

Jump to

Keyboard shortcuts

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