feat: token store is done but not tested

This commit is contained in:
JustSong
2022-11-11 22:05:31 +08:00
parent f484e593f6
commit 4810db17d4
9 changed files with 270 additions and 16 deletions
+3 -3
View File
@@ -12,9 +12,9 @@ var (
Port = flag.Int("port", 3000, "the listening port")
PrintVersion = flag.Bool("version", false, "print version and exit")
LogDir = flag.String("log-dir", "", "specify the log directory")
//Host = flag.String("host", "localhost", "the server's ip address or domain")
//Path = flag.String("path", "", "specify a local path to public")
//VideoPath = flag.String("video", "", "specify a video folder to public")
//Host = flag.Key("host", "localhost", "the server's ip address or domain")
//Path = flag.Key("path", "", "specify a local path to public")
//VideoPath = flag.Key("video", "", "specify a video folder to public")
//NoBrowser = flag.Bool("no-browser", false, "open browser or not")
)
+5
View File
@@ -32,6 +32,11 @@ func SysLog(s string) {
_, _ = fmt.Fprintf(gin.DefaultWriter, "[SYS] %v | %s \n", t.Format("2006/01/02 - 15:04:05"), s)
}
func SysError(s string) {
t := time.Now()
_, _ = fmt.Fprintf(gin.DefaultErrorWriter, "[SYS] %v | %s \n", t.Format("2006/01/02 - 15:04:05"), s)
}
func FatalLog(v ...any) {
t := time.Now()
_, _ = fmt.Fprintf(gin.DefaultErrorWriter, "[FATAL] %v | %v \n", t.Format("2006/01/02 - 15:04:05"), v)
+8
View File
@@ -131,3 +131,11 @@ func GetUUID() string {
code = strings.Replace(code, "-", "", -1)
return code
}
func Max(a int, b int) int {
if a >= b {
return a
} else {
return b
}
}