feat: direct call download api by cgo

This commit is contained in:
liwei committed 2024-11-26 23:32:54 +08:00
1 parent 85fe92a378
commit 467ada5500
22 files changed
+1040 -709

No files matched your search

+11 -5
View File
@@ -5,9 +5,9 @@ package main
import (
"embed"
"fmt"
"github.com/GopeedLab/gopeed/cmd"
"github.com/GopeedLab/gopeed/pkg/rest/model"
"github.com/GopeedLab/gopeed/pkg/api/model"
"github.com/GopeedLab/gopeed/pkg/base"
"io/fs"
"os"
"path/filepath"
@@ -42,12 +42,18 @@ func main() {
dir = filepath.Dir(exe)
}
if args.DownloadConfig == nil {
args.DownloadConfig = &base.DownloaderStoreConfig{}
}
args.DownloadConfig.Http = &base.DownloaderHttpConfig{
Host: *args.Host,
Port: *args.Port,
ApiToken: *args.ApiToken,
}
cfg := &model.StartConfig{
Network: "tcp",
Address: fmt.Sprintf("%s:%d", *args.Address, *args.Port),
Storage: model.StorageBolt,
StorageDir: filepath.Join(dir, "storage"),
ApiToken: *args.ApiToken,
DownloadConfig: args.DownloadConfig,
ProductionMode: true,
WebEnable: true,