mirror of
https://github.com/AlistGo/alist.git
synced 2025-04-23 05:44:04 +08:00

* fix(net): goroutine logic bug (AlistGo/alist#7215) * Fix goroutine logic bug * Fix bug --------- Co-authored-by: hpy hs <hshpy.pengyu@gmail.com> * perf(net): sequential and dynamic concurrency * fix(net): incorrect error return * feat(alias): add `DownloadConcurrency` and `DownloadPartSize` option * feat(net): add `ConcurrencyLimit` * pref(net): create `chunk` on demand * refactor * refactor * fix(net): `r.Closers.Add` has no effect * refactor --------- Co-authored-by: hpy hs <hshpy.pengyu@gmail.com>
36 lines
1007 B
Go
36 lines
1007 B
Go
package alias
|
|
|
|
import (
|
|
"github.com/alist-org/alist/v3/internal/driver"
|
|
"github.com/alist-org/alist/v3/internal/op"
|
|
)
|
|
|
|
type Addition struct {
|
|
// Usually one of two
|
|
// driver.RootPath
|
|
// define other
|
|
Paths string `json:"paths" required:"true" type:"text"`
|
|
ProtectSameName bool `json:"protect_same_name" default:"true" required:"false" help:"Protects same-name files from Delete or Rename"`
|
|
DownloadConcurrency int `json:"download_concurrency" default:"0" required:"false" type:"number" help:"Need to enable proxy"`
|
|
DownloadPartSize int `json:"download_part_size" default:"0" type:"number" required:"false" help:"Need to enable proxy. Unit: KB"`
|
|
}
|
|
|
|
var config = driver.Config{
|
|
Name: "Alias",
|
|
LocalSort: true,
|
|
NoCache: true,
|
|
NoUpload: true,
|
|
DefaultRoot: "/",
|
|
ProxyRangeOption: true,
|
|
}
|
|
|
|
func init() {
|
|
op.RegisterDriver(func() driver.Driver {
|
|
return &Alias{
|
|
Addition: Addition{
|
|
ProtectSameName: true,
|
|
},
|
|
}
|
|
})
|
|
}
|