utils

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PWD_SHA1 = iota
	PWD_SHA256
)

Variables

This section is empty.

Functions

func GenHashedPWD

func GenHashedPWD(pwd string) string

func GetDB

func GetDB(driver string, connection string) *gorm.DB

func HashAccessToken

func HashAccessToken(token string) string

func HashString

func HashString(s string) string

func VerifyHashedPasswordV3

func VerifyHashedPasswordV3(hashedPassword []byte, password string) (bool, int)

func VerifyPassword

func VerifyPassword(hashedPassword string, password string) (bool, error)

Types

type Record

type Record struct {
	Creator   string         `json:"creator" gorm:"type:varchar(255)"`
	CreatorID string         `json:"creatorid" gorm:"type:varchar(36)"`
	Updator   string         `json:"updator" gorm:"type:varchar(255)"`
	UpdatorID string         `json:"updatorid" gorm:"type:varchar(36)"`
	CreatedAt null.Time      `json:"created" gorm:"autoCreateTime"`
	UpdatedAt null.Time      `json:"updated" gorm:"autoUpdateTime"`
	DeletedAt gorm.DeletedAt `json:"-" gorm:"index"`
}

Record 数据库通用结构

Jump to

Keyboard shortcuts

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