|
|
@@ -2,14 +2,13 @@ package downloader |
|
|
|
|
|
|
|
|
import ( |
|
|
import ( |
|
|
"fmt" |
|
|
"fmt" |
|
|
"io" |
|
|
|
|
|
|
|
|
|
|
|
lru "github.com/hashicorp/golang-lru/v2" |
|
|
lru "github.com/hashicorp/golang-lru/v2" |
|
|
"gitlink.org.cn/cloudream/common/pkgs/iterator" |
|
|
"gitlink.org.cn/cloudream/common/pkgs/iterator" |
|
|
cdssdk "gitlink.org.cn/cloudream/common/sdks/storage" |
|
|
cdssdk "gitlink.org.cn/cloudream/common/sdks/storage" |
|
|
stgglb "gitlink.org.cn/cloudream/storage/common/globals" |
|
|
stgglb "gitlink.org.cn/cloudream/storage/common/globals" |
|
|
stgmod "gitlink.org.cn/cloudream/storage/common/models" |
|
|
stgmod "gitlink.org.cn/cloudream/storage/common/models" |
|
|
coormq "gitlink.org.cn/cloudream/storage/common/pkgs/mq/coordinator" |
|
|
coormq "gitlink.org.cn/cloudream/storage/common/pkgs/mq/coordinator" |
|
|
|
|
|
"io" |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
const ( |
|
|
const ( |
|
|
@@ -71,6 +70,14 @@ func (d *Downloader) DownloadObjects(reqs []DownloadReqeust) DownloadIterator { |
|
|
return iterator.FuseError[*Downloading](fmt.Errorf("request to coordinator: %w", err)) |
|
|
return iterator.FuseError[*Downloading](fmt.Errorf("request to coordinator: %w", err)) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 测试使用:将文件pin到ipfs |
|
|
|
|
|
go func() { |
|
|
|
|
|
err := PinFileToIPFS(*objDetails) |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
print(err) |
|
|
|
|
|
} |
|
|
|
|
|
}() |
|
|
|
|
|
|
|
|
req2s := make([]downloadReqeust2, len(reqs)) |
|
|
req2s := make([]downloadReqeust2, len(reqs)) |
|
|
for i, req := range reqs { |
|
|
for i, req := range reqs { |
|
|
req2s[i] = downloadReqeust2{ |
|
|
req2s[i] = downloadReqeust2{ |
|
|
|