Browse Source

utils移动到common库下的一个包中

gitlink
Sydonian 2 years ago
parent
commit
a1a43ee995
9 changed files with 17 additions and 20 deletions
  1. +0
    -3
      go.mod
  2. +3
    -3
      internal/config/config.go
  3. +1
    -1
      internal/services/cmd/object.go
  4. +1
    -1
      internal/services/cmd/service.go
  5. +3
    -3
      internal/services/cmd/storage.go
  6. +3
    -3
      internal/services/grpc/grpc_service.go
  7. +1
    -1
      internal/task/executor.go
  8. +2
    -2
      main.go
  9. +3
    -3
      status_report.go

+ 0
- 3
go.mod View File

@@ -5,7 +5,6 @@ require (
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/utils v0.0.0
google.golang.org/grpc v1.54.0
)

@@ -65,8 +64,6 @@ go 1.18
//
// replace gitlink.org.cn/cloudream/rabbitmq => ../rabbitmq
//
// replace gitlink.org.cn/cloudream/utils => ../utils
//
// replace gitlink.org.cn/cloudream/common => ../common
//
// replace gitlink.org.cn/cloudream/db => ../db

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

@@ -1,10 +1,10 @@
package config

import (
c "gitlink.org.cn/cloudream/common/utils/config"
"gitlink.org.cn/cloudream/common/utils/ipfs"
log "gitlink.org.cn/cloudream/common/utils/logger"
racfg "gitlink.org.cn/cloudream/rabbitmq/config"
c "gitlink.org.cn/cloudream/utils/config"
"gitlink.org.cn/cloudream/utils/ipfs"
log "gitlink.org.cn/cloudream/utils/logger"
)

type Config struct {


+ 1
- 1
internal/services/cmd/object.go View File

@@ -2,9 +2,9 @@ package cmd

import (
"gitlink.org.cn/cloudream/common/consts/errorcode"
log "gitlink.org.cn/cloudream/common/utils/logger"
ramsg "gitlink.org.cn/cloudream/rabbitmq/message"
agtmsg "gitlink.org.cn/cloudream/rabbitmq/message/agent"
log "gitlink.org.cn/cloudream/utils/logger"
)

func (svc *Service) PinObject(msg *agtmsg.PinObject) *agtmsg.PinObjectResp {


+ 1
- 1
internal/services/cmd/service.go View File

@@ -1,6 +1,6 @@
package cmd

import "gitlink.org.cn/cloudream/utils/ipfs"
import "gitlink.org.cn/cloudream/common/utils/ipfs"

type Service struct {
ipfs *ipfs.IPFS


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

@@ -9,10 +9,10 @@ import (

"gitlink.org.cn/cloudream/agent/internal/config"
"gitlink.org.cn/cloudream/common/consts"
"gitlink.org.cn/cloudream/common/utils"
log "gitlink.org.cn/cloudream/common/utils/logger"
"gitlink.org.cn/cloudream/common/utils/serder"
"gitlink.org.cn/cloudream/ec"
"gitlink.org.cn/cloudream/utils"
log "gitlink.org.cn/cloudream/utils/logger"
"gitlink.org.cn/cloudream/utils/serder"

"gitlink.org.cn/cloudream/common/consts/errorcode"
ramsg "gitlink.org.cn/cloudream/rabbitmq/message"


+ 3
- 3
internal/services/grpc/grpc_service.go View File

@@ -4,10 +4,10 @@ import (
"fmt"
"io"

myio "gitlink.org.cn/cloudream/common/utils/io"
"gitlink.org.cn/cloudream/common/utils/ipfs"
log "gitlink.org.cn/cloudream/common/utils/logger"
agentserver "gitlink.org.cn/cloudream/proto"
myio "gitlink.org.cn/cloudream/utils/io"
"gitlink.org.cn/cloudream/utils/ipfs"
log "gitlink.org.cn/cloudream/utils/logger"
)

type GRPCService struct {


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

@@ -5,9 +5,9 @@ import (
"sync"

"github.com/zyedidia/generic/list"
"gitlink.org.cn/cloudream/common/utils/ipfs"
mydb "gitlink.org.cn/cloudream/db"
sccli "gitlink.org.cn/cloudream/rabbitmq/client/scanner"
"gitlink.org.cn/cloudream/utils/ipfs"
"golang.org/x/sync/semaphore"
)



+ 2
- 2
main.go View File

@@ -7,9 +7,9 @@ import (
"sync"

"gitlink.org.cn/cloudream/agent/internal/config"
"gitlink.org.cn/cloudream/common/utils/ipfs"
log "gitlink.org.cn/cloudream/common/utils/logger"
agentserver "gitlink.org.cn/cloudream/proto"
"gitlink.org.cn/cloudream/utils/ipfs"
log "gitlink.org.cn/cloudream/utils/logger"

"google.golang.org/grpc"



+ 3
- 3
status_report.go View File

@@ -6,10 +6,10 @@ import (

"gitlink.org.cn/cloudream/agent/internal/config"
"gitlink.org.cn/cloudream/common/consts"
"gitlink.org.cn/cloudream/common/utils"
log "gitlink.org.cn/cloudream/common/utils/logger"
coorcli "gitlink.org.cn/cloudream/rabbitmq/client/coordinator"
coormsg "gitlink.org.cn/cloudream/rabbitmq/message/coordinator"
"gitlink.org.cn/cloudream/utils"
log "gitlink.org.cn/cloudream/utils/logger"
)

func reportStatus(wg *sync.WaitGroup) {
@@ -52,7 +52,7 @@ func reportStatus(wg *sync.WaitGroup) {
//TODO: 查看本地IPFS daemon是否正常,记录到ipfsStatus
ipfsStatus := consts.IPFS_STATUS_OK
//TODO:访问自身资源目录(配置文件中获取路径),记录是否正常,记录到localDirStatus
localDirStatus := consts.LOCAL_DIR_STATUS_OK
localDirStatus := consts.STORAGE_DIRECTORY_STATUS_OK

//发送心跳
// TODO 由于数据结构未定,暂时不发送真实数据


Loading…
Cancel
Save