init: 0.0.8
feat: 实现了分片上传 todo: 1. 上传完成后 code 回显 2. 清理不用的临时 code file 3. 断点续传 4. 多 chunk 并发上传
This commit is contained in:
8
main.go
8
main.go
@ -3,7 +3,9 @@ package main
|
||||
import (
|
||||
"context"
|
||||
"flag"
|
||||
"github.com/loveuer/nf/nft/log"
|
||||
"github.com/loveuer/ushare/internal/api"
|
||||
"github.com/loveuer/ushare/internal/controller"
|
||||
"github.com/loveuer/ushare/internal/opt"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
@ -12,13 +14,19 @@ import (
|
||||
func init() {
|
||||
flag.BoolVar(&opt.Cfg.Debug, "debug", false, "debug mode")
|
||||
flag.StringVar(&opt.Cfg.Address, "address", "0.0.0.0:80", "")
|
||||
flag.StringVar(&opt.Cfg.DataPath, "data", "/data", "")
|
||||
flag.Parse()
|
||||
|
||||
if opt.Cfg.Debug {
|
||||
log.SetLogLevel(log.LogLevelDebug)
|
||||
}
|
||||
}
|
||||
|
||||
func main() {
|
||||
ctx, cancel := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM)
|
||||
defer cancel()
|
||||
|
||||
controller.MetaManager.Start(ctx)
|
||||
api.Start(ctx)
|
||||
|
||||
<-ctx.Done()
|
||||
|
Reference in New Issue
Block a user