1 Star 0 Fork 0

h79/gothird

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
baidu
config
dingtalk
feishu
fxg
gdt
notify
ocean
taobao
token
access
access.go
validate
api.go
app.go
child.go
config.go
const.go
errors.go
file.go
item.go
mgr.go
model.go
realid.go
result.go
ticket.go
time.go
token.go
token_test.go
tokenimpl.go
urlFuncs.go
weixin
.gitignore
LICENSE
Makefile
README.md
doc.go
error.md
go.mod
go.sum
version.go
克隆/下载
access.go 685 Bytes
一键复制 编辑 原始数据 按行查看 历史
package access
import (
"time"
)
// Nanosecond,纳秒
const refExpire = time.Hour * time.Duration(24*6)
// ExpireSecond
/**
* @param expire 秒
* @return Nanosecond,纳秒
*/
func ExpireSecond(expire int64) int64 {
return (time.Second * time.Duration(expire)).Nanoseconds()
}
// RefExpireSecond
/**
* @param expire 秒
* @return Nanosecond,纳秒
*/
func RefExpireSecond(expire int64) int64 {
ex := ExpireSecond(expire)
if ex == 0 {
ex = refExpire.Nanoseconds()
}
return ex
}
type Value struct {
Data string
ExpireIn int64
}
func (v Value) IsValidOf() bool {
return v.Data != ""
}
type Token interface {
GetAccessToken() Value
GetRefAccessToken() Value
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/h79/gothird.git
git@gitee.com:h79/gothird.git
h79
gothird
gothird
v1.8.66

搜索帮助

371d5123 14472233 46e8bd33 14472233