pkg

package
v0.0.0-...-10cedd8 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ValidatorKey  = "ValidatorKey"
	TranslatorKey = "TranslatorKey"
)
View Source
const (
	LoginURL    = "/api/user/login"
	LogoutURL   = "/api/user/logout"
	WebShellURL = "/api/k8s/pod/webshell"
)

Variables

View Source
var (
	AdminDefaultAuth      uint = 111
	AdminDefaultAuthStr        = strconv.Itoa(int(AdminDefaultAuth))
	UserDefaultAuth       uint = 222
	UserDefaultAuthStr         = strconv.Itoa(int(UserDefaultAuth))
	UserSubDefaultAuth    uint = 2221
	UserSubDefaultAuthStr      = strconv.Itoa(int(UserSubDefaultAuth))
)
View Source
var JWTToken jwtToken

Functions

func CheckPassword

func CheckPassword(password, hashPassword string) bool

func DefaultGetValidParams

func DefaultGetValidParams(c *gin.Context, params interface{}) error

func GenSaltPassword

func GenSaltPassword(password string) (string, error)

func GetTranslation

func GetTranslation(c *gin.Context) (ut.Translator, error)

func GetValidator

func GetValidator(c *gin.Context) (*validator.Validate, error)

func RegisterJwt

func RegisterJwt(secret string)

Types

type BaseClaims

type BaseClaims struct {
	UUID        uuid.UUID
	ID          int
	Username    string
	NickName    string
	AuthorityId uint
}

type CustomClaims

type CustomClaims struct {
	BaseClaims
	jwt.StandardClaims
}

CustomClaims 自定义token中携带的信息

Directories

Path Synopsis
core

Jump to

Keyboard shortcuts

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