utils

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

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

Go to latest
Published: Jul 23, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultTimeTemplate used build time str
	DefaultTimeTemplate = "2006-01-02 15:15:15"
)

Variables

This section is empty.

Functions

func FastBuildFileName

func FastBuildFileName(fileName string, filePostfix string) string

func FastBuildString

func FastBuildString(str ...string) string

func GenToken

func GenToken(issuer string, expireHour int, user *model.User) (string, error)

GenToken generate jwt token

func GetFileMD5

func GetFileMD5(filePath string) (string, error)

GetFileMD5 get file md5 code

func SendConfirmMessage

func SendConfirmMessage(targetMailBox string, code string) error

SendConfirmMessage send confirm code to target mailbox, this func will return err when send email exceed 5 second or connect send email web err

func SplitFilename

func SplitFilename(str string) (filename string, extend string)

splitFilename split file.filename to filename and extend name

func VerifyEmailFormat

func VerifyEmailFormat(email string) bool

Types

type MyClaims

type MyClaims struct {
	UserId   string `json:"user_id"`
	UserName string `json:"user_name"`
	Status   string `json:"status"`
	jwt.RegisteredClaims
}

func ParseToken

func ParseToken(tokenString string) (*MyClaims, error)

ParseToken parse jwt token

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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