Feat: generating token and callback url for OSS muiltpart upload, support resume upload in sever-side uploading for OSS

This commit is contained in:
HFO4
2022-03-20 11:23:55 +08:00
parent 015ccd5026
commit 0df9529b32
13 changed files with 146 additions and 82 deletions

View File

@@ -74,6 +74,11 @@ func (c *ChunkGroup) Total() int64 {
return int64(c.fileInfo.Size)
}
// Num returns the total chunk number
func (c *ChunkGroup) Num() int {
return int(c.chunkNum)
}
// RangeHeader returns header value of Content-Range
func (c *ChunkGroup) RangeHeader() string {
return fmt.Sprintf("bytes %d-%d/%d", c.Start(), c.Start()+c.Length()-1, c.Total())