ATutil

package
v0.0.0-...-574c6f2 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2020 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckError

func CheckError(err error) bool

func ConvAtoUi

func ConvAtoUi(str string) (ui uint)

func CreateTableIfNotExist

func CreateTableIfNotExist(db *gorm.DB, tableModels []interface{})

func GenerateEmailConfirmUrl

func GenerateEmailConfirmUrl(token string) (url string)

remind that params which store tokenstr must name token:)

func GenerateToken

func GenerateToken(email string, role string) (tokenString string, err error)

func GenerateVerifyCode

func GenerateVerifyCode(length int) (verifyString string)

func GetClaimFromToken

func GetClaimFromToken(tokenString string) (claims jwt.Claims, err error)

func GetEmailFromCookie

func GetEmailFromCookie(c *gin.Context) (email string, err error)

func GetTimeStamp

func GetTimeStamp() (t int64)

func GetTodayStartTimeStamp

func GetTodayStartTimeStamp() (timestamp int64)

func HashWithSalt

func HashWithSalt(plainText string) (HashText string)

A Hash function using salt with bcrypt libriry to hash password

func ParseTimeStampToReadableTime

func ParseTimeStampToReadableTime(timestamp int64) time.Time

func ReadSettingsFromFile

func ReadSettingsFromFile(settingFilePath string) (config ATmodels.Config)

Types

This section is empty.

Jump to

Keyboard shortcuts

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