Skip to content

维护一些工具函数,放些不好归类的代码

License

Notifications You must be signed in to change notification settings

guonaihong/gutil

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gutil

功能包函数

time

// 输入混合时间,可正确解析,例如1h1m1s
// 输出time.Time类型 等于 time.Hour + time.Minute + time.Second
time.ParseTime("1h1m1s")

file

// 输入混合大小,可正确解析,例如1B1Kb1Mb1G
// 输出字节数
file.ParseSize("1B1Kb1Mb1G")

jwt

// 生成token
secret := "12345"
token, err := GenToken(time.Second, "test", secret)

// 解析token
j, err := ParseToken(token, secret)

About

维护一些工具函数,放些不好归类的代码

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages