Code: compatible with semantic import versioning

pull/630/head
loyalsoldier 6 years ago
parent 746aa3e8ef
commit 4c8a0f3046
No known key found for this signature in database
GPG Key ID: 23829BBC1ACF2C90

@ -3,9 +3,10 @@ package bootstrap
import ( import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"github.com/HFO4/cloudreve/pkg/conf"
"github.com/HFO4/cloudreve/pkg/request" "github.com/cloudreve/Cloudreve/v3/pkg/conf"
"github.com/HFO4/cloudreve/pkg/util" "github.com/cloudreve/Cloudreve/v3/pkg/request"
"github.com/cloudreve/Cloudreve/v3/pkg/util"
"github.com/hashicorp/go-version" "github.com/hashicorp/go-version"
) )

@ -1,14 +1,14 @@
package bootstrap package bootstrap
import ( import (
model "github.com/HFO4/cloudreve/models" model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/HFO4/cloudreve/pkg/aria2" "github.com/cloudreve/Cloudreve/v3/pkg/aria2"
"github.com/HFO4/cloudreve/pkg/auth" "github.com/cloudreve/Cloudreve/v3/pkg/auth"
"github.com/HFO4/cloudreve/pkg/cache" "github.com/cloudreve/Cloudreve/v3/pkg/cache"
"github.com/HFO4/cloudreve/pkg/conf" "github.com/cloudreve/Cloudreve/v3/pkg/conf"
"github.com/HFO4/cloudreve/pkg/crontab" "github.com/cloudreve/Cloudreve/v3/pkg/crontab"
"github.com/HFO4/cloudreve/pkg/email" "github.com/cloudreve/Cloudreve/v3/pkg/email"
"github.com/HFO4/cloudreve/pkg/task" "github.com/cloudreve/Cloudreve/v3/pkg/task"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )

@ -2,15 +2,15 @@ package bootstrap
import ( import (
"encoding/json" "encoding/json"
"github.com/HFO4/cloudreve/pkg/conf"
"github.com/HFO4/cloudreve/pkg/util"
_ "github.com/HFO4/cloudreve/statik"
"github.com/gin-contrib/static"
"github.com/rakyll/statik/fs"
"io" "io"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
"path" "path"
"github.com/cloudreve/Cloudreve/v3/pkg/conf"
"github.com/cloudreve/Cloudreve/v3/pkg/util"
"github.com/gin-contrib/static"
"github.com/rakyll/statik/fs"
) )
const StaticFolder = "statics" const StaticFolder = "statics"

@ -1,4 +1,4 @@
module github.com/HFO4/cloudreve module github.com/cloudreve/Cloudreve/v3
go 1.13 go 1.13

@ -2,10 +2,11 @@ package main
import ( import (
"flag" "flag"
"github.com/HFO4/cloudreve/bootstrap"
"github.com/HFO4/cloudreve/pkg/conf" "github.com/cloudreve/Cloudreve/v3/bootstrap"
"github.com/HFO4/cloudreve/pkg/util" "github.com/cloudreve/Cloudreve/v3/pkg/conf"
"github.com/HFO4/cloudreve/routers" "github.com/cloudreve/Cloudreve/v3/pkg/util"
"github.com/cloudreve/Cloudreve/v3/routers"
) )
var ( var (

@ -8,14 +8,14 @@ import (
"io/ioutil" "io/ioutil"
"net/http" "net/http"
model "github.com/HFO4/cloudreve/models" model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/HFO4/cloudreve/pkg/auth" "github.com/cloudreve/Cloudreve/v3/pkg/auth"
"github.com/HFO4/cloudreve/pkg/cache" "github.com/cloudreve/Cloudreve/v3/pkg/cache"
"github.com/HFO4/cloudreve/pkg/filesystem/driver/onedrive" "github.com/cloudreve/Cloudreve/v3/pkg/filesystem/driver/onedrive"
"github.com/HFO4/cloudreve/pkg/filesystem/driver/oss" "github.com/cloudreve/Cloudreve/v3/pkg/filesystem/driver/oss"
"github.com/HFO4/cloudreve/pkg/filesystem/driver/upyun" "github.com/cloudreve/Cloudreve/v3/pkg/filesystem/driver/upyun"
"github.com/HFO4/cloudreve/pkg/serializer" "github.com/cloudreve/Cloudreve/v3/pkg/serializer"
"github.com/HFO4/cloudreve/pkg/util" "github.com/cloudreve/Cloudreve/v3/pkg/util"
"github.com/gin-contrib/sessions" "github.com/gin-contrib/sessions"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/qiniu/api.v7/v7/auth/qbox" "github.com/qiniu/api.v7/v7/auth/qbox"

@ -3,21 +3,22 @@ package middleware
import ( import (
"database/sql" "database/sql"
"errors" "errors"
"github.com/DATA-DOG/go-sqlmock"
"github.com/HFO4/cloudreve/models"
"github.com/HFO4/cloudreve/pkg/auth"
"github.com/HFO4/cloudreve/pkg/cache"
"github.com/HFO4/cloudreve/pkg/serializer"
"github.com/HFO4/cloudreve/pkg/util"
"github.com/gin-gonic/gin"
"github.com/jinzhu/gorm"
"github.com/qiniu/api.v7/v7/auth/qbox"
"github.com/stretchr/testify/assert"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
"net/http/httptest" "net/http/httptest"
"strings" "strings"
"testing" "testing"
"github.com/DATA-DOG/go-sqlmock"
model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/cloudreve/Cloudreve/v3/pkg/auth"
"github.com/cloudreve/Cloudreve/v3/pkg/cache"
"github.com/cloudreve/Cloudreve/v3/pkg/serializer"
"github.com/cloudreve/Cloudreve/v3/pkg/util"
"github.com/gin-gonic/gin"
"github.com/jinzhu/gorm"
"github.com/qiniu/api.v7/v7/auth/qbox"
"github.com/stretchr/testify/assert"
) )
var mock sqlmock.Sqlmock var mock sqlmock.Sqlmock

@ -1,7 +1,7 @@
package middleware package middleware
import ( import (
"github.com/HFO4/cloudreve/pkg/util" "github.com/cloudreve/Cloudreve/v3/pkg/util"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )

@ -1,12 +1,13 @@
package middleware package middleware
import ( import (
"github.com/HFO4/cloudreve/pkg/util"
"github.com/gin-gonic/gin"
"github.com/stretchr/testify/assert"
"net/http" "net/http"
"net/http/httptest" "net/http/httptest"
"testing" "testing"
"github.com/cloudreve/Cloudreve/v3/pkg/util"
"github.com/gin-gonic/gin"
"github.com/stretchr/testify/assert"
) )
func TestMockHelper(t *testing.T) { func TestMockHelper(t *testing.T) {

@ -1,13 +1,14 @@
package middleware package middleware
import ( import (
"github.com/HFO4/cloudreve/bootstrap"
model "github.com/HFO4/cloudreve/models"
"github.com/HFO4/cloudreve/pkg/hashid"
"github.com/HFO4/cloudreve/pkg/serializer"
"github.com/HFO4/cloudreve/pkg/util"
"github.com/gin-gonic/gin"
"io/ioutil" "io/ioutil"
"github.com/cloudreve/Cloudreve/v3/bootstrap"
model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/cloudreve/Cloudreve/v3/pkg/hashid"
"github.com/cloudreve/Cloudreve/v3/pkg/serializer"
"github.com/cloudreve/Cloudreve/v3/pkg/util"
"github.com/gin-gonic/gin"
) )
// HashID 将给定对象的HashID转换为真实ID // HashID 将给定对象的HashID转换为真实ID

@ -2,17 +2,18 @@ package middleware
import ( import (
"errors" "errors"
"github.com/HFO4/cloudreve/bootstrap"
"github.com/HFO4/cloudreve/pkg/cache"
"github.com/HFO4/cloudreve/pkg/hashid"
"github.com/HFO4/cloudreve/pkg/util"
"github.com/gin-gonic/gin"
"github.com/stretchr/testify/assert"
testMock "github.com/stretchr/testify/mock"
"net/http" "net/http"
"net/http/httptest" "net/http/httptest"
"os" "os"
"testing" "testing"
"github.com/cloudreve/Cloudreve/v3/bootstrap"
"github.com/cloudreve/Cloudreve/v3/pkg/cache"
"github.com/cloudreve/Cloudreve/v3/pkg/hashid"
"github.com/cloudreve/Cloudreve/v3/pkg/util"
"github.com/gin-gonic/gin"
"github.com/stretchr/testify/assert"
testMock "github.com/stretchr/testify/mock"
) )
func TestHashID(t *testing.T) { func TestHashID(t *testing.T) {

@ -1,9 +1,9 @@
package middleware package middleware
import ( import (
"github.com/HFO4/cloudreve/pkg/conf" "github.com/cloudreve/Cloudreve/v3/pkg/conf"
"github.com/HFO4/cloudreve/pkg/serializer" "github.com/cloudreve/Cloudreve/v3/pkg/serializer"
"github.com/HFO4/cloudreve/pkg/util" "github.com/cloudreve/Cloudreve/v3/pkg/util"
"github.com/gin-contrib/sessions" "github.com/gin-contrib/sessions"
"github.com/gin-contrib/sessions/memstore" "github.com/gin-contrib/sessions/memstore"
"github.com/gin-contrib/sessions/redis" "github.com/gin-contrib/sessions/redis"

@ -1,13 +1,14 @@
package middleware package middleware
import ( import (
"github.com/HFO4/cloudreve/pkg/conf"
"github.com/HFO4/cloudreve/pkg/util"
"github.com/gin-gonic/gin"
"github.com/stretchr/testify/assert"
"net/http" "net/http"
"net/http/httptest" "net/http/httptest"
"testing" "testing"
"github.com/cloudreve/Cloudreve/v3/pkg/conf"
"github.com/cloudreve/Cloudreve/v3/pkg/util"
"github.com/gin-gonic/gin"
"github.com/stretchr/testify/assert"
) )
func TestSession(t *testing.T) { func TestSession(t *testing.T) {

@ -2,9 +2,10 @@ package middleware
import ( import (
"fmt" "fmt"
model "github.com/HFO4/cloudreve/models"
"github.com/HFO4/cloudreve/pkg/serializer" model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/HFO4/cloudreve/pkg/util" "github.com/cloudreve/Cloudreve/v3/pkg/serializer"
"github.com/cloudreve/Cloudreve/v3/pkg/util"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )

@ -1,14 +1,15 @@
package middleware package middleware
import ( import (
"net/http/httptest"
"testing"
"github.com/DATA-DOG/go-sqlmock" "github.com/DATA-DOG/go-sqlmock"
model "github.com/HFO4/cloudreve/models" model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/HFO4/cloudreve/pkg/conf" "github.com/cloudreve/Cloudreve/v3/pkg/conf"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/jinzhu/gorm" "github.com/jinzhu/gorm"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"net/http/httptest"
"testing"
) )
func TestShareAvailable(t *testing.T) { func TestShareAvailable(t *testing.T) {

@ -2,8 +2,9 @@ package model
import ( import (
"encoding/json" "encoding/json"
"github.com/HFO4/cloudreve/pkg/aria2/rpc"
"github.com/HFO4/cloudreve/pkg/util" "github.com/cloudreve/Cloudreve/v3/pkg/aria2/rpc"
"github.com/cloudreve/Cloudreve/v3/pkg/util"
"github.com/jinzhu/gorm" "github.com/jinzhu/gorm"
) )

@ -2,10 +2,11 @@ package model
import ( import (
"encoding/gob" "encoding/gob"
"github.com/HFO4/cloudreve/pkg/util"
"github.com/jinzhu/gorm"
"path" "path"
"time" "time"
"github.com/cloudreve/Cloudreve/v3/pkg/util"
"github.com/jinzhu/gorm"
) )
// File 文件 // File 文件

@ -2,10 +2,11 @@ package model
import ( import (
"errors" "errors"
"github.com/HFO4/cloudreve/pkg/util"
"github.com/jinzhu/gorm"
"path" "path"
"time" "time"
"github.com/cloudreve/Cloudreve/v3/pkg/util"
"github.com/jinzhu/gorm"
) )
// Folder 目录 // Folder 目录

@ -2,12 +2,13 @@ package model
import ( import (
"errors" "errors"
"testing"
"time"
"github.com/DATA-DOG/go-sqlmock" "github.com/DATA-DOG/go-sqlmock"
"github.com/HFO4/cloudreve/pkg/conf" "github.com/cloudreve/Cloudreve/v3/pkg/conf"
"github.com/jinzhu/gorm" "github.com/jinzhu/gorm"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"testing"
"time"
) )
func TestFolder_Create(t *testing.T) { func TestFolder_Create(t *testing.T) {

@ -4,8 +4,8 @@ import (
"fmt" "fmt"
"time" "time"
"github.com/HFO4/cloudreve/pkg/conf" "github.com/cloudreve/Cloudreve/v3/pkg/conf"
"github.com/HFO4/cloudreve/pkg/util" "github.com/cloudreve/Cloudreve/v3/pkg/util"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/jinzhu/gorm" "github.com/jinzhu/gorm"

@ -1,9 +1,9 @@
package model package model
import ( import (
"github.com/HFO4/cloudreve/pkg/cache" "github.com/cloudreve/Cloudreve/v3/pkg/cache"
"github.com/HFO4/cloudreve/pkg/conf" "github.com/cloudreve/Cloudreve/v3/pkg/conf"
"github.com/HFO4/cloudreve/pkg/util" "github.com/cloudreve/Cloudreve/v3/pkg/util"
"github.com/fatih/color" "github.com/fatih/color"
"github.com/jinzhu/gorm" "github.com/jinzhu/gorm"
) )

@ -1,10 +1,11 @@
package model package model
import ( import (
"github.com/HFO4/cloudreve/pkg/conf" "testing"
"github.com/cloudreve/Cloudreve/v3/pkg/conf"
"github.com/jinzhu/gorm" "github.com/jinzhu/gorm"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"testing"
) )
func TestMigration(t *testing.T) { func TestMigration(t *testing.T) {

@ -11,8 +11,8 @@ import (
"strings" "strings"
"time" "time"
"github.com/HFO4/cloudreve/pkg/cache" "github.com/cloudreve/Cloudreve/v3/pkg/cache"
"github.com/HFO4/cloudreve/pkg/util" "github.com/cloudreve/Cloudreve/v3/pkg/util"
"github.com/jinzhu/gorm" "github.com/jinzhu/gorm"
) )

@ -2,13 +2,14 @@ package model
import ( import (
"encoding/json" "encoding/json"
"github.com/DATA-DOG/go-sqlmock"
"github.com/HFO4/cloudreve/pkg/cache"
"github.com/jinzhu/gorm"
"github.com/stretchr/testify/assert"
"strconv" "strconv"
"testing" "testing"
"time" "time"
"github.com/DATA-DOG/go-sqlmock"
"github.com/cloudreve/Cloudreve/v3/pkg/cache"
"github.com/jinzhu/gorm"
"github.com/stretchr/testify/assert"
) )
func TestGetPolicyByID(t *testing.T) { func TestGetPolicyByID(t *testing.T) {

@ -1,10 +1,11 @@
package model package model
import ( import (
"github.com/HFO4/cloudreve/pkg/cache"
"github.com/jinzhu/gorm"
"net/url" "net/url"
"strconv" "strconv"
"github.com/cloudreve/Cloudreve/v3/pkg/cache"
"github.com/jinzhu/gorm"
) )
// Setting 系统设置模型 // Setting 系统设置模型

@ -2,11 +2,12 @@ package model
import ( import (
"database/sql" "database/sql"
"testing"
"github.com/DATA-DOG/go-sqlmock" "github.com/DATA-DOG/go-sqlmock"
"github.com/HFO4/cloudreve/pkg/cache" "github.com/cloudreve/Cloudreve/v3/pkg/cache"
"github.com/jinzhu/gorm" "github.com/jinzhu/gorm"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"testing"
) )
var mock sqlmock.Sqlmock var mock sqlmock.Sqlmock

@ -3,13 +3,14 @@ package model
import ( import (
"errors" "errors"
"fmt" "fmt"
"github.com/HFO4/cloudreve/pkg/cache"
"github.com/HFO4/cloudreve/pkg/hashid"
"github.com/HFO4/cloudreve/pkg/util"
"github.com/gin-gonic/gin"
"github.com/jinzhu/gorm"
"strings" "strings"
"time" "time"
"github.com/cloudreve/Cloudreve/v3/pkg/cache"
"github.com/cloudreve/Cloudreve/v3/pkg/hashid"
"github.com/cloudreve/Cloudreve/v3/pkg/util"
"github.com/gin-gonic/gin"
"github.com/jinzhu/gorm"
) )
// Share 分享模型 // Share 分享模型

@ -2,15 +2,16 @@ package model
import ( import (
"errors" "errors"
"net/http/httptest"
"testing"
"time"
"github.com/DATA-DOG/go-sqlmock" "github.com/DATA-DOG/go-sqlmock"
"github.com/HFO4/cloudreve/pkg/cache" "github.com/cloudreve/Cloudreve/v3/pkg/cache"
"github.com/HFO4/cloudreve/pkg/conf" "github.com/cloudreve/Cloudreve/v3/pkg/conf"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/jinzhu/gorm" "github.com/jinzhu/gorm"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"net/http/httptest"
"testing"
"time"
) )
func TestShare_Create(t *testing.T) { func TestShare_Create(t *testing.T) {

@ -1,7 +1,7 @@
package model package model
import ( import (
"github.com/HFO4/cloudreve/pkg/util" "github.com/cloudreve/Cloudreve/v3/pkg/util"
"github.com/jinzhu/gorm" "github.com/jinzhu/gorm"
) )

@ -1,7 +1,7 @@
package model package model
import ( import (
"github.com/HFO4/cloudreve/pkg/util" "github.com/cloudreve/Cloudreve/v3/pkg/util"
"github.com/jinzhu/gorm" "github.com/jinzhu/gorm"
) )

@ -5,10 +5,11 @@ import (
"crypto/sha1" "crypto/sha1"
"encoding/hex" "encoding/hex"
"encoding/json" "encoding/json"
"github.com/HFO4/cloudreve/pkg/util" "strings"
"github.com/cloudreve/Cloudreve/v3/pkg/util"
"github.com/jinzhu/gorm" "github.com/jinzhu/gorm"
"github.com/pkg/errors" "github.com/pkg/errors"
"strings"
) )
const ( const (

@ -5,9 +5,10 @@ import (
"encoding/binary" "encoding/binary"
"encoding/json" "encoding/json"
"fmt" "fmt"
"github.com/HFO4/cloudreve/pkg/hashid"
"github.com/duo-labs/webauthn/webauthn"
"net/url" "net/url"
"github.com/cloudreve/Cloudreve/v3/pkg/hashid"
"github.com/duo-labs/webauthn/webauthn"
) )
/* /*

@ -2,12 +2,13 @@ package model
import ( import (
"encoding/json" "encoding/json"
"testing"
"github.com/DATA-DOG/go-sqlmock" "github.com/DATA-DOG/go-sqlmock"
"github.com/HFO4/cloudreve/pkg/cache" "github.com/cloudreve/Cloudreve/v3/pkg/cache"
"github.com/jinzhu/gorm" "github.com/jinzhu/gorm"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"testing"
) )
func TestGetUserByID(t *testing.T) { func TestGetUserByID(t *testing.T) {

@ -2,12 +2,13 @@ package aria2
import ( import (
"encoding/json" "encoding/json"
model "github.com/HFO4/cloudreve/models"
"github.com/HFO4/cloudreve/pkg/aria2/rpc"
"github.com/HFO4/cloudreve/pkg/serializer"
"github.com/HFO4/cloudreve/pkg/util"
"net/url" "net/url"
"sync" "sync"
model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/cloudreve/Cloudreve/v3/pkg/aria2/rpc"
"github.com/cloudreve/Cloudreve/v3/pkg/serializer"
"github.com/cloudreve/Cloudreve/v3/pkg/util"
) )
// Instance 默认使用的Aria2处理实例 // Instance 默认使用的Aria2处理实例

@ -2,12 +2,13 @@ package aria2
import ( import (
"database/sql" "database/sql"
"testing"
"github.com/DATA-DOG/go-sqlmock" "github.com/DATA-DOG/go-sqlmock"
model "github.com/HFO4/cloudreve/models" model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/HFO4/cloudreve/pkg/cache" "github.com/cloudreve/Cloudreve/v3/pkg/cache"
"github.com/jinzhu/gorm" "github.com/jinzhu/gorm"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"testing"
) )
var mock sqlmock.Sqlmock var mock sqlmock.Sqlmock

@ -2,13 +2,14 @@ package aria2
import ( import (
"context" "context"
model "github.com/HFO4/cloudreve/models"
"github.com/HFO4/cloudreve/pkg/aria2/rpc"
"github.com/HFO4/cloudreve/pkg/util"
"path/filepath" "path/filepath"
"strconv" "strconv"
"strings" "strings"
"time" "time"
model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/cloudreve/Cloudreve/v3/pkg/aria2/rpc"
"github.com/cloudreve/Cloudreve/v3/pkg/util"
) )
// RPCService 通过RPC服务的Aria2任务管理器 // RPCService 通过RPC服务的Aria2任务管理器

@ -1,10 +1,11 @@
package aria2 package aria2
import ( import (
model "github.com/HFO4/cloudreve/models"
"github.com/HFO4/cloudreve/pkg/cache"
"github.com/stretchr/testify/assert"
"testing" "testing"
model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/cloudreve/Cloudreve/v3/pkg/cache"
"github.com/stretchr/testify/assert"
) )
func TestRPCService_Init(t *testing.T) { func TestRPCService_Init(t *testing.T) {

@ -4,17 +4,18 @@ import (
"context" "context"
"encoding/json" "encoding/json"
"errors" "errors"
model "github.com/HFO4/cloudreve/models"
"github.com/HFO4/cloudreve/pkg/aria2/rpc"
"github.com/HFO4/cloudreve/pkg/filesystem"
"github.com/HFO4/cloudreve/pkg/filesystem/driver/local"
"github.com/HFO4/cloudreve/pkg/filesystem/fsctx"
"github.com/HFO4/cloudreve/pkg/task"
"github.com/HFO4/cloudreve/pkg/util"
"os" "os"
"path/filepath" "path/filepath"
"strconv" "strconv"
"time" "time"
model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/cloudreve/Cloudreve/v3/pkg/aria2/rpc"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/driver/local"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/fsctx"
"github.com/cloudreve/Cloudreve/v3/pkg/task"
"github.com/cloudreve/Cloudreve/v3/pkg/util"
) )
// Monitor 离线下载状态监控 // Monitor 离线下载状态监控

@ -2,18 +2,19 @@ package aria2
import ( import (
"errors" "errors"
"testing"
"time"
"github.com/DATA-DOG/go-sqlmock" "github.com/DATA-DOG/go-sqlmock"
model "github.com/HFO4/cloudreve/models" model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/HFO4/cloudreve/pkg/aria2/rpc" "github.com/cloudreve/Cloudreve/v3/pkg/aria2/rpc"
"github.com/HFO4/cloudreve/pkg/cache" "github.com/cloudreve/Cloudreve/v3/pkg/cache"
"github.com/HFO4/cloudreve/pkg/filesystem" "github.com/cloudreve/Cloudreve/v3/pkg/filesystem"
"github.com/HFO4/cloudreve/pkg/task" "github.com/cloudreve/Cloudreve/v3/pkg/task"
"github.com/HFO4/cloudreve/pkg/util" "github.com/cloudreve/Cloudreve/v3/pkg/util"
"github.com/jinzhu/gorm" "github.com/jinzhu/gorm"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
testMock "github.com/stretchr/testify/mock" testMock "github.com/stretchr/testify/mock"
"testing"
"time"
) )
type InstanceMock struct { type InstanceMock struct {

@ -1,8 +1,9 @@
package aria2 package aria2
import ( import (
"github.com/HFO4/cloudreve/pkg/aria2/rpc"
"sync" "sync"
"github.com/cloudreve/Cloudreve/v3/pkg/aria2/rpc"
) )
// Notifier aria2实践通知处理 // Notifier aria2实践通知处理

@ -1,9 +1,10 @@
package aria2 package aria2
import ( import (
"github.com/HFO4/cloudreve/pkg/aria2/rpc"
"github.com/stretchr/testify/assert"
"testing" "testing"
"github.com/cloudreve/Cloudreve/v3/pkg/aria2/rpc"
"github.com/stretchr/testify/assert"
) )
func TestNotifier_Notify(t *testing.T) { func TestNotifier_Notify(t *testing.T) {

@ -2,15 +2,16 @@ package auth
import ( import (
"bytes" "bytes"
model "github.com/HFO4/cloudreve/models"
"github.com/HFO4/cloudreve/pkg/conf"
"github.com/HFO4/cloudreve/pkg/serializer"
"github.com/HFO4/cloudreve/pkg/util"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
"net/url" "net/url"
"strings" "strings"
"time" "time"
model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/cloudreve/Cloudreve/v3/pkg/conf"
"github.com/cloudreve/Cloudreve/v3/pkg/serializer"
"github.com/cloudreve/Cloudreve/v3/pkg/util"
) )
var ( var (

@ -1,12 +1,13 @@
package auth package auth
import ( import (
"github.com/HFO4/cloudreve/pkg/util"
"github.com/stretchr/testify/assert"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
"strings" "strings"
"testing" "testing"
"github.com/cloudreve/Cloudreve/v3/pkg/util"
"github.com/stretchr/testify/assert"
) )
func TestSignURI(t *testing.T) { func TestSignURI(t *testing.T) {

@ -3,15 +3,16 @@ package auth
import ( import (
"database/sql" "database/sql"
"fmt" "fmt"
"testing"
"time"
"github.com/DATA-DOG/go-sqlmock" "github.com/DATA-DOG/go-sqlmock"
model "github.com/HFO4/cloudreve/models" model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/HFO4/cloudreve/pkg/conf" "github.com/cloudreve/Cloudreve/v3/pkg/conf"
"github.com/HFO4/cloudreve/pkg/util" "github.com/cloudreve/Cloudreve/v3/pkg/util"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/jinzhu/gorm" "github.com/jinzhu/gorm"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"testing"
"time"
) )
var mock sqlmock.Sqlmock var mock sqlmock.Sqlmock

@ -1,7 +1,7 @@
package authn package authn
import ( import (
model "github.com/HFO4/cloudreve/models" model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/duo-labs/webauthn/webauthn" "github.com/duo-labs/webauthn/webauthn"
) )

@ -1,9 +1,10 @@
package authn package authn
import ( import (
"github.com/HFO4/cloudreve/pkg/cache"
"github.com/stretchr/testify/assert"
"testing" "testing"
"github.com/cloudreve/Cloudreve/v3/pkg/cache"
"github.com/stretchr/testify/assert"
) )
func TestInit(t *testing.T) { func TestInit(t *testing.T) {

@ -1,7 +1,7 @@
package cache package cache
import ( import (
"github.com/HFO4/cloudreve/pkg/conf" "github.com/cloudreve/Cloudreve/v3/pkg/conf"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )

3
pkg/cache/memo.go vendored

@ -1,9 +1,10 @@
package cache package cache
import ( import (
"github.com/HFO4/cloudreve/pkg/util"
"sync" "sync"
"time" "time"
"github.com/cloudreve/Cloudreve/v3/pkg/util"
) )
// MemoStore 内存存储驱动 // MemoStore 内存存储驱动

@ -3,10 +3,11 @@ package cache
import ( import (
"bytes" "bytes"
"encoding/gob" "encoding/gob"
"github.com/HFO4/cloudreve/pkg/util"
"github.com/gomodule/redigo/redis"
"strconv" "strconv"
"time" "time"
"github.com/cloudreve/Cloudreve/v3/pkg/util"
"github.com/gomodule/redigo/redis"
) )
// RedisStore redis存储驱动 // RedisStore redis存储驱动

@ -1,7 +1,7 @@
package conf package conf
import ( import (
"github.com/HFO4/cloudreve/pkg/util" "github.com/cloudreve/Cloudreve/v3/pkg/util"
"github.com/go-ini/ini" "github.com/go-ini/ini"
"gopkg.in/go-playground/validator.v9" "gopkg.in/go-playground/validator.v9"
) )
@ -34,7 +34,7 @@ type ssl struct {
} }
type unix struct { type unix struct {
Listen string Listen string
} }
// slave 作为slave存储端配置 // slave 作为slave存储端配置

@ -1,11 +1,12 @@
package conf package conf
import ( import (
"github.com/HFO4/cloudreve/pkg/util"
"github.com/stretchr/testify/assert"
"io/ioutil" "io/ioutil"
"os" "os"
"testing" "testing"
"github.com/cloudreve/Cloudreve/v3/pkg/util"
"github.com/stretchr/testify/assert"
) )
// 测试Init日志路径错误 // 测试Init日志路径错误

@ -1,13 +1,14 @@
package crontab package crontab
import ( import (
model "github.com/HFO4/cloudreve/models"
"github.com/HFO4/cloudreve/pkg/cache"
"github.com/HFO4/cloudreve/pkg/util"
"os" "os"
"path/filepath" "path/filepath"
"strings" "strings"
"time" "time"
model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/cloudreve/Cloudreve/v3/pkg/cache"
"github.com/cloudreve/Cloudreve/v3/pkg/util"
) )
func garbageCollect() { func garbageCollect() {

@ -1,8 +1,8 @@
package crontab package crontab
import ( import (
model "github.com/HFO4/cloudreve/models" model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/HFO4/cloudreve/pkg/util" "github.com/cloudreve/Cloudreve/v3/pkg/util"
"github.com/robfig/cron/v3" "github.com/robfig/cron/v3"
) )

@ -1,9 +1,10 @@
package email package email
import ( import (
model "github.com/HFO4/cloudreve/models"
"github.com/HFO4/cloudreve/pkg/util"
"sync" "sync"
model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/cloudreve/Cloudreve/v3/pkg/util"
) )
// Client 默认的邮件发送客户端 // Client 默认的邮件发送客户端

@ -1,9 +1,10 @@
package email package email
import ( import (
"github.com/HFO4/cloudreve/pkg/util"
"github.com/go-mail/mail"
"time" "time"
"github.com/cloudreve/Cloudreve/v3/pkg/util"
"github.com/go-mail/mail"
) )
// SMTP SMTP协议发送邮件 // SMTP SMTP协议发送邮件

@ -2,8 +2,9 @@ package email
import ( import (
"fmt" "fmt"
model "github.com/HFO4/cloudreve/models"
"github.com/HFO4/cloudreve/pkg/util" model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/cloudreve/Cloudreve/v3/pkg/util"
) )
// NewActivationEmail 新建激活邮件 // NewActivationEmail 新建激活邮件

@ -5,12 +5,6 @@ import (
"bytes" "bytes"
"context" "context"
"fmt" "fmt"
model "github.com/HFO4/cloudreve/models"
"github.com/HFO4/cloudreve/pkg/filesystem/fsctx"
"github.com/HFO4/cloudreve/pkg/util"
"github.com/gin-gonic/gin"
"golang.org/x/text/encoding/simplifiedchinese"
"golang.org/x/text/transform"
"io" "io"
"io/ioutil" "io/ioutil"
"os" "os"
@ -19,6 +13,13 @@ import (
"strings" "strings"
"sync" "sync"
"time" "time"
model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/fsctx"
"github.com/cloudreve/Cloudreve/v3/pkg/util"
"github.com/gin-gonic/gin"
"golang.org/x/text/encoding/simplifiedchinese"
"golang.org/x/text/transform"
) )
/* =============== /* ===============

@ -3,19 +3,20 @@ package filesystem
import ( import (
"context" "context"
"errors" "errors"
"github.com/DATA-DOG/go-sqlmock"
model "github.com/HFO4/cloudreve/models"
"github.com/HFO4/cloudreve/pkg/cache"
"github.com/HFO4/cloudreve/pkg/filesystem/fsctx"
"github.com/HFO4/cloudreve/pkg/request"
"github.com/HFO4/cloudreve/pkg/util"
"github.com/jinzhu/gorm"
"github.com/stretchr/testify/assert"
testMock "github.com/stretchr/testify/mock"
"io" "io"
"os" "os"
"strings" "strings"
"testing" "testing"
"github.com/DATA-DOG/go-sqlmock"
model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/cloudreve/Cloudreve/v3/pkg/cache"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/fsctx"
"github.com/cloudreve/Cloudreve/v3/pkg/request"
"github.com/cloudreve/Cloudreve/v3/pkg/util"
"github.com/jinzhu/gorm"
"github.com/stretchr/testify/assert"
testMock "github.com/stretchr/testify/mock"
) )
func TestFileSystem_Compress(t *testing.T) { func TestFileSystem_Compress(t *testing.T) {

@ -8,13 +8,6 @@ import (
"encoding/json" "encoding/json"
"errors" "errors"
"fmt" "fmt"
model "github.com/HFO4/cloudreve/models"
"github.com/HFO4/cloudreve/pkg/filesystem/fsctx"
"github.com/HFO4/cloudreve/pkg/filesystem/response"
"github.com/HFO4/cloudreve/pkg/request"
"github.com/HFO4/cloudreve/pkg/serializer"
"github.com/google/go-querystring/query"
cossdk "github.com/tencentyun/cos-go-sdk-v5"
"io" "io"
"net/http" "net/http"
"net/url" "net/url"
@ -22,6 +15,14 @@ import (
"path/filepath" "path/filepath"
"strings" "strings"
"time" "time"
model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/fsctx"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/response"
"github.com/cloudreve/Cloudreve/v3/pkg/request"
"github.com/cloudreve/Cloudreve/v3/pkg/serializer"
"github.com/google/go-querystring/query"
cossdk "github.com/tencentyun/cos-go-sdk-v5"
) )
// UploadPolicy 腾讯云COS上传策略 // UploadPolicy 腾讯云COS上传策略

@ -4,17 +4,18 @@ import (
"archive/zip" "archive/zip"
"bytes" "bytes"
"encoding/base64" "encoding/base64"
model "github.com/HFO4/cloudreve/models"
"github.com/HFO4/cloudreve/pkg/hashid"
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common"
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile"
scf "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/scf/v20180416"
"io" "io"
"io/ioutil" "io/ioutil"
"net/url" "net/url"
"strconv" "strconv"
"strings" "strings"
"time" "time"
model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/cloudreve/Cloudreve/v3/pkg/hashid"
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common"
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile"
scf "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/scf/v20180416"
) )
const scfFunc = `# -*- coding: utf8 -*- const scfFunc = `# -*- coding: utf8 -*-

@ -4,18 +4,19 @@ import (
"context" "context"
"errors" "errors"
"fmt" "fmt"
model "github.com/HFO4/cloudreve/models"
"github.com/HFO4/cloudreve/pkg/auth"
"github.com/HFO4/cloudreve/pkg/cache"
"github.com/HFO4/cloudreve/pkg/conf"
"github.com/HFO4/cloudreve/pkg/filesystem/fsctx"
"github.com/HFO4/cloudreve/pkg/filesystem/response"
"github.com/HFO4/cloudreve/pkg/serializer"
"github.com/HFO4/cloudreve/pkg/util"
"io" "io"
"net/url" "net/url"
"os" "os"
"path/filepath" "path/filepath"
model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/cloudreve/Cloudreve/v3/pkg/auth"
"github.com/cloudreve/Cloudreve/v3/pkg/cache"
"github.com/cloudreve/Cloudreve/v3/pkg/conf"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/fsctx"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/response"
"github.com/cloudreve/Cloudreve/v3/pkg/serializer"
"github.com/cloudreve/Cloudreve/v3/pkg/util"
) )
// Driver 本地策略适配器 // Driver 本地策略适配器

@ -2,19 +2,20 @@ package local
import ( import (
"context" "context"
model "github.com/HFO4/cloudreve/models"
"github.com/HFO4/cloudreve/pkg/auth"
"github.com/HFO4/cloudreve/pkg/conf"
"github.com/HFO4/cloudreve/pkg/filesystem/fsctx"
"github.com/HFO4/cloudreve/pkg/util"
"github.com/jinzhu/gorm"
"github.com/stretchr/testify/assert"
"io" "io"
"io/ioutil" "io/ioutil"
"net/url" "net/url"
"os" "os"
"strings" "strings"
"testing" "testing"
model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/cloudreve/Cloudreve/v3/pkg/auth"
"github.com/cloudreve/Cloudreve/v3/pkg/conf"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/fsctx"
"github.com/cloudreve/Cloudreve/v3/pkg/util"
"github.com/jinzhu/gorm"
"github.com/stretchr/testify/assert"
) )
func TestHandler_Put(t *testing.T) { func TestHandler_Put(t *testing.T) {

@ -6,11 +6,6 @@ import (
"encoding/json" "encoding/json"
"errors" "errors"
"fmt" "fmt"
model "github.com/HFO4/cloudreve/models"
"github.com/HFO4/cloudreve/pkg/cache"
"github.com/HFO4/cloudreve/pkg/filesystem/fsctx"
"github.com/HFO4/cloudreve/pkg/request"
"github.com/HFO4/cloudreve/pkg/util"
"io" "io"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
@ -19,6 +14,12 @@ import (
"strconv" "strconv"
"strings" "strings"
"time" "time"
model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/cloudreve/Cloudreve/v3/pkg/cache"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/fsctx"
"github.com/cloudreve/Cloudreve/v3/pkg/request"
"github.com/cloudreve/Cloudreve/v3/pkg/util"
) )
const ( const (

@ -4,16 +4,17 @@ import (
"context" "context"
"errors" "errors"
"fmt" "fmt"
model "github.com/HFO4/cloudreve/models"
"github.com/HFO4/cloudreve/pkg/cache"
"github.com/HFO4/cloudreve/pkg/request"
"github.com/stretchr/testify/assert"
testMock "github.com/stretchr/testify/mock"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
"strings" "strings"
"testing" "testing"
"time" "time"
model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/cloudreve/Cloudreve/v3/pkg/cache"
"github.com/cloudreve/Cloudreve/v3/pkg/request"
"github.com/stretchr/testify/assert"
testMock "github.com/stretchr/testify/mock"
) )
func TestRequest(t *testing.T) { func TestRequest(t *testing.T) {

@ -2,8 +2,9 @@ package onedrive
import ( import (
"errors" "errors"
model "github.com/HFO4/cloudreve/models"
"github.com/HFO4/cloudreve/pkg/request" model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/cloudreve/Cloudreve/v3/pkg/request"
) )
var ( var (

@ -1,9 +1,10 @@
package onedrive package onedrive
import ( import (
model "github.com/HFO4/cloudreve/models"
"github.com/stretchr/testify/assert"
"testing" "testing"
model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/stretchr/testify/assert"
) )
func TestNewClient(t *testing.T) { func TestNewClient(t *testing.T) {

@ -4,18 +4,19 @@ import (
"context" "context"
"errors" "errors"
"fmt" "fmt"
model "github.com/HFO4/cloudreve/models"
"github.com/HFO4/cloudreve/pkg/cache"
"github.com/HFO4/cloudreve/pkg/filesystem/fsctx"
"github.com/HFO4/cloudreve/pkg/filesystem/response"
"github.com/HFO4/cloudreve/pkg/request"
"github.com/HFO4/cloudreve/pkg/serializer"
"io" "io"
"net/url" "net/url"
"path" "path"
"path/filepath" "path/filepath"
"strings" "strings"
"time" "time"
model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/cloudreve/Cloudreve/v3/pkg/cache"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/fsctx"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/response"
"github.com/cloudreve/Cloudreve/v3/pkg/request"
"github.com/cloudreve/Cloudreve/v3/pkg/serializer"
) )
// Driver OneDrive 适配器 // Driver OneDrive 适配器

@ -2,14 +2,6 @@ package onedrive
import ( import (
"context" "context"
"github.com/DATA-DOG/go-sqlmock"
model "github.com/HFO4/cloudreve/models"
"github.com/HFO4/cloudreve/pkg/cache"
"github.com/HFO4/cloudreve/pkg/filesystem/fsctx"
"github.com/HFO4/cloudreve/pkg/request"
"github.com/HFO4/cloudreve/pkg/serializer"
"github.com/stretchr/testify/assert"
testMock "github.com/stretchr/testify/mock"
"io" "io"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
@ -17,6 +9,15 @@ import (
"strings" "strings"
"testing" "testing"
"time" "time"
"github.com/DATA-DOG/go-sqlmock"
model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/cloudreve/Cloudreve/v3/pkg/cache"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/fsctx"
"github.com/cloudreve/Cloudreve/v3/pkg/request"
"github.com/cloudreve/Cloudreve/v3/pkg/serializer"
"github.com/stretchr/testify/assert"
testMock "github.com/stretchr/testify/mock"
) )
func TestDriver_Token(t *testing.T) { func TestDriver_Token(t *testing.T) {

@ -3,14 +3,15 @@ package onedrive
import ( import (
"context" "context"
"encoding/json" "encoding/json"
"github.com/HFO4/cloudreve/pkg/cache"
"github.com/HFO4/cloudreve/pkg/request"
"github.com/HFO4/cloudreve/pkg/util"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
"net/url" "net/url"
"strings" "strings"
"time" "time"
"github.com/cloudreve/Cloudreve/v3/pkg/cache"
"github.com/cloudreve/Cloudreve/v3/pkg/request"
"github.com/cloudreve/Cloudreve/v3/pkg/util"
) )
// Error 实现error接口 // Error 实现error接口

@ -4,13 +4,6 @@ import (
"context" "context"
"database/sql" "database/sql"
"errors" "errors"
"github.com/DATA-DOG/go-sqlmock"
model "github.com/HFO4/cloudreve/models"
"github.com/HFO4/cloudreve/pkg/cache"
"github.com/HFO4/cloudreve/pkg/request"
"github.com/jinzhu/gorm"
"github.com/stretchr/testify/assert"
testMock "github.com/stretchr/testify/mock"
"io" "io"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
@ -18,6 +11,14 @@ import (
"strings" "strings"
"testing" "testing"
"time" "time"
"github.com/DATA-DOG/go-sqlmock"
model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/cloudreve/Cloudreve/v3/pkg/cache"
"github.com/cloudreve/Cloudreve/v3/pkg/request"
"github.com/jinzhu/gorm"
"github.com/stretchr/testify/assert"
testMock "github.com/stretchr/testify/mock"
) )
var mock sqlmock.Sqlmock var mock sqlmock.Sqlmock

@ -10,12 +10,13 @@ import (
"encoding/pem" "encoding/pem"
"errors" "errors"
"fmt" "fmt"
"github.com/HFO4/cloudreve/pkg/cache"
"github.com/HFO4/cloudreve/pkg/request"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
"net/url" "net/url"
"strings" "strings"
"github.com/cloudreve/Cloudreve/v3/pkg/cache"
"github.com/cloudreve/Cloudreve/v3/pkg/request"
) )
// GetPublicKey 从回调请求或缓存中获取OSS的回调签名公钥 // GetPublicKey 从回调请求或缓存中获取OSS的回调签名公钥

@ -1,13 +1,14 @@
package oss package oss
import ( import (
"github.com/HFO4/cloudreve/pkg/cache"
"github.com/stretchr/testify/assert"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
"net/url" "net/url"
"strings" "strings"
"testing" "testing"
"github.com/cloudreve/Cloudreve/v3/pkg/cache"
"github.com/stretchr/testify/assert"
) )
func TestGetPublicKey(t *testing.T) { func TestGetPublicKey(t *testing.T) {

@ -8,19 +8,20 @@ import (
"encoding/json" "encoding/json"
"errors" "errors"
"fmt" "fmt"
model "github.com/HFO4/cloudreve/models"
"github.com/HFO4/cloudreve/pkg/filesystem/fsctx"
"github.com/HFO4/cloudreve/pkg/filesystem/response"
"github.com/HFO4/cloudreve/pkg/request"
"github.com/HFO4/cloudreve/pkg/serializer"
"github.com/HFO4/cloudreve/pkg/util"
"github.com/aliyun/aliyun-oss-go-sdk/oss"
"io" "io"
"net/url" "net/url"
"path" "path"
"path/filepath" "path/filepath"
"strings" "strings"
"time" "time"
"github.com/aliyun/aliyun-oss-go-sdk/oss"
model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/fsctx"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/response"
"github.com/cloudreve/Cloudreve/v3/pkg/request"
"github.com/cloudreve/Cloudreve/v3/pkg/serializer"
"github.com/cloudreve/Cloudreve/v3/pkg/util"
) )
// UploadPolicy 阿里云OSS上传策略 // UploadPolicy 阿里云OSS上传策略

@ -2,18 +2,19 @@ package oss
import ( import (
"context" "context"
model "github.com/HFO4/cloudreve/models"
"github.com/HFO4/cloudreve/pkg/cache"
"github.com/HFO4/cloudreve/pkg/filesystem/fsctx"
"github.com/HFO4/cloudreve/pkg/request"
"github.com/stretchr/testify/assert"
testMock "github.com/stretchr/testify/mock"
"io" "io"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
"net/url" "net/url"
"strings" "strings"
"testing" "testing"
model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/cloudreve/Cloudreve/v3/pkg/cache"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/fsctx"
"github.com/cloudreve/Cloudreve/v3/pkg/request"
"github.com/stretchr/testify/assert"
testMock "github.com/stretchr/testify/mock"
) )
func TestDriver_InitOSSClient(t *testing.T) { func TestDriver_InitOSSClient(t *testing.T) {

@ -4,13 +4,6 @@ import (
"context" "context"
"errors" "errors"
"fmt" "fmt"
model "github.com/HFO4/cloudreve/models"
"github.com/HFO4/cloudreve/pkg/filesystem/fsctx"
"github.com/HFO4/cloudreve/pkg/filesystem/response"
"github.com/HFO4/cloudreve/pkg/request"
"github.com/HFO4/cloudreve/pkg/serializer"
"github.com/qiniu/api.v7/v7/auth/qbox"
"github.com/qiniu/api.v7/v7/storage"
"io" "io"
"net/http" "net/http"
"net/url" "net/url"
@ -18,6 +11,14 @@ import (
"path/filepath" "path/filepath"
"strings" "strings"
"time" "time"
model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/fsctx"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/response"
"github.com/cloudreve/Cloudreve/v3/pkg/request"
"github.com/cloudreve/Cloudreve/v3/pkg/serializer"
"github.com/qiniu/api.v7/v7/auth/qbox"
"github.com/qiniu/api.v7/v7/storage"
) )
// Driver 本地策略适配器 // Driver 本地策略适配器

@ -6,18 +6,19 @@ import (
"encoding/json" "encoding/json"
"errors" "errors"
"fmt" "fmt"
model "github.com/HFO4/cloudreve/models"
"github.com/HFO4/cloudreve/pkg/auth"
"github.com/HFO4/cloudreve/pkg/filesystem/fsctx"
"github.com/HFO4/cloudreve/pkg/filesystem/response"
"github.com/HFO4/cloudreve/pkg/request"
"github.com/HFO4/cloudreve/pkg/serializer"
"io" "io"
"net/http" "net/http"
"net/url" "net/url"
"path" "path"
"strings" "strings"
"time" "time"
model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/cloudreve/Cloudreve/v3/pkg/auth"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/fsctx"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/response"
"github.com/cloudreve/Cloudreve/v3/pkg/request"
"github.com/cloudreve/Cloudreve/v3/pkg/serializer"
) )
// Driver 远程存储策略适配器 // Driver 远程存储策略适配器

@ -2,20 +2,21 @@ package remote
import ( import (
"context" "context"
model "github.com/HFO4/cloudreve/models"
"github.com/HFO4/cloudreve/pkg/auth"
"github.com/HFO4/cloudreve/pkg/cache"
"github.com/HFO4/cloudreve/pkg/filesystem/fsctx"
"github.com/HFO4/cloudreve/pkg/request"
"github.com/HFO4/cloudreve/pkg/serializer"
"github.com/stretchr/testify/assert"
testMock "github.com/stretchr/testify/mock"
"io" "io"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
"net/url" "net/url"
"strings" "strings"
"testing" "testing"
model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/cloudreve/Cloudreve/v3/pkg/auth"
"github.com/cloudreve/Cloudreve/v3/pkg/cache"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/fsctx"
"github.com/cloudreve/Cloudreve/v3/pkg/request"
"github.com/cloudreve/Cloudreve/v3/pkg/serializer"
"github.com/stretchr/testify/assert"
testMock "github.com/stretchr/testify/mock"
) )
func TestHandler_Token(t *testing.T) { func TestHandler_Token(t *testing.T) {

@ -17,16 +17,16 @@ import (
"sync" "sync"
"time" "time"
model "github.com/HFO4/cloudreve/models"
"github.com/HFO4/cloudreve/pkg/filesystem/fsctx"
"github.com/HFO4/cloudreve/pkg/filesystem/response"
"github.com/HFO4/cloudreve/pkg/request"
"github.com/HFO4/cloudreve/pkg/serializer"
"github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3" "github.com/aws/aws-sdk-go/service/s3"
"github.com/aws/aws-sdk-go/service/s3/s3manager" "github.com/aws/aws-sdk-go/service/s3/s3manager"
model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/fsctx"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/response"
"github.com/cloudreve/Cloudreve/v3/pkg/request"
"github.com/cloudreve/Cloudreve/v3/pkg/serializer"
) )
// Driver 适配器模板 // Driver 适配器模板

@ -3,11 +3,12 @@ package template
import ( import (
"context" "context"
"errors" "errors"
model "github.com/HFO4/cloudreve/models"
"github.com/HFO4/cloudreve/pkg/filesystem/response"
"github.com/HFO4/cloudreve/pkg/serializer"
"io" "io"
"net/url" "net/url"
model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/response"
"github.com/cloudreve/Cloudreve/v3/pkg/serializer"
) )
// Driver 适配器模板 // Driver 适配器模板

@ -9,12 +9,6 @@ import (
"encoding/json" "encoding/json"
"errors" "errors"
"fmt" "fmt"
model "github.com/HFO4/cloudreve/models"
"github.com/HFO4/cloudreve/pkg/filesystem/fsctx"
"github.com/HFO4/cloudreve/pkg/filesystem/response"
"github.com/HFO4/cloudreve/pkg/request"
"github.com/HFO4/cloudreve/pkg/serializer"
"github.com/upyun/go-sdk/upyun"
"io" "io"
"net/http" "net/http"
"net/url" "net/url"
@ -23,6 +17,13 @@ import (
"strings" "strings"
"sync" "sync"
"time" "time"
model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/fsctx"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/response"
"github.com/cloudreve/Cloudreve/v3/pkg/request"
"github.com/cloudreve/Cloudreve/v3/pkg/serializer"
"github.com/upyun/go-sdk/upyun"
) )
// UploadPolicy 又拍云上传策略 // UploadPolicy 又拍云上传策略

@ -2,7 +2,8 @@ package filesystem
import ( import (
"errors" "errors"
"github.com/HFO4/cloudreve/pkg/serializer"
"github.com/cloudreve/Cloudreve/v3/pkg/serializer"
) )
var ( var (

@ -2,14 +2,15 @@ package filesystem
import ( import (
"context" "context"
model "github.com/HFO4/cloudreve/models"
"github.com/HFO4/cloudreve/pkg/conf"
"github.com/HFO4/cloudreve/pkg/filesystem/fsctx"
"github.com/HFO4/cloudreve/pkg/filesystem/response"
"github.com/HFO4/cloudreve/pkg/serializer"
"github.com/HFO4/cloudreve/pkg/util"
"github.com/juju/ratelimit"
"io" "io"
model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/cloudreve/Cloudreve/v3/pkg/conf"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/fsctx"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/response"
"github.com/cloudreve/Cloudreve/v3/pkg/serializer"
"github.com/cloudreve/Cloudreve/v3/pkg/util"
"github.com/juju/ratelimit"
) )
/* ============ /* ============

@ -2,18 +2,19 @@ package filesystem
import ( import (
"context" "context"
"os"
"testing"
"github.com/DATA-DOG/go-sqlmock" "github.com/DATA-DOG/go-sqlmock"
model "github.com/HFO4/cloudreve/models" model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/HFO4/cloudreve/pkg/auth" "github.com/cloudreve/Cloudreve/v3/pkg/auth"
"github.com/HFO4/cloudreve/pkg/cache" "github.com/cloudreve/Cloudreve/v3/pkg/cache"
"github.com/HFO4/cloudreve/pkg/filesystem/driver/local" "github.com/cloudreve/Cloudreve/v3/pkg/filesystem/driver/local"
"github.com/HFO4/cloudreve/pkg/filesystem/fsctx" "github.com/cloudreve/Cloudreve/v3/pkg/filesystem/fsctx"
"github.com/HFO4/cloudreve/pkg/serializer" "github.com/cloudreve/Cloudreve/v3/pkg/serializer"
"github.com/HFO4/cloudreve/pkg/util" "github.com/cloudreve/Cloudreve/v3/pkg/util"
"github.com/jinzhu/gorm" "github.com/jinzhu/gorm"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"os"
"testing"
) )
func TestFileSystem_AddFile(t *testing.T) { func TestFileSystem_AddFile(t *testing.T) {

@ -8,20 +8,20 @@ import (
"net/url" "net/url"
"sync" "sync"
model "github.com/HFO4/cloudreve/models" model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/HFO4/cloudreve/pkg/auth" "github.com/cloudreve/Cloudreve/v3/pkg/auth"
"github.com/HFO4/cloudreve/pkg/conf" "github.com/cloudreve/Cloudreve/v3/pkg/conf"
"github.com/HFO4/cloudreve/pkg/filesystem/driver/cos" "github.com/cloudreve/Cloudreve/v3/pkg/filesystem/driver/cos"
"github.com/HFO4/cloudreve/pkg/filesystem/driver/local" "github.com/cloudreve/Cloudreve/v3/pkg/filesystem/driver/local"
"github.com/HFO4/cloudreve/pkg/filesystem/driver/onedrive" "github.com/cloudreve/Cloudreve/v3/pkg/filesystem/driver/onedrive"
"github.com/HFO4/cloudreve/pkg/filesystem/driver/oss" "github.com/cloudreve/Cloudreve/v3/pkg/filesystem/driver/oss"
"github.com/HFO4/cloudreve/pkg/filesystem/driver/qiniu" "github.com/cloudreve/Cloudreve/v3/pkg/filesystem/driver/qiniu"
"github.com/HFO4/cloudreve/pkg/filesystem/driver/remote" "github.com/cloudreve/Cloudreve/v3/pkg/filesystem/driver/remote"
"github.com/HFO4/cloudreve/pkg/filesystem/driver/s3" "github.com/cloudreve/Cloudreve/v3/pkg/filesystem/driver/s3"
"github.com/HFO4/cloudreve/pkg/filesystem/driver/upyun" "github.com/cloudreve/Cloudreve/v3/pkg/filesystem/driver/upyun"
"github.com/HFO4/cloudreve/pkg/filesystem/response" "github.com/cloudreve/Cloudreve/v3/pkg/filesystem/response"
"github.com/HFO4/cloudreve/pkg/request" "github.com/cloudreve/Cloudreve/v3/pkg/request"
"github.com/HFO4/cloudreve/pkg/serializer" "github.com/cloudreve/Cloudreve/v3/pkg/serializer"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
cossdk "github.com/tencentyun/cos-go-sdk-v5" cossdk "github.com/tencentyun/cos-go-sdk-v5"
) )

@ -1,15 +1,16 @@
package filesystem package filesystem
import ( import (
"net/http/httptest"
"github.com/DATA-DOG/go-sqlmock" "github.com/DATA-DOG/go-sqlmock"
model "github.com/HFO4/cloudreve/models" model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/HFO4/cloudreve/pkg/cache" "github.com/cloudreve/Cloudreve/v3/pkg/cache"
"github.com/HFO4/cloudreve/pkg/filesystem/driver/local" "github.com/cloudreve/Cloudreve/v3/pkg/filesystem/driver/local"
"github.com/HFO4/cloudreve/pkg/filesystem/driver/remote" "github.com/cloudreve/Cloudreve/v3/pkg/filesystem/driver/remote"
"github.com/HFO4/cloudreve/pkg/serializer" "github.com/cloudreve/Cloudreve/v3/pkg/serializer"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"net/http/httptest"
"testing" "testing"
) )

@ -3,14 +3,15 @@ package filesystem
import ( import (
"context" "context"
"errors" "errors"
model "github.com/HFO4/cloudreve/models"
"github.com/HFO4/cloudreve/pkg/conf"
"github.com/HFO4/cloudreve/pkg/filesystem/fsctx"
"github.com/HFO4/cloudreve/pkg/request"
"github.com/HFO4/cloudreve/pkg/serializer"
"github.com/HFO4/cloudreve/pkg/util"
"io/ioutil" "io/ioutil"
"strings" "strings"
model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/cloudreve/Cloudreve/v3/pkg/conf"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/fsctx"
"github.com/cloudreve/Cloudreve/v3/pkg/request"
"github.com/cloudreve/Cloudreve/v3/pkg/serializer"
"github.com/cloudreve/Cloudreve/v3/pkg/util"
) )
// Hook 钩子函数 // Hook 钩子函数

@ -3,23 +3,24 @@ package filesystem
import ( import (
"context" "context"
"errors" "errors"
"github.com/DATA-DOG/go-sqlmock"
model "github.com/HFO4/cloudreve/models"
"github.com/HFO4/cloudreve/pkg/cache"
"github.com/HFO4/cloudreve/pkg/conf"
"github.com/HFO4/cloudreve/pkg/filesystem/driver/local"
"github.com/HFO4/cloudreve/pkg/filesystem/fsctx"
"github.com/HFO4/cloudreve/pkg/request"
"github.com/HFO4/cloudreve/pkg/serializer"
"github.com/jinzhu/gorm"
"github.com/stretchr/testify/assert"
testMock "github.com/stretchr/testify/mock"
"io" "io"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
"os" "os"
"strings" "strings"
"testing" "testing"
"github.com/DATA-DOG/go-sqlmock"
model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/cloudreve/Cloudreve/v3/pkg/cache"
"github.com/cloudreve/Cloudreve/v3/pkg/conf"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/driver/local"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/fsctx"
"github.com/cloudreve/Cloudreve/v3/pkg/request"
"github.com/cloudreve/Cloudreve/v3/pkg/serializer"
"github.com/jinzhu/gorm"
"github.com/stretchr/testify/assert"
testMock "github.com/stretchr/testify/mock"
) )
func TestGenericBeforeUpload(t *testing.T) { func TestGenericBeforeUpload(t *testing.T) {

@ -3,13 +3,14 @@ package filesystem
import ( import (
"context" "context"
"fmt" "fmt"
model "github.com/HFO4/cloudreve/models"
"github.com/HFO4/cloudreve/pkg/conf"
"github.com/HFO4/cloudreve/pkg/filesystem/fsctx"
"github.com/HFO4/cloudreve/pkg/filesystem/response"
"github.com/HFO4/cloudreve/pkg/thumb"
"github.com/HFO4/cloudreve/pkg/util"
"strconv" "strconv"
model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/cloudreve/Cloudreve/v3/pkg/conf"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/fsctx"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/response"
"github.com/cloudreve/Cloudreve/v3/pkg/thumb"
"github.com/cloudreve/Cloudreve/v3/pkg/util"
) )
/* ================ /* ================

@ -2,12 +2,13 @@ package filesystem
import ( import (
"context" "context"
model "github.com/HFO4/cloudreve/models" "testing"
"github.com/HFO4/cloudreve/pkg/cache"
"github.com/HFO4/cloudreve/pkg/filesystem/response" model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/cloudreve/Cloudreve/v3/pkg/cache"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/response"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
testMock "github.com/stretchr/testify/mock" testMock "github.com/stretchr/testify/mock"
"testing"
) )
func TestFileSystem_GetThumb(t *testing.T) { func TestFileSystem_GetThumb(t *testing.T) {

@ -3,13 +3,14 @@ package filesystem
import ( import (
"context" "context"
"fmt" "fmt"
model "github.com/HFO4/cloudreve/models"
"github.com/HFO4/cloudreve/pkg/filesystem/fsctx"
"github.com/HFO4/cloudreve/pkg/hashid"
"github.com/HFO4/cloudreve/pkg/serializer"
"github.com/HFO4/cloudreve/pkg/util"
"path" "path"
"strings" "strings"
model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/fsctx"
"github.com/cloudreve/Cloudreve/v3/pkg/hashid"
"github.com/cloudreve/Cloudreve/v3/pkg/serializer"
"github.com/cloudreve/Cloudreve/v3/pkg/util"
) )
/* ================= /* =================

@ -3,19 +3,20 @@ package filesystem
import ( import (
"context" "context"
"errors" "errors"
"os"
"testing"
"github.com/DATA-DOG/go-sqlmock" "github.com/DATA-DOG/go-sqlmock"
model "github.com/HFO4/cloudreve/models" model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/HFO4/cloudreve/pkg/cache" "github.com/cloudreve/Cloudreve/v3/pkg/cache"
"github.com/HFO4/cloudreve/pkg/conf" "github.com/cloudreve/Cloudreve/v3/pkg/conf"
"github.com/HFO4/cloudreve/pkg/filesystem/fsctx" "github.com/cloudreve/Cloudreve/v3/pkg/filesystem/fsctx"
"github.com/HFO4/cloudreve/pkg/filesystem/response" "github.com/cloudreve/Cloudreve/v3/pkg/filesystem/response"
"github.com/HFO4/cloudreve/pkg/serializer" "github.com/cloudreve/Cloudreve/v3/pkg/serializer"
"github.com/HFO4/cloudreve/pkg/util" "github.com/cloudreve/Cloudreve/v3/pkg/util"
"github.com/jinzhu/gorm" "github.com/jinzhu/gorm"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
testMock "github.com/stretchr/testify/mock" testMock "github.com/stretchr/testify/mock"
"os"
"testing"
) )
func TestFileSystem_ListPhysical(t *testing.T) { func TestFileSystem_ListPhysical(t *testing.T) {

@ -1,9 +1,10 @@
package filesystem package filesystem
import ( import (
model "github.com/HFO4/cloudreve/models"
"github.com/HFO4/cloudreve/pkg/util"
"path" "path"
model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/cloudreve/Cloudreve/v3/pkg/util"
) )
/* ================= /* =================

@ -1,11 +1,12 @@
package filesystem package filesystem
import ( import (
"testing"
"github.com/DATA-DOG/go-sqlmock" "github.com/DATA-DOG/go-sqlmock"
model "github.com/HFO4/cloudreve/models" model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/jinzhu/gorm" "github.com/jinzhu/gorm"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"testing"
) )
func TestFileSystem_IsFileExist(t *testing.T) { func TestFileSystem_IsFileExist(t *testing.T) {

@ -2,17 +2,18 @@ package filesystem
import ( import (
"context" "context"
model "github.com/HFO4/cloudreve/models"
"github.com/HFO4/cloudreve/pkg/cache"
"github.com/HFO4/cloudreve/pkg/filesystem/driver/local"
"github.com/HFO4/cloudreve/pkg/filesystem/fsctx"
"github.com/HFO4/cloudreve/pkg/request"
"github.com/HFO4/cloudreve/pkg/serializer"
"github.com/HFO4/cloudreve/pkg/util"
"github.com/gin-gonic/gin"
"io" "io"
"os" "os"
"path" "path"
model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/cloudreve/Cloudreve/v3/pkg/cache"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/driver/local"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/fsctx"
"github.com/cloudreve/Cloudreve/v3/pkg/request"
"github.com/cloudreve/Cloudreve/v3/pkg/serializer"
"github.com/cloudreve/Cloudreve/v3/pkg/util"
"github.com/gin-gonic/gin"
) )
/* ================ /* ================

@ -3,16 +3,6 @@ package filesystem
import ( import (
"context" "context"
"errors" "errors"
model "github.com/HFO4/cloudreve/models"
"github.com/HFO4/cloudreve/pkg/cache"
"github.com/HFO4/cloudreve/pkg/filesystem/driver/local"
"github.com/HFO4/cloudreve/pkg/filesystem/fsctx"
"github.com/HFO4/cloudreve/pkg/filesystem/response"
"github.com/HFO4/cloudreve/pkg/serializer"
"github.com/gin-gonic/gin"
"github.com/jinzhu/gorm"
"github.com/stretchr/testify/assert"
testMock "github.com/stretchr/testify/mock"
"io" "io"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
@ -20,6 +10,17 @@ import (
"net/url" "net/url"
"strings" "strings"
"testing" "testing"
model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/cloudreve/Cloudreve/v3/pkg/cache"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/driver/local"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/fsctx"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/response"
"github.com/cloudreve/Cloudreve/v3/pkg/serializer"
"github.com/gin-gonic/gin"
"github.com/jinzhu/gorm"
"github.com/stretchr/testify/assert"
testMock "github.com/stretchr/testify/mock"
) )
type FileHeaderMock struct { type FileHeaderMock struct {

@ -2,9 +2,10 @@ package filesystem
import ( import (
"context" "context"
"github.com/HFO4/cloudreve/pkg/util"
"path/filepath" "path/filepath"
"strings" "strings"
"github.com/cloudreve/Cloudreve/v3/pkg/util"
) )
/* ========== /* ==========

@ -3,12 +3,13 @@ package filesystem
import ( import (
"context" "context"
"database/sql" "database/sql"
"testing"
"github.com/DATA-DOG/go-sqlmock" "github.com/DATA-DOG/go-sqlmock"
model "github.com/HFO4/cloudreve/models" model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/HFO4/cloudreve/pkg/cache" "github.com/cloudreve/Cloudreve/v3/pkg/cache"
"github.com/jinzhu/gorm" "github.com/jinzhu/gorm"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"testing"
) )
var mock sqlmock.Sqlmock var mock sqlmock.Sqlmock

@ -2,9 +2,10 @@ package hashid
import ( import (
"errors" "errors"
"github.com/HFO4/cloudreve/pkg/conf"
"github.com/cloudreve/Cloudreve/v3/pkg/conf"
"github.com/speps/go-hashids"
) )
import "github.com/speps/go-hashids"
// ID类型 // ID类型
const ( const (

@ -5,14 +5,15 @@ import (
"encoding/json" "encoding/json"
"errors" "errors"
"fmt" "fmt"
model "github.com/HFO4/cloudreve/models"
"github.com/HFO4/cloudreve/pkg/auth"
"github.com/HFO4/cloudreve/pkg/serializer"
"github.com/HFO4/cloudreve/pkg/util"
"io" "io"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
"time" "time"
model "github.com/cloudreve/Cloudreve/v3/models"
"github.com/cloudreve/Cloudreve/v3/pkg/auth"
"github.com/cloudreve/Cloudreve/v3/pkg/serializer"
"github.com/cloudreve/Cloudreve/v3/pkg/util"
) )
// GeneralClient 通用 HTTP Client // GeneralClient 通用 HTTP Client

@ -3,15 +3,16 @@ package request
import ( import (
"context" "context"
"errors" "errors"
"github.com/HFO4/cloudreve/pkg/auth"
"github.com/stretchr/testify/assert"
testMock "github.com/stretchr/testify/mock"
"io" "io"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
"strings" "strings"
"testing" "testing"
"time" "time"
"github.com/cloudreve/Cloudreve/v3/pkg/auth"
"github.com/stretchr/testify/assert"
testMock "github.com/stretchr/testify/mock"
) )
type ClientMock struct { type ClientMock struct {

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save