tools

package
v0.0.0-...-a569139 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const TrafficKey = "X-Request-Id"

Variables

View Source
var Enforcer *casbin.Enforcer

Functions

func CasbinEnforcer

func CasbinEnforcer() (*casbin.Enforcer, error)

func DbConnect

func DbConnect() (*gorm.DB, error)

func GenerateMsgIDFromContext

func GenerateMsgIDFromContext(ctx *gin.Context) string

func GenerateNewJwtToken

func GenerateNewJwtToken(uuid uuid.UUID, username string) (string, error)

func GetDefaultLogger

func GetDefaultLogger() *slog.Logger

func RedisConnect

func RedisConnect() (*redis.Client, error)

func ValidateData

func ValidateData(data interface{}) error

Types

type Token

type Token struct {
	UUID string `json:"username"`
	jwt.RegisteredClaims
}

func ValidateAndParseJwtToken

func ValidateAndParseJwtToken(tokenString string) (*Token, error)

Jump to

Keyboard shortcuts

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