Documentation ¶
Index ¶
- Constants
- Variables
- func GenSnowflakeID() int64
- func GetDeployPath(myPath string) string
- func GetRootPath(myPath string) string
- func GetToken(CreateAt time.Time, UserID int64) (string, error)
- func Init() error
- func IsOneOf(obj string, list ...string) bool
- func Shuffle(list interface{}) []interface{}
- func StringToInt64(str string) int64
- type CustomClaims
Constants ¶
View Source
const ( TokenIssuer = "StarkSim" SecretKey = "42wqTE23123wffLU94342wgadgFs" AccessTokenExp = time.Hour * 2 RefreshTokenExp = time.Hour * 12 JWTHeader = "bearer " CookieName = "Authorization" )
Variables ¶
View Source
var ZeroTime = time.Time{}
Functions ¶
func GenSnowflakeID ¶
func GenSnowflakeID() int64
func GetDeployPath ¶
GetDeployPath 获取启动项目的当前目录, 并和 myPath 拼接起来
func StringToInt64 ¶
Types ¶
type CustomClaims ¶
type CustomClaims struct { UserID int64 jwt.RegisteredClaims }
Click to show internal directories.
Click to hide internal directories.