wip: cli
This commit is contained in:
@ -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
|
||||
|
@ -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
|
||||
)
|
||||
|
Reference in New Issue
Block a user