init: 0.0.8
feat: 实现了分片上传 todo: 1. 上传完成后 code 回显 2. 清理不用的临时 code file 3. 断点续传 4. 多 chunk 并发上传
This commit is contained in:
@ -5,6 +5,7 @@ import (
|
||||
"github.com/loveuer/nf"
|
||||
"github.com/loveuer/nf/nft/log"
|
||||
"github.com/loveuer/nf/nft/tool"
|
||||
"github.com/loveuer/ushare/internal/handler"
|
||||
"github.com/loveuer/ushare/internal/opt"
|
||||
"net"
|
||||
"net/http"
|
||||
@ -17,6 +18,10 @@ func Start(ctx context.Context) <-chan struct{} {
|
||||
return c.SendStatus(http.StatusOK)
|
||||
})
|
||||
|
||||
app.Get("/api/share/:code", handler.Fetch())
|
||||
app.Put("/api/share/:filename", handler.ShareNew()) // 获取上传 code, 分片大小
|
||||
app.Post("/api/share/:code", handler.ShareUpload()) // 分片上传接口
|
||||
|
||||
ready := make(chan struct{})
|
||||
ln, err := net.Listen("tcp", opt.Cfg.Address)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user