feat: mem, local uploader

This commit is contained in:
loveuer committed 2024-04-14 21:48:27 +08:00
commit c5d0b8e45b
40 files changed
+8261

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
package tools
import (
"context"
"time"
)
func Timeout(seconds ...int) (ctx context.Context) {
var (
duration time.Duration
)
if len(seconds) > 0 && seconds[0] > 0 {
duration = time.Duration(seconds[0]) * time.Second
} else {
duration = time.Duration(30) * time.Second
}
ctx, _ = context.WithTimeout(context.Background(), duration)
return
}