mirror of https://github.com/Xhofe/alist
chore: fix drivers not import
parent
0df3473337
commit
5b40254e3b
|
@ -2,12 +2,13 @@ package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/alist-org/alist/v3/cmd/flags"
|
"github.com/alist-org/alist/v3/cmd/flags"
|
||||||
|
_ "github.com/alist-org/alist/v3/drivers"
|
||||||
"github.com/alist-org/alist/v3/internal/conf"
|
"github.com/alist-org/alist/v3/internal/conf"
|
||||||
"github.com/alist-org/alist/v3/server"
|
"github.com/alist-org/alist/v3/server"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -6,9 +6,9 @@ package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/alist-org/alist/v3/internal/conf"
|
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
|
"github.com/alist-org/alist/v3/internal/conf"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ func init() {
|
||||||
TimestampFormat: "2006-01-02 15:04:05",
|
TimestampFormat: "2006-01-02 15:04:05",
|
||||||
FullTimestamp: true,
|
FullTimestamp: true,
|
||||||
})
|
})
|
||||||
logrus.SetLevel(logrus.DebugLevel)
|
// logrus.SetLevel(logrus.DebugLevel)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Log() {
|
func Log() {
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
package operations
|
package operations
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/alist-org/alist/v3/internal/conf"
|
|
||||||
"reflect"
|
"reflect"
|
||||||
"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/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
log "github.com/sirupsen/logrus"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type New func() driver.Driver
|
type New func() driver.Driver
|
||||||
|
@ -16,7 +16,7 @@ var driverNewMap = map[string]New{}
|
||||||
var driverItemsMap = map[string]driver.Items{}
|
var driverItemsMap = map[string]driver.Items{}
|
||||||
|
|
||||||
func RegisterDriver(config driver.Config, driver New) {
|
func RegisterDriver(config driver.Config, driver New) {
|
||||||
log.Infof("register driver: [%s]", config.Name)
|
// log.Infof("register driver: [%s]", config.Name)
|
||||||
registerDriverItems(config, driver().GetAddition())
|
registerDriverItems(config, driver().GetAddition())
|
||||||
driverNewMap[config.Name] = driver
|
driverNewMap[config.Name] = driver
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ func GetDriverItemsMap() map[string]driver.Items {
|
||||||
}
|
}
|
||||||
|
|
||||||
func registerDriverItems(config driver.Config, addition driver.Additional) {
|
func registerDriverItems(config driver.Config, addition driver.Additional) {
|
||||||
log.Debugf("addition of %s: %+v", config.Name, addition)
|
// log.Debugf("addition of %s: %+v", config.Name, addition)
|
||||||
tAddition := reflect.TypeOf(addition)
|
tAddition := reflect.TypeOf(addition)
|
||||||
mainItems := getMainItems(config)
|
mainItems := getMainItems(config)
|
||||||
additionalItems := getAdditionalItems(tAddition, config.DefaultRoot)
|
additionalItems := getAdditionalItems(tAddition, config.DefaultRoot)
|
||||||
|
|
Loading…
Reference in New Issue