diff --git a/go.mod b/go.mod index bff7188..efcc43e 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/internal/config/config.go b/internal/config/config.go index 61b6e51..1f742bf 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -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 { diff --git a/internal/services/cmd/object.go b/internal/services/cmd/object.go index cb2773f..c25ab76 100644 --- a/internal/services/cmd/object.go +++ b/internal/services/cmd/object.go @@ -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 { diff --git a/internal/services/cmd/service.go b/internal/services/cmd/service.go index 8e73ba4..9585c4b 100644 --- a/internal/services/cmd/service.go +++ b/internal/services/cmd/service.go @@ -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 diff --git a/internal/services/cmd/storage.go b/internal/services/cmd/storage.go index 58eb18e..b5ab147 100644 --- a/internal/services/cmd/storage.go +++ b/internal/services/cmd/storage.go @@ -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" diff --git a/internal/services/grpc/grpc_service.go b/internal/services/grpc/grpc_service.go index 97c389e..4a76b0b 100644 --- a/internal/services/grpc/grpc_service.go +++ b/internal/services/grpc/grpc_service.go @@ -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 { diff --git a/internal/task/executor.go b/internal/task/executor.go index 906d546..6d559cb 100644 --- a/internal/task/executor.go +++ b/internal/task/executor.go @@ -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" ) diff --git a/main.go b/main.go index 1b84219..1fee565 100644 --- a/main.go +++ b/main.go @@ -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" diff --git a/status_report.go b/status_report.go index d8a65e6..cee86be 100644 --- a/status_report.go +++ b/status_report.go @@ -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 由于数据结构未定,暂时不发送真实数据