chore: go fmt

pull/1604/head
Noah Hsu 2022-08-03 14:26:59 +08:00
parent 721f18a7f4
commit b51e664543
41 changed files with 100 additions and 74 deletions

View File

@ -7,9 +7,8 @@ import (
"path/filepath" "path/filepath"
"strings" "strings"
"github.com/alist-org/alist/v3/internal/errs"
"github.com/alist-org/alist/v3/internal/driver" "github.com/alist-org/alist/v3/internal/driver"
"github.com/alist-org/alist/v3/internal/errs"
"github.com/alist-org/alist/v3/internal/model" "github.com/alist-org/alist/v3/internal/model"
"github.com/alist-org/alist/v3/internal/operations" "github.com/alist-org/alist/v3/internal/operations"
"github.com/alist-org/alist/v3/pkg/utils" "github.com/alist-org/alist/v3/pkg/utils"

2
go.mod
View File

@ -14,6 +14,7 @@ require (
github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible
github.com/pkg/errors v0.9.1 github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.8.1 github.com/sirupsen/logrus v1.8.1
github.com/winfsp/cgofuse v1.5.0
gorm.io/driver/mysql v1.3.4 gorm.io/driver/mysql v1.3.4
gorm.io/driver/postgres v1.3.7 gorm.io/driver/postgres v1.3.7
gorm.io/driver/sqlite v1.3.4 gorm.io/driver/sqlite v1.3.4
@ -46,7 +47,6 @@ require (
github.com/modern-go/reflect2 v1.0.2 // indirect github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pelletier/go-toml/v2 v2.0.1 // indirect github.com/pelletier/go-toml/v2 v2.0.1 // indirect
github.com/ugorji/go/codec v1.2.7 // indirect github.com/ugorji/go/codec v1.2.7 // indirect
github.com/winfsp/cgofuse v1.5.0 // indirect
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d // indirect golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d // indirect
golang.org/x/net v0.0.0-20220531201128-c960675eff93 // indirect golang.org/x/net v0.0.0-20220531201128-c960675eff93 // indirect
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect

2
go.sum
View File

@ -1,8 +1,6 @@
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc=
github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
github.com/Xhofe/go-cache v0.0.0-20220613125742-9554c28ee448 h1:0TL8OCXaQD1YhG0D3YAfDcm/n4QRo4rCGiU0Pa5nQC4=
github.com/Xhofe/go-cache v0.0.0-20220613125742-9554c28ee448/go.mod h1:sSBbaOg90XwWKtpT56kVujF0bIeVITnPlssLclogS04=
github.com/Xhofe/go-cache v0.0.0-20220723083548-714439c8af9a h1:RenIAa2q4H8UcS/cqmwdT1WCWIAH5aumP8m8RpbqVsE= github.com/Xhofe/go-cache v0.0.0-20220723083548-714439c8af9a h1:RenIAa2q4H8UcS/cqmwdT1WCWIAH5aumP8m8RpbqVsE=
github.com/Xhofe/go-cache v0.0.0-20220723083548-714439c8af9a/go.mod h1:sSBbaOg90XwWKtpT56kVujF0bIeVITnPlssLclogS04= github.com/Xhofe/go-cache v0.0.0-20220723083548-714439c8af9a/go.mod h1:sSBbaOg90XwWKtpT56kVujF0bIeVITnPlssLclogS04=
github.com/caarlos0/env/v6 v6.9.3 h1:Tyg69hoVXDnpO5Qvpsu8EoquarbPyQb+YwExWHP8wWU= github.com/caarlos0/env/v6 v6.9.3 h1:Tyg69hoVXDnpO5Qvpsu8EoquarbPyQb+YwExWHP8wWU=

View File

@ -3,13 +3,14 @@ package aria2
import ( import (
"context" "context"
"fmt" "fmt"
"path/filepath"
"github.com/alist-org/alist/v3/internal/conf" "github.com/alist-org/alist/v3/internal/conf"
"github.com/alist-org/alist/v3/internal/errs" "github.com/alist-org/alist/v3/internal/errs"
"github.com/alist-org/alist/v3/internal/operations" "github.com/alist-org/alist/v3/internal/operations"
"github.com/alist-org/alist/v3/pkg/task" "github.com/alist-org/alist/v3/pkg/task"
"github.com/google/uuid" "github.com/google/uuid"
"github.com/pkg/errors" "github.com/pkg/errors"
"path/filepath"
) )
func AddURI(ctx context.Context, uri string, dstDirPath string) error { func AddURI(ctx context.Context, uri string, dstDirPath string) error {

View File

@ -2,13 +2,14 @@ package aria2
import ( import (
"context" "context"
"time"
"github.com/alist-org/alist/v3/internal/conf" "github.com/alist-org/alist/v3/internal/conf"
"github.com/alist-org/alist/v3/internal/setting" "github.com/alist-org/alist/v3/internal/setting"
"github.com/alist-org/alist/v3/pkg/aria2/rpc" "github.com/alist-org/alist/v3/pkg/aria2/rpc"
"github.com/alist-org/alist/v3/pkg/task" "github.com/alist-org/alist/v3/pkg/task"
"github.com/pkg/errors" "github.com/pkg/errors"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"time"
) )
var DownTaskManager = task.NewTaskManager[string](3) var DownTaskManager = task.NewTaskManager[string](3)

View File

@ -1,12 +1,12 @@
package bootstrap package bootstrap
import ( import (
conf2 "github.com/alist-org/alist/v3/internal/conf"
"io/ioutil" "io/ioutil"
"os" "os"
"path/filepath" "path/filepath"
"github.com/alist-org/alist/v3/cmd/args" "github.com/alist-org/alist/v3/cmd/args"
"github.com/alist-org/alist/v3/internal/conf"
"github.com/alist-org/alist/v3/pkg/utils" "github.com/alist-org/alist/v3/pkg/utils"
"github.com/caarlos0/env/v6" "github.com/caarlos0/env/v6"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
@ -20,8 +20,8 @@ func InitConfig() {
if err != nil { if err != nil {
log.Fatalf("failed to create config file: %+v", err) log.Fatalf("failed to create config file: %+v", err)
} }
conf2.Conf = conf2.DefaultConfig() conf.Conf = conf.DefaultConfig()
if !utils.WriteToJson(args.Config, conf2.Conf) { if !utils.WriteToJson(args.Config, conf.Conf) {
log.Fatalf("failed to create default config file") log.Fatalf("failed to create default config file")
} }
} else { } else {
@ -29,14 +29,14 @@ func InitConfig() {
if err != nil { if err != nil {
log.Fatalf("reading config file error:%s", err.Error()) log.Fatalf("reading config file error:%s", err.Error())
} }
conf2.Conf = conf2.DefaultConfig() conf.Conf = conf.DefaultConfig()
err = utils.Json.Unmarshal(configBytes, conf2.Conf) err = utils.Json.Unmarshal(configBytes, conf.Conf)
if err != nil { if err != nil {
log.Fatalf("load config error: %s", err.Error()) log.Fatalf("load config error: %s", err.Error())
} }
log.Debugf("config:%+v", conf2.Conf) log.Debugf("config:%+v", conf.Conf)
// update config.json struct // update config.json struct
confBody, err := utils.Json.MarshalIndent(conf2.Conf, "", " ") confBody, err := utils.Json.MarshalIndent(conf.Conf, "", " ")
if err != nil { if err != nil {
log.Fatalf("marshal config error:%s", err.Error()) log.Fatalf("marshal config error:%s", err.Error())
} }
@ -45,28 +45,28 @@ func InitConfig() {
log.Fatalf("update config struct error: %s", err.Error()) log.Fatalf("update config struct error: %s", err.Error())
} }
} }
if !conf2.Conf.Force { if !conf.Conf.Force {
confFromEnv() confFromEnv()
} }
// convert abs path // convert abs path
var absPath string var absPath string
var err error var err error
if !filepath.IsAbs(conf2.Conf.TempDir) { if !filepath.IsAbs(conf.Conf.TempDir) {
absPath, err = filepath.Abs(conf2.Conf.TempDir) absPath, err = filepath.Abs(conf.Conf.TempDir)
if err != nil { if err != nil {
log.Fatalf("get abs path error: %s", err.Error()) log.Fatalf("get abs path error: %s", err.Error())
} }
} }
conf2.Conf.TempDir = absPath conf.Conf.TempDir = absPath
err = os.RemoveAll(filepath.Join(conf2.Conf.TempDir)) err = os.RemoveAll(filepath.Join(conf.Conf.TempDir))
if err != nil { if err != nil {
log.Errorln("failed delete temp file:", err) log.Errorln("failed delete temp file:", err)
} }
err = os.MkdirAll(conf2.Conf.TempDir, 0700) err = os.MkdirAll(conf.Conf.TempDir, 0700)
if err != nil { if err != nil {
log.Fatalf("create temp dir error: %s", err.Error()) log.Fatalf("create temp dir error: %s", err.Error())
} }
log.Debugf("config: %+v", conf2.Conf) log.Debugf("config: %+v", conf.Conf)
} }
func confFromEnv() { func confFromEnv() {
@ -75,7 +75,7 @@ func confFromEnv() {
prefix = "" prefix = ""
} }
log.Infof("load config from env with prefix: %s", prefix) log.Infof("load config from env with prefix: %s", prefix)
if err := env.Parse(conf2.Conf, env.Options{ if err := env.Parse(conf.Conf, env.Options{
Prefix: prefix, Prefix: prefix,
}); err != nil { }); err != nil {
log.Fatalf("load config from env error: %s", err.Error()) log.Fatalf("load config from env error: %s", err.Error())

View File

@ -2,6 +2,7 @@ package data
import ( import (
"context" "context"
"github.com/alist-org/alist/v3/cmd/args" "github.com/alist-org/alist/v3/cmd/args"
"github.com/alist-org/alist/v3/internal/db" "github.com/alist-org/alist/v3/internal/db"
"github.com/alist-org/alist/v3/internal/message" "github.com/alist-org/alist/v3/internal/message"

View File

@ -2,6 +2,10 @@ package bootstrap
import ( import (
"fmt" "fmt"
stdlog "log"
"strings"
"time"
"github.com/alist-org/alist/v3/cmd/args" "github.com/alist-org/alist/v3/cmd/args"
"github.com/alist-org/alist/v3/internal/conf" "github.com/alist-org/alist/v3/internal/conf"
"github.com/alist-org/alist/v3/internal/db" "github.com/alist-org/alist/v3/internal/db"
@ -12,9 +16,6 @@ import (
"gorm.io/gorm" "gorm.io/gorm"
"gorm.io/gorm/logger" "gorm.io/gorm/logger"
"gorm.io/gorm/schema" "gorm.io/gorm/schema"
stdlog "log"
"strings"
"time"
) )
func InitDB() { func InitDB() {

View File

@ -1,11 +1,11 @@
package bootstrap package bootstrap
import ( import (
"github.com/alist-org/alist/v3/internal/conf"
"log" "log"
"time" "time"
"github.com/alist-org/alist/v3/cmd/args" "github.com/alist-org/alist/v3/cmd/args"
"github.com/alist-org/alist/v3/internal/conf"
rotatelogs "github.com/lestrrat-go/file-rotatelogs" rotatelogs "github.com/lestrrat-go/file-rotatelogs"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
) )

View File

@ -1,9 +1,10 @@
package db package db
import ( import (
"log"
"github.com/alist-org/alist/v3/internal/model" "github.com/alist-org/alist/v3/internal/model"
"gorm.io/gorm" "gorm.io/gorm"
"log"
) )
var db gorm.DB var db gorm.DB

View File

@ -1,6 +1,9 @@
package db package db
import ( import (
stdpath "path"
"time"
"github.com/Xhofe/go-cache" "github.com/Xhofe/go-cache"
"github.com/alist-org/alist/v3/internal/errs" "github.com/alist-org/alist/v3/internal/errs"
"github.com/alist-org/alist/v3/internal/model" "github.com/alist-org/alist/v3/internal/model"
@ -8,8 +11,6 @@ import (
"github.com/alist-org/alist/v3/pkg/utils" "github.com/alist-org/alist/v3/pkg/utils"
"github.com/pkg/errors" "github.com/pkg/errors"
"gorm.io/gorm" "gorm.io/gorm"
stdpath "path"
"time"
) )
var metaCache = cache.NewMemCache(cache.WithShards[*model.Meta](2)) var metaCache = cache.NewMemCache(cache.WithShards[*model.Meta](2))

View File

@ -1,12 +1,13 @@
package db package db
import ( import (
"testing"
"github.com/alist-org/alist/v3/internal/errs" "github.com/alist-org/alist/v3/internal/errs"
"github.com/alist-org/alist/v3/internal/model" "github.com/alist-org/alist/v3/internal/model"
"github.com/pkg/errors" "github.com/pkg/errors"
"gorm.io/driver/sqlite" "gorm.io/driver/sqlite"
"gorm.io/gorm" "gorm.io/gorm"
"testing"
) )
func init() { func init() {

View File

@ -2,6 +2,7 @@ package db
import ( import (
"fmt" "fmt"
"github.com/alist-org/alist/v3/internal/model" "github.com/alist-org/alist/v3/internal/model"
"github.com/pkg/errors" "github.com/pkg/errors"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"

View File

@ -1,12 +1,13 @@
package db package db
import ( import (
"time"
"github.com/Xhofe/go-cache" "github.com/Xhofe/go-cache"
"github.com/alist-org/alist/v3/internal/errs" "github.com/alist-org/alist/v3/internal/errs"
"github.com/alist-org/alist/v3/internal/model" "github.com/alist-org/alist/v3/internal/model"
"github.com/alist-org/alist/v3/pkg/singleflight" "github.com/alist-org/alist/v3/pkg/singleflight"
"github.com/pkg/errors" "github.com/pkg/errors"
"time"
) )
var userCache = cache.NewMemCache(cache.WithShards[*model.User](2)) var userCache = cache.NewMemCache(cache.WithShards[*model.User](2))

View File

@ -2,6 +2,7 @@ package db
import ( import (
"fmt" "fmt"
"github.com/alist-org/alist/v3/internal/conf" "github.com/alist-org/alist/v3/internal/conf"
) )

View File

@ -2,6 +2,7 @@ package errs
import ( import (
"errors" "errors"
pkgerr "github.com/pkg/errors" pkgerr "github.com/pkg/errors"
) )

View File

@ -6,12 +6,11 @@ import (
stdpath "path" stdpath "path"
"sync/atomic" "sync/atomic"
"github.com/alist-org/alist/v3/pkg/task"
"github.com/alist-org/alist/v3/pkg/utils"
"github.com/alist-org/alist/v3/internal/driver" "github.com/alist-org/alist/v3/internal/driver"
"github.com/alist-org/alist/v3/internal/model" "github.com/alist-org/alist/v3/internal/model"
"github.com/alist-org/alist/v3/internal/operations" "github.com/alist-org/alist/v3/internal/operations"
"github.com/alist-org/alist/v3/pkg/task"
"github.com/alist-org/alist/v3/pkg/utils"
"github.com/pkg/errors" "github.com/pkg/errors"
) )

View File

@ -2,12 +2,13 @@ package fs
import ( import (
"context" "context"
stdpath "path"
"time"
"github.com/alist-org/alist/v3/internal/model" "github.com/alist-org/alist/v3/internal/model"
"github.com/alist-org/alist/v3/internal/operations" "github.com/alist-org/alist/v3/internal/operations"
"github.com/alist-org/alist/v3/pkg/utils" "github.com/alist-org/alist/v3/pkg/utils"
"github.com/pkg/errors" "github.com/pkg/errors"
stdpath "path"
"time"
) )
func get(ctx context.Context, path string) (model.Obj, error) { func get(ctx context.Context, path string) (model.Obj, error) {

View File

@ -2,6 +2,7 @@ package fs
import ( import (
"context" "context"
"github.com/alist-org/alist/v3/internal/model" "github.com/alist-org/alist/v3/internal/model"
"github.com/alist-org/alist/v3/internal/operations" "github.com/alist-org/alist/v3/internal/operations"
"github.com/pkg/errors" "github.com/pkg/errors"

View File

@ -2,13 +2,14 @@ package fs
import ( import (
"context" "context"
"regexp"
"strings"
"github.com/alist-org/alist/v3/internal/model" "github.com/alist-org/alist/v3/internal/model"
"github.com/alist-org/alist/v3/internal/operations" "github.com/alist-org/alist/v3/internal/operations"
"github.com/alist-org/alist/v3/pkg/utils" "github.com/alist-org/alist/v3/pkg/utils"
"github.com/pkg/errors" "github.com/pkg/errors"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"regexp"
"strings"
) )
// List files // List files

View File

@ -3,16 +3,17 @@ package fs
import ( import (
"context" "context"
"fmt" "fmt"
"sync/atomic"
"github.com/alist-org/alist/v3/internal/errs" "github.com/alist-org/alist/v3/internal/errs"
"github.com/alist-org/alist/v3/internal/model" "github.com/alist-org/alist/v3/internal/model"
"github.com/alist-org/alist/v3/internal/operations" "github.com/alist-org/alist/v3/internal/operations"
"github.com/alist-org/alist/v3/pkg/task" "github.com/alist-org/alist/v3/pkg/task"
"github.com/alist-org/alist/v3/pkg/utils" "github.com/alist-org/alist/v3/pkg/utils"
"github.com/pkg/errors" "github.com/pkg/errors"
"sync/atomic"
) )
var UploadTaskManager = task.NewTaskManager[uint64](3, func(tid *uint64) { var UploadTaskManager = task.NewTaskManager(3, func(tid *uint64) {
atomic.AddUint64(tid, 1) atomic.AddUint64(tid, 1)
}) })

View File

@ -1,7 +1,6 @@
package fs package fs
import ( import (
"github.com/alist-org/alist/v3/internal/operations"
"io" "io"
"mime" "mime"
"net/http" "net/http"
@ -10,6 +9,7 @@ import (
"strings" "strings"
"github.com/alist-org/alist/v3/internal/model" "github.com/alist-org/alist/v3/internal/model"
"github.com/alist-org/alist/v3/internal/operations"
"github.com/pkg/errors" "github.com/pkg/errors"
) )

View File

@ -1,10 +1,11 @@
package message package message
import ( import (
"time"
"github.com/alist-org/alist/v3/server/common" "github.com/alist-org/alist/v3/server/common"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/pkg/errors" "github.com/pkg/errors"
"time"
) )
type Post struct { type Post struct {

View File

@ -1,11 +1,11 @@
package operations package operations
import ( import (
"github.com/alist-org/alist/v3/internal/errs"
stdpath "path" stdpath "path"
"strings" "strings"
"github.com/alist-org/alist/v3/internal/driver" "github.com/alist-org/alist/v3/internal/driver"
"github.com/alist-org/alist/v3/internal/errs"
"github.com/alist-org/alist/v3/pkg/utils" "github.com/alist-org/alist/v3/pkg/utils"
"github.com/pkg/errors" "github.com/pkg/errors"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"

View File

@ -2,7 +2,6 @@ package operations
import ( import (
"context" "context"
log "github.com/sirupsen/logrus"
"sort" "sort"
"strings" "strings"
"time" "time"
@ -13,6 +12,7 @@ import (
"github.com/alist-org/alist/v3/pkg/generic_sync" "github.com/alist-org/alist/v3/pkg/generic_sync"
"github.com/alist-org/alist/v3/pkg/utils" "github.com/alist-org/alist/v3/pkg/utils"
"github.com/pkg/errors" "github.com/pkg/errors"
log "github.com/sirupsen/logrus"
) )
// Although the driver type is stored, // Although the driver type is stored,

View File

@ -2,9 +2,9 @@ package operations_test
import ( import (
"context" "context"
"github.com/alist-org/alist/v3/internal/db"
"testing" "testing"
"github.com/alist-org/alist/v3/internal/db"
"github.com/alist-org/alist/v3/internal/model" "github.com/alist-org/alist/v3/internal/model"
"github.com/alist-org/alist/v3/internal/operations" "github.com/alist-org/alist/v3/internal/operations"
"github.com/alist-org/alist/v3/pkg/utils" "github.com/alist-org/alist/v3/pkg/utils"

View File

@ -1,8 +1,9 @@
package setting package setting
import ( import (
"github.com/alist-org/alist/v3/internal/db"
"strconv" "strconv"
"github.com/alist-org/alist/v3/internal/db"
) )
func GetByKey(key string, defaultValue ...string) string { func GetByKey(key string, defaultValue ...string) string {

View File

@ -1,11 +1,12 @@
package sign package sign
import ( import (
"sync"
"time"
"github.com/alist-org/alist/v3/internal/conf" "github.com/alist-org/alist/v3/internal/conf"
"github.com/alist-org/alist/v3/internal/setting" "github.com/alist-org/alist/v3/internal/setting"
"github.com/alist-org/alist/v3/pkg/sign" "github.com/alist-org/alist/v3/pkg/sign"
"sync"
"time"
) )
var once sync.Once var once sync.Once

View File

@ -1,9 +1,10 @@
package common package common
import ( import (
"time"
"github.com/golang-jwt/jwt/v4" "github.com/golang-jwt/jwt/v4"
"github.com/pkg/errors" "github.com/pkg/errors"
"time"
) )
var SecretKey []byte var SecretKey []byte

View File

@ -2,10 +2,11 @@ package common
import ( import (
"fmt" "fmt"
"github.com/alist-org/alist/v3/internal/conf"
"github.com/alist-org/alist/v3/internal/setting"
"net/http" "net/http"
"strings" "strings"
"github.com/alist-org/alist/v3/internal/conf"
"github.com/alist-org/alist/v3/internal/setting"
) )
func GetBaseUrl(r *http.Request) string { func GetBaseUrl(r *http.Request) string {

View File

@ -2,9 +2,6 @@ package common
import ( import (
"fmt" "fmt"
"github.com/alist-org/alist/v3/internal/model"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
"io" "io"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
@ -12,6 +9,10 @@ import (
"os" "os"
"strconv" "strconv"
"strings" "strings"
"github.com/alist-org/alist/v3/internal/model"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
) )
var HttpClient = &http.Client{} var HttpClient = &http.Client{}

View File

@ -1,13 +1,14 @@
package handles package handles
import ( import (
stdpath "path"
"github.com/alist-org/alist/v3/internal/aria2" "github.com/alist-org/alist/v3/internal/aria2"
"github.com/alist-org/alist/v3/internal/conf" "github.com/alist-org/alist/v3/internal/conf"
"github.com/alist-org/alist/v3/internal/db" "github.com/alist-org/alist/v3/internal/db"
"github.com/alist-org/alist/v3/internal/model" "github.com/alist-org/alist/v3/internal/model"
"github.com/alist-org/alist/v3/server/common" "github.com/alist-org/alist/v3/server/common"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
stdpath "path"
) )
type SetAria2Req struct { type SetAria2Req struct {

View File

@ -2,15 +2,15 @@ package handles
import ( import (
"fmt" "fmt"
"github.com/alist-org/alist/v3/internal/conf"
"github.com/alist-org/alist/v3/internal/sign"
stdpath "path" stdpath "path"
"strings" "strings"
"github.com/alist-org/alist/v3/internal/conf"
"github.com/alist-org/alist/v3/internal/driver" "github.com/alist-org/alist/v3/internal/driver"
"github.com/alist-org/alist/v3/internal/fs" "github.com/alist-org/alist/v3/internal/fs"
"github.com/alist-org/alist/v3/internal/model" "github.com/alist-org/alist/v3/internal/model"
"github.com/alist-org/alist/v3/internal/setting" "github.com/alist-org/alist/v3/internal/setting"
"github.com/alist-org/alist/v3/internal/sign"
"github.com/alist-org/alist/v3/pkg/utils" "github.com/alist-org/alist/v3/pkg/utils"
"github.com/alist-org/alist/v3/server/common" "github.com/alist-org/alist/v3/server/common"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"

View File

@ -2,6 +2,7 @@ package handles
import ( import (
"fmt" "fmt"
"github.com/alist-org/alist/v3/internal/operations" "github.com/alist-org/alist/v3/internal/operations"
"github.com/alist-org/alist/v3/server/common" "github.com/alist-org/alist/v3/server/common"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"

View File

@ -2,6 +2,10 @@ package handles
import ( import (
"fmt" "fmt"
stdpath "path"
"strconv"
"time"
"github.com/alist-org/alist/v3/internal/db" "github.com/alist-org/alist/v3/internal/db"
"github.com/alist-org/alist/v3/internal/errs" "github.com/alist-org/alist/v3/internal/errs"
"github.com/alist-org/alist/v3/internal/fs" "github.com/alist-org/alist/v3/internal/fs"
@ -9,9 +13,6 @@ import (
"github.com/alist-org/alist/v3/internal/sign" "github.com/alist-org/alist/v3/internal/sign"
"github.com/alist-org/alist/v3/server/common" "github.com/alist-org/alist/v3/server/common"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
stdpath "path"
"strconv"
"time"
) )
type MkdirOrLinkReq struct { type MkdirOrLinkReq struct {

View File

@ -1,6 +1,9 @@
package handles package handles
import ( import (
"strconv"
"strings"
"github.com/alist-org/alist/v3/internal/conf" "github.com/alist-org/alist/v3/internal/conf"
"github.com/alist-org/alist/v3/internal/db" "github.com/alist-org/alist/v3/internal/db"
"github.com/alist-org/alist/v3/internal/model" "github.com/alist-org/alist/v3/internal/model"
@ -8,8 +11,6 @@ import (
"github.com/alist-org/alist/v3/pkg/utils/random" "github.com/alist-org/alist/v3/pkg/utils/random"
"github.com/alist-org/alist/v3/server/common" "github.com/alist-org/alist/v3/server/common"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"strconv"
"strings"
) )
func ResetToken(c *gin.Context) { func ResetToken(c *gin.Context) {

View File

@ -1,6 +1,8 @@
package middlewares package middlewares
import ( import (
stdpath "path"
"github.com/alist-org/alist/v3/internal/db" "github.com/alist-org/alist/v3/internal/db"
"github.com/alist-org/alist/v3/internal/errs" "github.com/alist-org/alist/v3/internal/errs"
"github.com/alist-org/alist/v3/internal/model" "github.com/alist-org/alist/v3/internal/model"
@ -9,7 +11,6 @@ import (
"github.com/alist-org/alist/v3/server/common" "github.com/alist-org/alist/v3/server/common"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/pkg/errors" "github.com/pkg/errors"
stdpath "path"
) )
func Down(c *gin.Context) { func Down(c *gin.Context) {

View File

@ -2,13 +2,14 @@ package server
import ( import (
"context" "context"
"net/http"
"github.com/alist-org/alist/v3/internal/db" "github.com/alist-org/alist/v3/internal/db"
"github.com/alist-org/alist/v3/internal/model" "github.com/alist-org/alist/v3/internal/model"
"github.com/alist-org/alist/v3/pkg/utils" "github.com/alist-org/alist/v3/pkg/utils"
"github.com/alist-org/alist/v3/server/webdav" "github.com/alist-org/alist/v3/server/webdav"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"net/http"
) )
var handler *webdav.Handler var handler *webdav.Handler

View File

@ -6,12 +6,13 @@ package webdav
import ( import (
"context" "context"
"github.com/alist-org/alist/v3/internal/db"
"github.com/alist-org/alist/v3/internal/fs"
"github.com/alist-org/alist/v3/internal/model"
"net/http" "net/http"
"path" "path"
"path/filepath" "path/filepath"
"github.com/alist-org/alist/v3/internal/db"
"github.com/alist-org/alist/v3/internal/fs"
"github.com/alist-org/alist/v3/internal/model"
) )
// slashClean is equivalent to but slightly more efficient than // slashClean is equivalent to but slightly more efficient than

View File

@ -10,11 +10,12 @@ import (
"encoding/xml" "encoding/xml"
"errors" "errors"
"fmt" "fmt"
"github.com/alist-org/alist/v3/internal/model"
"mime" "mime"
"net/http" "net/http"
"path" "path"
"strconv" "strconv"
"github.com/alist-org/alist/v3/internal/model"
) )
// Proppatch describes a property update instruction as defined in RFC 4918. // Proppatch describes a property update instruction as defined in RFC 4918.

View File

@ -8,18 +8,19 @@ package webdav // import "golang.org/x/net/webdav"
import ( import (
"errors" "errors"
"fmt" "fmt"
"github.com/alist-org/alist/v3/internal/errs"
"github.com/alist-org/alist/v3/internal/fs"
"github.com/alist-org/alist/v3/internal/model"
"github.com/alist-org/alist/v3/internal/sign"
"github.com/alist-org/alist/v3/pkg/utils"
"github.com/alist-org/alist/v3/server/common"
"net/http" "net/http"
"net/url" "net/url"
"os" "os"
"path" "path"
"strings" "strings"
"time" "time"
"github.com/alist-org/alist/v3/internal/errs"
"github.com/alist-org/alist/v3/internal/fs"
"github.com/alist-org/alist/v3/internal/model"
"github.com/alist-org/alist/v3/internal/sign"
"github.com/alist-org/alist/v3/pkg/utils"
"github.com/alist-org/alist/v3/server/common"
) )
type Handler struct { type Handler struct {