utils

package
v0.0.0-...-179e07c Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnexpectedSigningMethod = errors.New("unexpected signing method")
	ErrInvalidToken            = errors.New("invalid token")
	ErrTokenExpired            = errors.New("token has expired")
)

Functions

func DecrementURLCount

func DecrementURLCount(userID int64, db *bun.DB, ctx *gin.Context) error

func GenerateMD5Hash

func GenerateMD5Hash(url string) string

func GenerateToken

func GenerateToken(user *models.User) (string, error)

func IncrementURLCount

func IncrementURLCount(userID int64, db *bun.DB, ctx *gin.Context) error

func LoadEnv

func LoadEnv(path string)

func SetupDBConnection

func SetupDBConnection(dsn string) (*bun.DB, error)

func VerifyToken

func VerifyToken(tokenString string) (jwt.MapClaims, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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