diff --git a/webdav/.golangci.yml b/webdav/.golangci.yml index 4b0aae34c..235f51c42 100644 --- a/webdav/.golangci.yml +++ b/webdav/.golangci.yml @@ -33,11 +33,6 @@ linters: - lll - gosec - funlen - - goimports - - gofmt - - gofumpt - - gci - - tagalign severity: default-severity: major diff --git a/webdav/cache/workspace_cache.go b/webdav/cache/workspace_cache.go index fb54a1876..96a57e149 100644 --- a/webdav/cache/workspace_cache.go +++ b/webdav/cache/workspace_cache.go @@ -28,14 +28,14 @@ func NewWorkspaceCache() *WorkspaceCache { } type Workspace struct { - ID string `json:"id," gorm:"column:id;size:36"` - Name string `json:"name" gorm:"column:name;size:255"` - StorageCapacity int64 `json:"storageCapacity" gorm:"column:storage_capacity"` - RootID string `json:"rootId" gorm:"column:root_id;size:36"` - OrganizationID string `json:"organizationId" gorm:"column:organization_id;size:36"` - Bucket string `json:"bucket" gorm:"column:bucket;size:255"` - CreateTime string `json:"createTime" gorm:"column:create_time"` - UpdateTime *string `json:"updateTime,omitempty" gorm:"column:update_time"` + ID string `gorm:"column:id;size:36" json:"id"` + Name string `gorm:"column:name;size:255" json:"name"` + StorageCapacity int64 `gorm:"column:storage_capacity" json:"storageCapacity"` + RootID string `gorm:"column:root_id;size:36" json:"rootId"` + OrganizationID string `gorm:"column:organization_id;size:36" json:"organizationId"` + Bucket string `gorm:"column:bucket;size:255" json:"bucket"` + CreateTime string `gorm:"column:create_time" json:"createTime"` + UpdateTime *string `gorm:"column:update_time" json:"updateTime,omitempty"` } func (c *WorkspaceCache) Get(id string) (*Workspace, error) { diff --git a/webdav/infra/redis.go b/webdav/infra/redis.go index 266ffcf27..d92ca0bd2 100644 --- a/webdav/infra/redis.go +++ b/webdav/infra/redis.go @@ -12,9 +12,11 @@ package infra import ( "context" - "github.com/kouprlabs/voltaserve/webdav/config" - "github.com/redis/go-redis/v9" "strings" + + "github.com/redis/go-redis/v9" + + "github.com/kouprlabs/voltaserve/webdav/config" ) type RedisManager struct { diff --git a/webdav/infra/s3.go b/webdav/infra/s3.go index 687e88143..e1c477899 100644 --- a/webdav/infra/s3.go +++ b/webdav/infra/s3.go @@ -14,11 +14,13 @@ import ( "bytes" "context" "errors" - "github.com/kouprlabs/voltaserve/webdav/config" - "github.com/minio/minio-go/v7" - "github.com/minio/minio-go/v7/pkg/credentials" "io" "strings" + + "github.com/minio/minio-go/v7" + "github.com/minio/minio-go/v7/pkg/credentials" + + "github.com/kouprlabs/voltaserve/webdav/config" ) type S3Manager struct { diff --git a/webdav/main.go b/webdav/main.go index 8a7b7403c..ae3f5f9cc 100644 --- a/webdav/main.go +++ b/webdav/main.go @@ -13,10 +13,6 @@ package main import ( "context" "fmt" - "github.com/kouprlabs/voltaserve/webdav/client" - "github.com/kouprlabs/voltaserve/webdav/handler" - "github.com/kouprlabs/voltaserve/webdav/helper" - "github.com/kouprlabs/voltaserve/webdav/infra" "log" "net/http" "os" @@ -25,7 +21,12 @@ import ( "time" "github.com/joho/godotenv" + + "github.com/kouprlabs/voltaserve/webdav/client" "github.com/kouprlabs/voltaserve/webdav/config" + "github.com/kouprlabs/voltaserve/webdav/handler" + "github.com/kouprlabs/voltaserve/webdav/helper" + "github.com/kouprlabs/voltaserve/webdav/infra" ) var ( @@ -90,6 +91,8 @@ func basicAuthMiddleware(next http.Handler, idpClient *client.IdPClient) http.Ha // @title Voltaserve WebDAV // @version 2.0.0 // @BasePath /v2 +// +// . func main() { if _, err := os.Stat(".env.local"); err == nil { if err := godotenv.Load(".env.local"); err != nil {