Browse Source

调整项目结构

gitlink
Sydonian 2 years ago
parent
commit
0a041f8735
16 changed files with 43 additions and 52 deletions
  1. +5
    -14
      go.mod
  2. +2
    -2
      go.sum
  3. +1
    -1
      internal/cmdline/scanner.go
  4. +1
    -1
      internal/config/config.go
  5. +2
    -2
      internal/services/bucket.go
  6. +7
    -7
      internal/services/client_command_ec.go
  7. +5
    -5
      internal/services/object.go
  8. +2
    -2
      internal/services/service.go
  9. +3
    -3
      internal/services/storage.go
  10. +1
    -1
      internal/task/move_dir_to_storage.go
  11. +3
    -3
      internal/task/move_object_to_storage.go
  12. +1
    -1
      internal/task/task.go
  13. +1
    -1
      internal/task/update_rep_object.go
  14. +1
    -1
      internal/task/update_rep_object_test.go
  15. +6
    -6
      internal/task/upload_rep_objects.go
  16. +2
    -2
      main.go

+ 5
- 14
go.mod View File

@@ -8,10 +8,7 @@ require (
github.com/samber/lo v1.38.1
github.com/smartystreets/goconvey v1.8.0
gitlink.org.cn/cloudream/common v0.0.0
gitlink.org.cn/cloudream/db v0.0.0
gitlink.org.cn/cloudream/ec v0.0.0
gitlink.org.cn/cloudream/proto v0.0.0
gitlink.org.cn/cloudream/rabbitmq v0.0.0
gitlink.org.cn/cloudream/storage-common v0.0.0
google.golang.org/grpc v1.54.0
)

@@ -72,7 +69,7 @@ require (
github.com/sirupsen/logrus v1.9.2 // indirect
github.com/smartystreets/assertions v1.13.1 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/streadway/amqp v1.0.0 // indirect
github.com/streadway/amqp v1.1.0 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
github.com/whyrusleeping/tar-utils v0.0.0-20180509141711-8c6c8ba81d5c // indirect
@@ -97,12 +94,6 @@ require (
)

// 运行go mod tidy时需要将下面几行取消注释
// replace gitlink.org.cn/cloudream/rabbitmq => ../rabbitmq
//
// replace gitlink.org.cn/cloudream/ec => ../ec
//
// replace gitlink.org.cn/cloudream/proto => ../proto
//
// replace gitlink.org.cn/cloudream/db => ../db
//
// replace gitlink.org.cn/cloudream/common => ../common
replace gitlink.org.cn/cloudream/common => ../../common

replace gitlink.org.cn/cloudream/storage-common => ../storage-common

+ 2
- 2
go.sum View File

@@ -141,8 +141,8 @@ github.com/smartystreets/goconvey v1.8.0 h1:Oi49ha/2MURE0WexF052Z0m+BNSGirfjg5RL
github.com/smartystreets/goconvey v1.8.0/go.mod h1:EdX8jtrTIj26jmjCOVNMVSIYAtgexqXKHOXW2Dx9JLg=
github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=
github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/streadway/amqp v1.0.0 h1:kuuDrUJFZL1QYL9hUNuCxNObNzB0bV/ZG5jV3RWAQgo=
github.com/streadway/amqp v1.0.0/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw=
github.com/streadway/amqp v1.1.0 h1:py12iX8XSyI7aN/3dUT8DFIDJazNJsVJdxNVEpnQTZM=
github.com/streadway/amqp v1.1.0/go.mod h1:WYSrTEYHOXHd0nwFeUXAe2G2hRnQT+deZJJf88uS9Bg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=


+ 1
- 1
internal/cmdline/scanner.go View File

@@ -5,7 +5,7 @@ import (

"gitlink.org.cn/cloudream/common/pkg/cmdtrie"
myreflect "gitlink.org.cn/cloudream/common/utils/reflect"
scevt "gitlink.org.cn/cloudream/rabbitmq/message/scanner/event"
scevt "gitlink.org.cn/cloudream/storage-common/pkgs/mq/message/scanner/event"
)

var parseScannerEventCmdTrie cmdtrie.StaticCommandTrie[any] = cmdtrie.NewStaticCommandTrie[any]()


+ 1
- 1
internal/config/config.go View File

@@ -5,7 +5,7 @@ import (
"gitlink.org.cn/cloudream/common/pkg/logger"
"gitlink.org.cn/cloudream/common/utils/config"
"gitlink.org.cn/cloudream/common/utils/ipfs"
racfg "gitlink.org.cn/cloudream/rabbitmq/config"
racfg "gitlink.org.cn/cloudream/storage-common/pkgs/mq/config"
)

type Config struct {


+ 2
- 2
internal/services/bucket.go View File

@@ -4,8 +4,8 @@ import (
"fmt"

"gitlink.org.cn/cloudream/common/pkg/distlock/reqbuilder"
"gitlink.org.cn/cloudream/db/model"
coormsg "gitlink.org.cn/cloudream/rabbitmq/message/coordinator"
"gitlink.org.cn/cloudream/storage-common/pkgs/db/model"
coormsg "gitlink.org.cn/cloudream/storage-common/pkgs/mq/message/coordinator"
)

type BucketService struct {


+ 7
- 7
internal/services/client_command_ec.go View File

@@ -13,17 +13,17 @@ import (
"time"

"gitlink.org.cn/cloudream/common/utils"
"gitlink.org.cn/cloudream/ec"
"gitlink.org.cn/cloudream/storage-client/internal/config"
"gitlink.org.cn/cloudream/storage-common/pkgs/ec"

//"gitlink.org.cn/cloudream/common/pkg/distlock/reqbuilder"
log "gitlink.org.cn/cloudream/common/pkg/logger"
mygrpc "gitlink.org.cn/cloudream/common/utils/grpc"
agentcaller "gitlink.org.cn/cloudream/proto"
agtcli "gitlink.org.cn/cloudream/rabbitmq/client/agent"
ramsg "gitlink.org.cn/cloudream/rabbitmq/message"
agtmsg "gitlink.org.cn/cloudream/rabbitmq/message/agent"
coormsg "gitlink.org.cn/cloudream/rabbitmq/message/coordinator"
agtcli "gitlink.org.cn/cloudream/storage-common/pkgs/mq/client/agent"
ramsg "gitlink.org.cn/cloudream/storage-common/pkgs/mq/message"
agtmsg "gitlink.org.cn/cloudream/storage-common/pkgs/mq/message/agent"
coormsg "gitlink.org.cn/cloudream/storage-common/pkgs/mq/message/coordinator"
agentcaller "gitlink.org.cn/cloudream/storage-common/pkgs/proto"
mygrpc "gitlink.org.cn/cloudream/storage-common/utils/grpc"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
)


+ 5
- 5
internal/services/object.go View File

@@ -8,14 +8,14 @@ import (

"gitlink.org.cn/cloudream/common/pkg/distlock/reqbuilder"
log "gitlink.org.cn/cloudream/common/pkg/logger"
mygrpc "gitlink.org.cn/cloudream/common/utils/grpc"
myio "gitlink.org.cn/cloudream/common/utils/io"
"gitlink.org.cn/cloudream/db/model"
agentcaller "gitlink.org.cn/cloudream/proto"
ramsg "gitlink.org.cn/cloudream/rabbitmq/message"
coormsg "gitlink.org.cn/cloudream/rabbitmq/message/coordinator"
"gitlink.org.cn/cloudream/storage-client/internal/config"
"gitlink.org.cn/cloudream/storage-client/internal/task"
"gitlink.org.cn/cloudream/storage-common/pkgs/db/model"
ramsg "gitlink.org.cn/cloudream/storage-common/pkgs/mq/message"
coormsg "gitlink.org.cn/cloudream/storage-common/pkgs/mq/message/coordinator"
agentcaller "gitlink.org.cn/cloudream/storage-common/pkgs/proto"
mygrpc "gitlink.org.cn/cloudream/storage-common/utils/grpc"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"



+ 2
- 2
internal/services/service.go View File

@@ -3,9 +3,9 @@ package services
import (
distlock "gitlink.org.cn/cloudream/common/pkg/distlock/service"
"gitlink.org.cn/cloudream/common/utils/ipfs"
racli "gitlink.org.cn/cloudream/rabbitmq/client/coordinator"
sccli "gitlink.org.cn/cloudream/rabbitmq/client/scanner"
"gitlink.org.cn/cloudream/storage-client/internal/task"
racli "gitlink.org.cn/cloudream/storage-common/pkgs/mq/client/coordinator"
sccli "gitlink.org.cn/cloudream/storage-common/pkgs/mq/client/scanner"
)

type Service struct {


+ 3
- 3
internal/services/storage.go View File

@@ -4,11 +4,11 @@ import (
"fmt"
"time"

agtcli "gitlink.org.cn/cloudream/rabbitmq/client/agent"
agtmsg "gitlink.org.cn/cloudream/rabbitmq/message/agent"
coormsg "gitlink.org.cn/cloudream/rabbitmq/message/coordinator"
"gitlink.org.cn/cloudream/storage-client/internal/config"
"gitlink.org.cn/cloudream/storage-client/internal/task"
agtcli "gitlink.org.cn/cloudream/storage-common/pkgs/mq/client/agent"
agtmsg "gitlink.org.cn/cloudream/storage-common/pkgs/mq/message/agent"
coormsg "gitlink.org.cn/cloudream/storage-common/pkgs/mq/message/coordinator"
)

type StorageService struct {


+ 1
- 1
internal/task/move_dir_to_storage.go View File

@@ -5,7 +5,7 @@ import (
"time"

"gitlink.org.cn/cloudream/common/pkg/distlock/reqbuilder"
coormsg "gitlink.org.cn/cloudream/rabbitmq/message/coordinator"
coormsg "gitlink.org.cn/cloudream/storage-common/pkgs/mq/message/coordinator"
)

type MoveDirToStorage struct {


+ 3
- 3
internal/task/move_object_to_storage.go View File

@@ -5,10 +5,10 @@ import (
"time"

"gitlink.org.cn/cloudream/common/pkg/distlock/reqbuilder"
agtcli "gitlink.org.cn/cloudream/rabbitmq/client/agent"
agtmsg "gitlink.org.cn/cloudream/rabbitmq/message/agent"
coormsg "gitlink.org.cn/cloudream/rabbitmq/message/coordinator"
"gitlink.org.cn/cloudream/storage-client/internal/config"
agtcli "gitlink.org.cn/cloudream/storage-common/pkgs/mq/client/agent"
agtmsg "gitlink.org.cn/cloudream/storage-common/pkgs/mq/message/agent"
coormsg "gitlink.org.cn/cloudream/storage-common/pkgs/mq/message/coordinator"
)

type MoveObjectToStorage struct {


+ 1
- 1
internal/task/task.go View File

@@ -4,7 +4,7 @@ import (
distsvc "gitlink.org.cn/cloudream/common/pkg/distlock/service"
"gitlink.org.cn/cloudream/common/pkg/task"
"gitlink.org.cn/cloudream/common/utils/ipfs"
coorcli "gitlink.org.cn/cloudream/rabbitmq/client/coordinator"
coorcli "gitlink.org.cn/cloudream/storage-common/pkgs/mq/client/coordinator"
)

type TaskContext struct {


+ 1
- 1
internal/task/update_rep_object.go View File

@@ -10,7 +10,7 @@ import (
mysort "gitlink.org.cn/cloudream/common/utils/sort"
"gitlink.org.cn/cloudream/storage-client/internal/config"

coormsg "gitlink.org.cn/cloudream/rabbitmq/message/coordinator"
coormsg "gitlink.org.cn/cloudream/storage-common/pkgs/mq/message/coordinator"
)

type UpdateRepObject struct {


+ 1
- 1
internal/task/update_rep_object_test.go View File

@@ -4,7 +4,7 @@ import (
"testing"

. "github.com/smartystreets/goconvey/convey"
coormsg "gitlink.org.cn/cloudream/rabbitmq/message/coordinator"
coormsg "gitlink.org.cn/cloudream/storage-common/pkgs/mq/message/coordinator"
)

func Test_chooseUpdateRepObjectNode(t *testing.T) {


+ 6
- 6
internal/task/upload_rep_objects.go View File

@@ -10,15 +10,15 @@ import (
"gitlink.org.cn/cloudream/common/pkg/distlock/reqbuilder"
"gitlink.org.cn/cloudream/common/pkg/logger"
"gitlink.org.cn/cloudream/common/utils"
mygrpc "gitlink.org.cn/cloudream/common/utils/grpc"
"gitlink.org.cn/cloudream/common/utils/ipfs"
"gitlink.org.cn/cloudream/storage-client/internal/config"
mygrpc "gitlink.org.cn/cloudream/storage-common/utils/grpc"

agentcaller "gitlink.org.cn/cloudream/proto"
agtcli "gitlink.org.cn/cloudream/rabbitmq/client/agent"
ramsg "gitlink.org.cn/cloudream/rabbitmq/message"
agtmsg "gitlink.org.cn/cloudream/rabbitmq/message/agent"
coormsg "gitlink.org.cn/cloudream/rabbitmq/message/coordinator"
agtcli "gitlink.org.cn/cloudream/storage-common/pkgs/mq/client/agent"
ramsg "gitlink.org.cn/cloudream/storage-common/pkgs/mq/message"
agtmsg "gitlink.org.cn/cloudream/storage-common/pkgs/mq/message/agent"
coormsg "gitlink.org.cn/cloudream/storage-common/pkgs/mq/message/coordinator"
agentcaller "gitlink.org.cn/cloudream/storage-common/pkgs/proto"

"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"


+ 2
- 2
main.go View File

@@ -9,12 +9,12 @@ import (
distlocksvc "gitlink.org.cn/cloudream/common/pkg/distlock/service"
log "gitlink.org.cn/cloudream/common/pkg/logger"
"gitlink.org.cn/cloudream/common/utils/ipfs"
coorcli "gitlink.org.cn/cloudream/rabbitmq/client/coordinator"
sccli "gitlink.org.cn/cloudream/rabbitmq/client/scanner"
"gitlink.org.cn/cloudream/storage-client/internal/cmdline"
"gitlink.org.cn/cloudream/storage-client/internal/config"
"gitlink.org.cn/cloudream/storage-client/internal/services"
"gitlink.org.cn/cloudream/storage-client/internal/task"
coorcli "gitlink.org.cn/cloudream/storage-common/pkgs/mq/client/coordinator"
sccli "gitlink.org.cn/cloudream/storage-common/pkgs/mq/client/scanner"
)

func main() {


Loading…
Cancel
Save