This commit is contained in:
loveuer
2024-07-26 17:59:02 +08:00
parent d55c6b1932
commit eea192e385
14 changed files with 250 additions and 22 deletions

View File

@ -48,6 +48,7 @@ type config struct {
var (
Debug bool
Mode string
Cfg = &config{}
)
@ -68,10 +69,6 @@ func Init(filename string) error {
return fmt.Errorf("opt.Init: json marshal config=%s err=%v", string(bs), err)
}
if Debug {
log.SetLogLevel(log.LogLevelDebug)
}
tool.TablePrinter(Cfg)
return nil

View File

@ -1,6 +1,9 @@
package opt
import "time"
import (
"sync"
"time"
)
const (
// todo: 可以替换自己生生成的 secret
@ -40,6 +43,10 @@ const (
)
var (
Locker = &sync.Mutex{}
// todo: 颁发的 token, (cookie) 在缓存中存在的时间 (每次请求该时间也会被刷新)
TokenTimeout = time.Duration(3600*12) * time.Second
Start = time.Now()
OK bool
)