utils

package
v1.4.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SecretKey = os.Getenv("SECRET_KEY")

Functions

func EncodePassword

func EncodePassword(password []byte, salt []byte) ([]byte, error)

加盐密码哈希

func GenerateJWT

func GenerateJWT(username string) string

func GetActiveLinkKey added in v1.3.0

func GetActiveLinkKey() string

func GetConfigKey added in v1.4.2

func GetConfigKey() string

func GetDailyReportKey added in v1.3.0

func GetDailyReportKey(linkId string) string

func GetDispatchPastTaskFlagKey added in v1.3.0

func GetDispatchPastTaskFlagKey() string

func GetIdLengthConfigKey added in v1.4.2

func GetIdLengthConfigKey() string

func GetIdMaximumLengthConfigKey added in v1.4.2

func GetIdMaximumLengthConfigKey() string

func GetIdMinimumLengthConfigKey added in v1.4.2

func GetIdMinimumLengthConfigKey() string

func GetIntQueryValue

func GetIntQueryValue(c *gin.Context, key string, defaults int) int

获取指定 URL Query 参数的值(整数类型)

func GetLandingHostsConfigKey added in v1.4.2

func GetLandingHostsConfigKey() string

func GetRequestHistoryKey

func GetRequestHistoryKey(linkId string) string

func GetShortLinkKey

func GetShortLinkKey(id string) string

func GetShortLinkNotFoundConfigKey added in v1.4.2

func GetShortLinkNotFoundConfigKey() string

func GetShortLinksKey

func GetShortLinksKey() string

func GetUserKey

func GetUserKey() string

func GetUserShortLinksKey

func GetUserShortLinksKey(username string) string

func RandStringRunes

func RandStringRunes(n int) string

func RandomSalt

func RandomSalt(size int) ([]byte, error)

生成随机盐值

func ReverseAny added in v1.3.0

func ReverseAny(s interface{})

func TrimShortLinkId

func TrimShortLinkId(s string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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