Browse Source

调整datamap模块架构

gitlink
Jake 1 year ago
parent
commit
5f3d43c8f4
31 changed files with 768 additions and 884 deletions
  1. +0
    -22
      client/internal/services/hub.go
  2. +0
    -4
      common/globals/pools.go
  3. +141
    -163
      common/models/datamap.go
  4. +0
    -60
      common/pkgs/mq/datamap/client.go
  5. +0
    -57
      common/pkgs/mq/datamap/hub.go
  6. +0
    -35
      common/pkgs/mq/datamap/object.go
  7. +0
    -72
      common/pkgs/mq/datamap/server.go
  8. +0
    -28
      datamap/internal/cmd/serve.go
  9. +42
    -14
      datamap/internal/config/config.go
  10. +0
    -42
      datamap/internal/db/blockdistribution.go
  11. +0
    -21
      datamap/internal/db/config/config.go
  12. +18
    -24
      datamap/internal/db/db.go
  13. +0
    -52
      datamap/internal/db/hub.go
  14. +0
    -24
      datamap/internal/db/hubrequest.go
  15. +0
    -36
      datamap/internal/db/object.go
  16. +0
    -36
      datamap/internal/db/storage.go
  17. +0
    -36
      datamap/internal/db/storagetransfercount.go
  18. +30
    -0
      datamap/internal/handlers/handlers.go
  19. +57
    -0
      datamap/internal/models/block.go
  20. +93
    -0
      datamap/internal/models/hubs.go
  21. +53
    -0
      datamap/internal/models/hubtrans.go
  22. +1
    -61
      datamap/internal/models/models.go
  23. +70
    -0
      datamap/internal/models/object.go
  24. +43
    -0
      datamap/internal/models/repository.go
  25. +0
    -22
      datamap/internal/mq/hub.go
  26. +80
    -0
      datamap/internal/mq/mq.go
  27. +0
    -15
      datamap/internal/mq/service.go
  28. +22
    -0
      datamap/internal/server/server.go
  29. +19
    -6
      datamap/main.go
  30. +28
    -18
      go.mod
  31. +71
    -36
      go.sum

+ 0
- 22
client/internal/services/hub.go View File

@@ -2,12 +2,9 @@ package services

import (
"fmt"
stgmod "gitlink.org.cn/cloudream/storage/common/models"

cdssdk "gitlink.org.cn/cloudream/common/sdks/storage"
stgglb "gitlink.org.cn/cloudream/storage/common/globals"
coormq "gitlink.org.cn/cloudream/storage/common/pkgs/mq/coordinator"
datamapmq "gitlink.org.cn/cloudream/storage/common/pkgs/mq/datamap"
)

// HubService 是关于节点操作的服务结构体
@@ -47,22 +44,3 @@ func (svc *HubService) GetHubs(hubIDs []cdssdk.HubID) ([]cdssdk.Hub, error) {
// 返回获取到的节点信息
return getResp.Hubs, nil
}

// GetHubStat 根据提供的节点ID列表,获取中心的总数据量

func (svc *HubService) GetHubStat(hubID cdssdk.HubID) (stgmod.HubStat, error) {
datamapCli, err := stgglb.DatamapMQPool.Acquire()
if err != nil {
return stgmod.HubStat{}, fmt.Errorf("new datamap client: %w", err)
}
defer stgglb.DatamapMQPool.Release(datamapCli)

getResp, err := datamapCli.GetHubStat(datamapmq.NewGetHubStat(hubID))
if err != nil {
return stgmod.HubStat{}, fmt.Errorf("requesting to datamap: %w", err)
}

return getResp.HubStat, nil
}

//

+ 0
- 4
common/globals/pools.go View File

@@ -5,7 +5,6 @@ import (
stgmq "gitlink.org.cn/cloudream/storage/common/pkgs/mq"
agtmq "gitlink.org.cn/cloudream/storage/common/pkgs/mq/agent"
coormq "gitlink.org.cn/cloudream/storage/common/pkgs/mq/coordinator"
datamap "gitlink.org.cn/cloudream/storage/common/pkgs/mq/datamap"
scmq "gitlink.org.cn/cloudream/storage/common/pkgs/mq/scanner"
)

@@ -15,8 +14,6 @@ var CoordinatorMQPool coormq.Pool

var ScannerMQPool scmq.Pool

var DatamapMQPool datamap.Pool

// InitMQPool
//
// @Description: 初始化MQ连接池
@@ -28,7 +25,6 @@ func InitMQPool(cfg *stgmq.Config) {

ScannerMQPool = scmq.NewPool(cfg)

DatamapMQPool = datamap.NewPool(cfg)
}

var AgentRPCPool *agtrpc.Pool


+ 141
- 163
common/models/datamap.go View File

@@ -2,46 +2,46 @@ package stgmod

import "time"

// HubStat 中心信息
// 每天一次,各节点统计自身当前的总数据量
// HubStat 中心信息 每天一次,各节点统计自身当前的总数据量

type Source struct {
Type string `json:"type"`
HubID string `json:"hubID"`
HubName string `json:"hubName"`
}
type HubStatBody struct {
MasterHubID int `json:"masterHubID"`
MasterHubAddress string `json:"masterHubAddress"`
StorageID int `json:"storageID"`
DataCount int `json:"dataCount"`
}
type HubStat struct {
Timestamp time.Time `json:"timestamp"`
Source struct {
Type string `json:"type"`
HubID string `json:"hubID"`
HubName string `json:"hubName"`
} `json:"source"`
Category string `json:"category"`
Body struct {
MasterHubID int `json:"masterHubID"`
MasterHubAddress string `json:"masterHubAddress"`
StorageID int `json:"storageID"`
DataCount int `json:"dataCount"`
} `json:"body"`
Timestamp time.Time `json:"timestamp"`
Source Source `json:"source"`
Category string `json:"category"`
Body HubStatBody `json:"body"`
}

// HubTrans 节点传输信息
// 每天一次,各节点统计自身当天向外部各个节点传输的总数据量

type HubTransBody struct {
SourceHubID int64 `json:"sourceHubID"`
TargetHubID int64 `json:"targetHubID"`
DataTransferCount int64 `json:"dataTransferCount"`
RequestCount int64 `json:"requestCount"`
FailedRequestCount int64 `json:"failedRequestCount"`
AvgTransferCount int64 `json:"avgTransferCount"`
MaxTransferCount int64 `json:"maxTransferCount"`
MinTransferCount int64 `json:"minTransferCount"`
StartTimestamp time.Time `json:"startTimestamp"`
EndTimestamp time.Time `json:"endTimestamp"`
}
type HubTrans struct {
Timestamp time.Time `json:"timestamp"`
Source struct {
Type string `json:"type"`
HubID string `json:"hubID"`
HubName string `json:"hubName"`
} `json:"source"`
Category string `json:"category"`
Body struct {
SourceHubID int `json:"sourceHubID"`
TargetHubID int `json:"targetHubID"`
DataTransferCount int `json:"dataTransferCount"`
RequestCount int `json:"requestCount"`
FailedRequestCount int `json:"failedRequestCount"`
AvgTransferCount int `json:"avgTransferCount"`
MaxTransferCount int `json:"maxTransferCount"`
MinTransferCount int `json:"minTransferCount"`
StartTimestamp time.Time `json:"startTimestamp"`
EndTimestamp time.Time `json:"endTimestamp"`
} `json:"body"`
Timestamp time.Time `json:"timestamp"`
Source Source `json:"source"`
Category string `json:"category"`
Body HubTransBody `json:"body"`
}

// BlockTransInfo 块传输信息
@@ -50,151 +50,129 @@ type HubTrans struct {
编解码(一变多、多变一、多变多)
删除
更新*/
type Block struct {
BlockType string `json:"blockType"`
Index string `json:"index"`
StorageID string `json:"storageID"`
}
type DataTransfer struct {
SourceStorageID string `json:"sourceStorageID"`
TargetStorageID string `json:"targetStorageID"`
DataTransferCount string `json:"dataTransferCount"`
}

type BlockChange struct {
Type string `json:"type"`
BlockType string `json:"blockType"`
Index string `json:"index"`
SourceStorageID string `json:"sourceStorageID"`
TargetStorageID string `json:"targetStorageID"`
DataTransferCount string `json:"dataTransferCount"`
Timestamp string `json:"timestamp"`
SourceBlocks []Block `json:"sourceBlocks,omitempty"`
TargetBlocks []Block `json:"targetBlocks,omitempty"`
DataTransfers []DataTransfer `json:"dataTransfers,omitempty"`
Blocks []Block `json:"blocks,omitempty"`
}

type BlockTransInfoBody struct {
Type string `json:"type"`
ObjectID string `json:"objectID"`
PackageID string `json:"packageID"`
BlockChanges []BlockChange `json:"blockChanges"`
}

type BlockTransInfo struct {
Timestamp time.Time `json:"timestamp"`
Source struct {
Type string `json:"type"`
HubID interface{} `json:"hubID"`
HubName interface{} `json:"hubName"`
} `json:"source"`
Category string `json:"category"`
Body struct {
Type string `json:"type"`
ObjectID interface{} `json:"objectID"`
PackageID interface{} `json:"packageID"`
BlockChanges []struct {
Type string `json:"type"`
BlockType interface{} `json:"blockType"`
Index interface{} `json:"index"`
SourceStorageID interface{} `json:"sourceStorageID"`
TargetStorageID interface{} `json:"targetStorageID"`
DataTransferCount interface{} `json:"dataTransferCount"`
Timestamp interface{} `json:"timestamp"`
SourceBlocks []struct {
BlockType interface{} `json:"blockType"`
Index interface{} `json:"index"`
StorageID interface{} `json:"storageID"`
} `json:"sourceBlocks,omitempty"`
TargetBlocks []struct {
BlockType interface{} `json:"blockType"`
Index interface{} `json:"index"`
StorageID interface{} `json:"storageID"`
} `json:"targetBlocks,omitempty"`
DataTransfers []struct {
SourceStorageID interface{} `json:"sourceStorageID"`
TargetStorageID interface{} `json:"targetStorageID"`
DataTransferCount interface{} `json:"dataTransferCount"`
} `json:"dataTransfers,omitempty"`
Blocks []struct {
BlockType interface{} `json:"blockType"`
Index interface{} `json:"index"`
StorageID interface{} `json:"storageID"`
} `json:"blocks,omitempty"`
} `json:"blockChanges"`
} `json:"body"`
Timestamp time.Time `json:"timestamp"`
Source Source `json:"source"`
Category string `json:"category"`
Body BlockTransInfoBody `json:"body"`
}

// BlockDistribution 块传输信息
// 每天一次,在调整完成后,将当天调整前后的布局情况一起推送
type BlockDistribution struct {
Timestamp time.Time `json:"timestamp"`
Source struct {
Type string `json:"type"`
HubID interface{} `json:"hubID"`
HubName interface{} `json:"hubName"`
} `json:"source"`
Category string `json:"category"`
Body struct {
Type string `json:"type"`
ObjectID interface{} `json:"objectID"`
PackageID interface{} `json:"packageID"`
BlockChanges []struct {
Type string `json:"type"`
BlockType interface{} `json:"blockType"`
Index interface{} `json:"index"`
SourceStorageID interface{} `json:"sourceStorageID"`
TargetStorageID interface{} `json:"targetStorageID"`
DataTransferCount interface{} `json:"dataTransferCount"`
Timestamp interface{} `json:"timestamp"`
SourceBlocks []struct {
BlockType interface{} `json:"blockType"`
Index interface{} `json:"index"`
StorageID interface{} `json:"storageID"`
} `json:"sourceBlocks,omitempty"`
TargetBlocks []struct {
BlockType interface{} `json:"blockType"`
Index interface{} `json:"index"`
StorageID interface{} `json:"storageID"`
} `json:"targetBlocks,omitempty"`
DataTransfers []struct {
SourceStorageID interface{} `json:"sourceStorageID"`
TargetStorageID interface{} `json:"targetStorageID"`
DataTransferCount interface{} `json:"dataTransferCount"`
} `json:"dataTransfers,omitempty"`
Blocks []struct {
BlockType interface{} `json:"blockType"`
Index interface{} `json:"index"`
StorageID interface{} `json:"storageID"`
} `json:"blocks,omitempty"`
} `json:"blockChanges"`
} `json:"body"`
Type string `json:"type"`
Index string `json:"index"`
StorageID string `json:"storageID"`
}

type Object struct {
ObjectID string `json:"objectID"`
PackageID string `json:"packageID"`
Path string `json:"path"`
Size int64 `json:"size"`
FileHash string `json:"fileHash"`
FaultTolerance string `json:"faultTolerance"`
Redundancy string `json:"redundancy"`
AvgAccessCost string `json:"avgAccessCost"`
BlockDistribution []BlockDistribution `json:"blockDistribution"`
DataTransfers []DataTransfer `json:"dataTransfers"`
}
type BlockDistributionBody struct {
Timestamp time.Time `json:"timestamp"`
Type string `json:"type"`
ObjectID string `json:"objectID"`
PackageID string `json:"packageID"`
SourceBlocks []Block `json:"sourceBlocks,omitempty"`
TargetBlocks []Block `json:"targetBlocks,omitempty"`
DataTransfers []DataTransfer `json:"dataTransfers,omitempty"`
Blocks []Block `json:"blocks,omitempty"`
}

type BlockDistributionInfo struct {
Timestamp time.Time `json:"timestamp"`
Source Source `json:"source"`
Category string `json:"category"`
Body BlockDistributionBody `json:"body"`
}

// ObjectUpdateInfo Object变化信息

type ObjectUpdateInfoBody struct {
Type string `json:"type"`
ObjectID string `json:"objectID"`
PackageID string `json:"packageID"`
Path string `json:"path"`
Size int `json:"size"`
BlockDistribution []BlockDistribution `json:"blockDistribution"`
Timestamp string `json:"timestamp"`
}
type ObjectUpdateInfo struct {
Timestamp time.Time `json:"timestamp"`
Source struct {
Type string `json:"type"`
HubID string `json:"hubID"`
HubName string `json:"hubName"`
} `json:"source"`
Category string `json:"category"`
Body struct {
Type string `json:"type"`
ObjectID string `json:"objectID"`
PackageID string `json:"packageID"`
Path string `json:"path"`
Size int `json:"size"`
BlockDistribution []struct {
Type string `json:"type,omitempty"`
Index string `json:"index,omitempty"`
StorageID string `json:"storageID,omitempty"`
} `json:"blockDistribution"`
Timestamp string `json:"timestamp"`
} `json:"body"`
Timestamp time.Time `json:"timestamp"`
Source Source `json:"source"`
Category string `json:"category"`
Body ObjectUpdateInfoBody `json:"body"`
}

// PackageUpdateInfo package变化信息

type PackageUpdateInfoBody struct {
Type string `json:"type"`
PackageID string `json:"packageID"`
PackageName string `json:"packageName"`
BucketID string `json:"bucketID"`
Timestamp string `json:"timestamp"`
}
type PackageUpdateInfo struct {
Timestamp time.Time `json:"timestamp"`
Source struct {
Type string `json:"type"`
HubID string `json:"hubID"`
HubName string `json:"hubName"`
} `json:"source"`
Category string `json:"category"`
Body struct {
Type string `json:"type"`
PackageID string `json:"packageID"`
PackageName string `json:"packageName"`
BucketID string `json:"bucketID"`
Timestamp string `json:"timestamp"`
} `json:"body"`
Timestamp time.Time `json:"timestamp"`
Source Source `json:"source"`
Category string `json:"category"`
Body PackageUpdateInfoBody `json:"body"`
}

// BucketUpdateInfo bucket变化信息

type BucketUpdateInfoBody struct {
Type string `json:"type"`
BucketID string `json:"bucketID"`
BucketName string `json:"bucketName"`
Timestamp string `json:"timestamp"`
}

type BucketUpdateInfo struct {
Timestamp time.Time `json:"timestamp"`
Source struct {
Type string `json:"type"`
HubID string `json:"hubID"`
HubName string `json:"hubName"`
} `json:"source"`
Category string `json:"category"`
Body struct {
Type string `json:"type"`
BucketID string `json:"bucketID"`
BucketName string `json:"bucketName"`
Timestamp string `json:"timestamp"`
} `json:"body"`
Timestamp time.Time `json:"timestamp"`
Source Source `json:"source"`
Category string `json:"category"`
Body BucketUpdateInfoBody `json:"body"`
}

+ 0
- 60
common/pkgs/mq/datamap/client.go View File

@@ -1,60 +0,0 @@
package datamap

import (
"sync"

"gitlink.org.cn/cloudream/common/pkgs/mq"
stgmq "gitlink.org.cn/cloudream/storage/common/pkgs/mq"
)

type Client struct {
rabbitCli *mq.RabbitMQTransport
}

func NewClient(cfg *stgmq.Config) (*Client, error) {
rabbitCli, err := mq.NewRabbitMQTransport(cfg.MakeConnectingURL(), stgmq.DATAMAP_QUEUE_NAME, "")
if err != nil {
return nil, err
}

return &Client{
rabbitCli: rabbitCli,
}, nil
}

func (c *Client) Close() {
c.rabbitCli.Close()
}

type Pool interface {
Acquire() (*Client, error)
Release(cli *Client)
}

type pool struct {
mqcfg *stgmq.Config
shared *Client
lock sync.Mutex
}

func NewPool(mqcfg *stgmq.Config) Pool {
return &pool{
mqcfg: mqcfg,
}
}
func (p *pool) Acquire() (*Client, error) {
p.lock.Lock()
defer p.lock.Unlock()
if p.shared == nil {
var err error
p.shared, err = NewClient(p.mqcfg)
if err != nil {
return nil, err
}
}

return p.shared, nil
}

func (p *pool) Release(cli *Client) {
}

+ 0
- 57
common/pkgs/mq/datamap/hub.go View File

@@ -1,57 +0,0 @@
package datamap

import (
"gitlink.org.cn/cloudream/common/pkgs/mq"
cdssdk "gitlink.org.cn/cloudream/common/sdks/storage"
stgmod "gitlink.org.cn/cloudream/storage/common/models"
)

type HubService interface {
GetHubStat(msg *GetHubStat) (*GetHubStatResp, *mq.CodeMessage)
GetHubTrans(msg *GetHubTrans) (*GetHubTransResp, *mq.CodeMessage)
}

// 查询中心自身当前的总数据量
var _ = Register(Service.GetHubStat)

type GetHubStat struct {
mq.MessageBodyBase
HubID cdssdk.HubID `json:"hubID"`
}
type GetHubStatResp struct {
mq.MessageBodyBase
HubStat stgmod.HubStat `json:"hubStat"`
}

func NewGetHubStat(hubID cdssdk.HubID) *GetHubStat {
return &GetHubStat{
HubID: hubID,
}
}
func NewGetHubStatResp(hubStat stgmod.HubStat) *GetHubStatResp {
return &GetHubStatResp{
HubStat: hubStat,
}
}
func (client *Client) GetHubStat(msg *GetHubStat) (*GetHubStatResp, error) {
return mq.Request(Service.GetHubStat, client.rabbitCli, msg)
}

// 查询中心节点传输的总数据量

var _ = Register(Service.GetHubTrans)

type GetHubTrans struct {
mq.MessageBodyBase
HubID cdssdk.HubID `json:"hubID"`
}

type GetHubTransResp struct {
mq.MessageBodyBase
HubTrans stgmod.HubTrans `json:"hubTrans"`
}

func (client *Client) GetHubTrans(msg *GetHubTrans) (*GetHubTransResp, error) {
//获取到传输统计之后
return mq.Request(Service.GetHubTrans, client.rabbitCli, msg)
}

+ 0
- 35
common/pkgs/mq/datamap/object.go View File

@@ -1,35 +0,0 @@
package datamap

import (
"gitlink.org.cn/cloudream/common/pkgs/mq"
cdssdk "gitlink.org.cn/cloudream/common/sdks/storage"
stgmod "gitlink.org.cn/cloudream/storage/common/models"
)

type ObjectService interface {
GetBlockTransInfo(msg *GetBlockTransInfo) (*GetBlockTransInfoResp, *mq.CodeMessage)
GetBlockDistribution(msg *GetBlockDistribution) (*GetBlockDistributionResp, *mq.CodeMessage)
}

type GetBlockTransInfo struct {
mq.MessageBodyBase
//todo 入参待确认
UserID cdssdk.UserID `json:"userID"`
PackageID cdssdk.PackageID `json:"packageID"`
}

type GetBlockTransInfoResp struct {
mq.MessageBodyBase
ObjectTransInfo stgmod.BlockTransInfo `json:"objectTransInfo"`
}

type GetBlockDistribution struct {
mq.MessageBodyBase
//todo 入参待确认
HubID cdssdk.HubID `json:"hubID"`
}

type GetBlockDistributionResp struct {
mq.MessageBodyBase
BlockDistribution stgmod.BlockDistribution `json:"blockDistribution"`
}

+ 0
- 72
common/pkgs/mq/datamap/server.go View File

@@ -1,72 +0,0 @@
package datamap

import (
"gitlink.org.cn/cloudream/common/pkgs/mq"
"gitlink.org.cn/cloudream/common/utils/sync2"
mymq "gitlink.org.cn/cloudream/storage/common/pkgs/mq"
)

type Service interface {
HubService
ObjectService
}

type Server struct {
service Service
rabbitSvr mq.RabbitMQServer
}

func NewServer(svc Service, cfg *mymq.Config) (*Server, error) {
srv := &Server{
service: svc,
}

rabbitSvr, err := mq.NewRabbitMQServer(
cfg.MakeConnectingURL(),
mymq.DATAMAP_QUEUE_NAME,
func(msg *mq.Message) (*mq.Message, error) {
return msgDispatcher.Handle(srv.service, msg)
},
cfg.Param,
)
if err != nil {
return nil, err
}

srv.rabbitSvr = *rabbitSvr

return srv, nil
}

func (s *Server) Stop() {
s.rabbitSvr.Close()
}

func (s *Server) Start(cfg mymq.Config) *sync2.UnboundChannel[mq.RabbitMQServerEvent] {
return s.rabbitSvr.Start()
}

func (s *Server) OnError(callback func(error)) {
s.rabbitSvr.OnError = callback
}

var msgDispatcher mq.MessageDispatcher = mq.NewMessageDispatcher()

// Register 将Service中的一个接口函数作为指定类型消息的处理函数,同时会注册请求和响应的消息类型
// TODO 需要约束:Service实现了TSvc接口
func Register[TReq mq.MessageBody, TResp mq.MessageBody](svcFn func(svc Service, msg TReq) (TResp, *mq.CodeMessage)) any {
mq.AddServiceFn(&msgDispatcher, svcFn)
mq.RegisterMessage[TReq]()
mq.RegisterMessage[TResp]()

return nil
}

// RegisterNoReply 将Service中的一个*没有返回值的*接口函数作为指定类型消息的处理函数,同时会注册请求和响应的消息类型
// TODO 需要约束:Service实现了TSvc接口
func RegisterNoReply[TReq mq.MessageBody](svcFn func(svc Service, msg TReq)) any {
mq.AddNoRespServiceFn(&msgDispatcher, svcFn)
mq.RegisterMessage[TReq]()

return nil
}

+ 0
- 28
datamap/internal/cmd/serve.go View File

@@ -1,28 +0,0 @@
package cmd

import (
"fmt"
"os"

"gitlink.org.cn/cloudream/common/pkgs/logger"
"gitlink.org.cn/cloudream/storage/datamap/internal/config"
)

func serve() {
err := config.Init()
if err != nil {
fmt.Printf("init config failed, err: %s", err.Error())
os.Exit(1)
}

err = logger.Init(&config.Cfg().Logger)
if err != nil {
fmt.Printf("init logger failed, err: %s", err.Error())
os.Exit(1)
}

// dataSvr, err := datamq.NewServer(mymq.NewService(db2), &config.Cfg().RabbitMQ)
// if err != nil {
// logger.Fatalf("new coordinator server failed, err: %s", err.Error())
// }
}

+ 42
- 14
datamap/internal/config/config.go View File

@@ -1,26 +1,54 @@
package config

import (
"gitlink.org.cn/cloudream/common/pkgs/distlock"
log "gitlink.org.cn/cloudream/common/pkgs/logger"
c "gitlink.org.cn/cloudream/common/utils/config"
db "gitlink.org.cn/cloudream/storage/common/pkgs/db2/config"
stgmq "gitlink.org.cn/cloudream/storage/common/pkgs/mq"
"github.com/spf13/viper"
)

type Config struct {
Logger log.Config `json:"logger"`
DB db.Config `json:"db"`
RabbitMQ stgmq.Config `json:"rabbitMQ"`
DistLock distlock.Config `json:"distlock"`
Database DatabaseConfig
RabbitMQ RabbitMQConfig
Server ServerConfig
}

var cfg Config
type DatabaseConfig struct {
Host string
Port string
User string
Password string
DBName string
}

type RabbitMQConfig struct {
Host string
Port string
User string
Password string
}

func Init() error {
return c.DefaultLoad("datamap", &cfg)
type ServerConfig struct {
Port string
}

func Cfg() *Config {
return &cfg
func LoadConfig() *Config {
viper.SetConfigFile(".env")
viper.ReadInConfig()

return &Config{
Database: DatabaseConfig{
Host: viper.GetString("DB_HOST"),
Port: viper.GetString("DB_PORT"),
User: viper.GetString("DB_USER"),
Password: viper.GetString("DB_PASSWORD"),
DBName: viper.GetString("DB_NAME"),
},
RabbitMQ: RabbitMQConfig{
Host: viper.GetString("RABBITMQ_HOST"),
Port: viper.GetString("RABBITMQ_PORT"),
User: viper.GetString("RABBITMQ_USER"),
Password: viper.GetString("RABBITMQ_PASSWORD"),
},
Server: ServerConfig{
Port: viper.GetString("SERVER_PORT"),
},
}
}

+ 0
- 42
datamap/internal/db/blockdistribution.go View File

@@ -1,42 +0,0 @@
package db

import "gitlink.org.cn/cloudream/storage/datamap/internal/models"

type BlockDistributionDB struct {
*DB
}

func (db *DB) BlockDistribution() *BlockDistributionDB {
return &BlockDistributionDB{DB: db}
}

// GetAllBlockDistribution 查询所有BlockDistribution列表
func (*HubDB) GetAllBlockDistribution(ctx SQLContext) ([]models.BlockDistribution, error) {
var ret []models.BlockDistribution

err := ctx.Table("blockdistribution").Find(&ret).Error
return ret, err
}

// GetBlockDistribution 根据输入的BlockID查询BlockDistribution
func (*HubDB) GetBlockDistribution(ctx SQLContext, BlockID int64) (models.BlockDistribution, error) {
var ret models.BlockDistribution
err := ctx.Table("blockdistribution").Where("BlockID = ?", BlockID).Find(&ret).Error
return ret, err
}

// CreateBlockDistribution 根据输入的BlockDistribution信息创建BlockDistribution记录
func (*HubDB) CreateBlockDistribution(ctx SQLContext, blockDistribution models.BlockDistribution) (*models.BlockDistribution, error) {
err := ctx.Table("blockdistribution").Create(&blockDistribution).Error
return &blockDistribution, err
}

// DeleteBlockDistribution 根据输入的BlockID删除BlockDistribution记录
func (*HubDB) DeleteBlockDistribution(ctx SQLContext, BlockID int64) error {
return ctx.Table("blockdistribution").Where("BlockID = ?", BlockID).Delete(&models.BlockDistribution{}).Error
}

// UpdateBlockDistribution 根据输入的BlockDistribution信息更新BlockDistribution记录
func (*HubDB) UpdateBlockDistribution(ctx SQLContext, blockDistribution models.BlockDistribution) error {
return ctx.Table("blockdistribution").Where("BlockID = ?", blockDistribution.BlockID).Updates(&blockDistribution).Error
}

+ 0
- 21
datamap/internal/db/config/config.go View File

@@ -1,21 +0,0 @@
package config

import "fmt"

type Config struct {
Address string `json:"address"`
Account string `json:"account"`
Password string `json:"password"`
DatabaseName string `json:"databaseName"`
}

func (cfg *Config) MakeSourceString() string {
return fmt.Sprintf(
"%s:%s@tcp(%s)/%s?charset=utf8mb4&parseTime=true&loc=%s",
cfg.Account,
cfg.Password,
cfg.Address,
cfg.DatabaseName,
"Asia%2FShanghai",
)
}

+ 18
- 24
datamap/internal/db/db.go View File

@@ -1,37 +1,31 @@
package db

import (
"github.com/sirupsen/logrus"
"gitlink.org.cn/cloudream/storage/datamap/internal/db/config"
"fmt"
"gitlink.org.cn/cloudream/storage/datamap/internal/config"
"gitlink.org.cn/cloudream/storage/datamap/internal/models"
"gorm.io/driver/mysql"
"gorm.io/gorm"
)

type DB struct {
db *gorm.DB
}
// 全局数据库连接实例
var DB *gorm.DB

func NewDB(cfg *config.Config) (*DB, error) {
mydb, err := gorm.Open(mysql.Open(cfg.MakeSourceString()), &gorm.Config{})
func InitDB(cfg config.DatabaseConfig) (*gorm.DB, error) {
dsn := fmt.Sprintf("%s:%s@tcp(%s:%s)/%s?charset=utf8mb4&parseTime=True&loc=Local",
cfg.User, cfg.Password, cfg.Host, cfg.Port, cfg.DBName)
db, err := gorm.Open(mysql.Open(dsn), &gorm.Config{})
if err != nil {
logrus.Fatalf("failed to connect to database: %v", err)
return nil, err
}

return &DB{
db: mydb,
}, nil
}

func (db *DB) DoTx(do func(tx SQLContext) error) error {
return db.db.Transaction(func(tx *gorm.DB) error {
return do(SQLContext{tx})
})
}

type SQLContext struct {
*gorm.DB
}
// 自动迁移表结构
db.AutoMigrate(
&models.Hub{},
&models.Storage{},
&models.HubRequest{},
&models.BlockDistribution{},
)

func (db *DB) DefCtx() SQLContext {
return SQLContext{db.db}
return db, nil
}

+ 0
- 52
datamap/internal/db/hub.go View File

@@ -1,52 +0,0 @@
package db

import (
"gitlink.org.cn/cloudream/storage/datamap/internal/models"
)

type HubDB struct {
*DB
}

func (db *DB) Hub() *HubDB {
return &HubDB{DB: db}
}

// GetHubs 获取所有hub列表
func (*HubDB) GetHubs(ctx SQLContext) ([]models.Hub, error) {
var ret []models.Hub
err := ctx.Table("hub").Find(&ret).Error
return ret, err
}

// GetHub 根据hubId获取该Hub的信息
func (*HubDB) GetHub(ctx SQLContext, hubID int64) (*models.Hub, error) {
var hub models.Hub
err := ctx.Table("hub").Where("HubID = ?", hubID).Find(&hub).Error
return &hub, err
}

// DeleteHub 根据hubId删除该Hub
func (*HubDB) DeleteHub(ctx SQLContext, hubID int64) error {
err := ctx.Table("hub").Where("HubID = ?", hubID).Delete(&models.Hub{}).Error
return err
}

// UpdateHub 根据输入hub信息更新Hub信息
func (*HubDB) UpdateHub(ctx SQLContext, hub models.Hub) (*models.Hub, error) {
err := ctx.Table("hub").Where("HubID = ?", hub.HubID).Updates(&hub).Error
return &hub, err
}

// CreateHub 根据输入hub信息创建Hub信息
func (*HubDB) CreateHub(ctx SQLContext, hub models.Hub) (*models.Hub, error) {
err := ctx.Table("hub").Create(&hub).Error
return &hub, err
}

// IsHubExist 根据hubId查询hub是否存在
func (*HubDB) IsHubExist(ctx SQLContext, hubID int64) (bool, error) {
var count int64
err := ctx.Table("hub").Where("HubID = ?", hubID).Count(&count).Error
return count > 0, err
}

+ 0
- 24
datamap/internal/db/hubrequest.go View File

@@ -1,24 +0,0 @@
package db

import "gitlink.org.cn/cloudream/storage/datamap/internal/models"

type HubReqDB struct {
*DB
}

func (db *DB) HubReq() *HubReqDB {
return &HubReqDB{DB: db}
}

// GetHubRequest 获取所有hubrequest列表
func (*HubReqDB) GetHubRequest(ctx SQLContext) ([]models.HubRequest, error) {
var ret []models.HubRequest
err := ctx.Table("hubrequest").Find(&ret).Error
return ret, err
}

// CreateHubRequest 根据输入的HubRequest信息创建HubRequest信息
func (*HubReqDB) CreateHubRequest(ctx SQLContext, hubRequest models.HubRequest) (*models.HubRequest, error) {
err := ctx.Table("hubrequest").Create(&hubRequest).Error
return &hubRequest, err
}

+ 0
- 36
datamap/internal/db/object.go View File

@@ -1,36 +0,0 @@
package db

import "gitlink.org.cn/cloudream/storage/datamap/internal/models"

type ObjectDB struct {
*DB
}

func (db *DB) Object() *ObjectDB {
return &ObjectDB{DB: db}
}

// GetAllObject 查询所有Object列表
func (*ObjectDB) GetAllObject(ctx SQLContext) ([]models.Object, error) {
var ret []models.Object

err := ctx.Table("object").Find(&ret).Error
return ret, err
}

// GetObject 根据输入的ObjectId查询Object
func (*ObjectDB) GetObject(ctx SQLContext, objectId int64) (models.Object, error) {
var ret models.Object
err := ctx.Table("object").Where("ObjectID = ?", objectId).Find(&ret).Error
return ret, err
}

// DeleteObject 根据输入的ObjectId删除Object
func (*ObjectDB) DeleteObject(ctx SQLContext, objectId int64) error {
return ctx.Table("object").Where("ObjectID = ?", objectId).Delete(&models.Object{}).Error
}

// UpdateObject 根据输入的Object信息更新Object
func (*ObjectDB) UpdateObject(ctx SQLContext, object models.Object) error {
return ctx.Table("object").Where("ObjectID = ?", object.ObjectID).Updates(&object).Error
}

+ 0
- 36
datamap/internal/db/storage.go View File

@@ -1,36 +0,0 @@
package db

import "gitlink.org.cn/cloudream/storage/datamap/internal/models"

type StorageDB struct {
*DB
}

func (db *DB) Storage() *StorageDB {
return &StorageDB{DB: db}
}

// GetAllStorage 查询所有Storage列表
func (*HubDB) GetAllStorage(ctx SQLContext) ([]models.Storage, error) {
var ret []models.Storage

err := ctx.Table("storage").Find(&ret).Error
return ret, err
}

// GetStorage 根据输入的StorageId查询Storage
func (*HubDB) GetStorage(ctx SQLContext, storageId int64) (models.Storage, error) {
var ret models.Storage
err := ctx.Table("storage").Where("StorageID = ?", storageId).Find(&ret).Error
return ret, err
}

// DeleteStorage 根据输入的StorageId删除Storage
func (*HubDB) DeleteStorage(ctx SQLContext, storageId int64) error {
return ctx.Table("storage").Where("StorageID = ?", storageId).Delete(&models.Storage{}).Error
}

// UpdateStorage 根据输入的Storage信息更新Storage
func (*HubDB) UpdateStorage(ctx SQLContext, storage models.Storage) error {
return ctx.Table("storage").Where("StorageID = ?", storage.StorageID).Updates(&storage).Error
}

+ 0
- 36
datamap/internal/db/storagetransfercount.go View File

@@ -1,36 +0,0 @@
package db

import "gitlink.org.cn/cloudream/storage/datamap/internal/models"

type StorageTransferCountDB struct {
*DB
}

func (db *DB) StorageTransferCount() *StorageTransferCountDB {
return &StorageTransferCountDB{DB: db}
}

// GetAllStorageTransferCount 查询所有Storage列表
func (*HubDB) GetAllStorageTransferCount(ctx SQLContext) ([]models.StorageTransferCount, error) {
var ret []models.StorageTransferCount

err := ctx.Table("storagetransfercount").Find(&ret).Error
return ret, err
}

// GetStorageTransferCount 根据输入的RelationshipID查询StorageTransferCount
func (*HubDB) GetStorageTransferCount(ctx SQLContext, RelationshipID int64) (models.Storage, error) {
var ret models.Storage
err := ctx.Table("storagetransfercount").Where("RelationshipID = ?", RelationshipID).Find(&ret).Error
return ret, err
}

// DeleteStorageTransferCount 根据输入的RelationshipID删除StorageTransferCount
func (*HubDB) DeleteStorageTransferCount(ctx SQLContext, RelationshipID int64) error {
return ctx.Table("storagetransfercount").Where("RelationshipID = ?", RelationshipID).Delete(&models.Storage{}).Error
}

// UpdateStorageTransferCount 根据输入的StorageTransferCount信息更新StorageTransferCount
func (*HubDB) UpdateStorageTransferCount(ctx SQLContext, storageTransferCount models.StorageTransferCount) error {
return ctx.Table("storagetransfercount").Where("RelationshipID = ?", storageTransferCount.RelationshipID).Updates(&storageTransferCount).Error
}

+ 30
- 0
datamap/internal/handlers/handlers.go View File

@@ -0,0 +1,30 @@
package handlers

import (
"github.com/gin-gonic/gin"
"gitlink.org.cn/cloudream/storage/datamap/internal/db"
"gitlink.org.cn/cloudream/storage/datamap/internal/models"
"net/http"
)

// GetStorageData 获取 Storage 表中的全部数据
func GetStorageData(c *gin.Context) {
repo := models.NewStorageRepository(db.DB)
storages, err := repo.GetAllStorages()
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": "Failed to fetch storage data"})
return
}
c.JSON(http.StatusOK, storages)
}

// GetBlockDistributionData 获取 BlockDistribution 表中的全部数据
func GetBlockDistributionData(c *gin.Context) {
repo := models.NewBlockDistributionRepository(db.DB)
blocks, err := repo.GetAllBlocks()
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": "Failed to fetch block distribution data"})
return
}
c.JSON(http.StatusOK, blocks)
}

+ 57
- 0
datamap/internal/models/block.go View File

@@ -0,0 +1,57 @@
package models

import (
cdssdk "gitlink.org.cn/cloudream/common/sdks/storage"
stgmod "gitlink.org.cn/cloudream/storage/common/models"
"gorm.io/gorm"
"strconv"
"time"
)

type BlockDistribution struct {
BlockID int64 `gorm:"column:BlockID; primaryKey; type:bigint; autoIncrement" json:"blockID"`
ObjectID cdssdk.ObjectID `gorm:"column:ObjectID; type:bigint; not null" json:"objectID"`
Type string `gorm:"column:Type; type:varchar(1024); not null" json:"type"`
Index int64 `gorm:"column:Index; type:bigint; not null" json:"index"`
StorageID cdssdk.StorageID `gorm:"column:StorageID; type:bigint; not null" json:"storageID"`
Status Status `gorm:"column:Status; type:tinyint; not null" json:"status"`
Timestamp time.Time `gorm:"column:Timestamp; type:datatime; not null" json:"timestamp"`
}

type BlockDistributionRepository struct {
repo *GormRepository
}

func NewBlockDistributionRepository(db *gorm.DB) *BlockDistributionRepository {
return &BlockDistributionRepository{repo: NewGormRepository(db)}
}

func (r *BlockDistributionRepository) CreateBlockDistribution(block *BlockDistribution) error {
return r.repo.Create(block)
}

func (r *BlockDistributionRepository) GetAllBlocks() ([]BlockDistribution, error) {
var blocks []BlockDistribution
err := r.repo.GetAll(&blocks)
if err != nil {
return nil, err
}
return blocks, nil
}

func ProcessBlockDistributionInfo(data stgmod.BlockTransInfo) {
repo := NewBlockDistributionRepository(db)

for _, change := range data.Body.BlockChanges {
objectID, _ := strconv.ParseInt(data.Body.ObjectID, 10, 64)
index, _ := strconv.ParseInt(change.Index, 10, 64)
targetStorageID, _ := strconv.ParseInt(change.TargetStorageID, 10, 64)
block := &BlockDistribution{
ObjectID: cdssdk.ObjectID(objectID),
Type: change.Type,
Index: index,
StorageID: cdssdk.StorageID(targetStorageID),
}
repo.CreateBlockDistribution(block)
}
}

+ 93
- 0
datamap/internal/models/hubs.go View File

@@ -0,0 +1,93 @@
package models

import (
"errors"
cdssdk "gitlink.org.cn/cloudream/common/sdks/storage"
stgmod "gitlink.org.cn/cloudream/storage/common/models"
"gorm.io/gorm"
"log"
"time"
)

var db *gorm.DB

func InitDB(gormDB *gorm.DB) {
db = gormDB
}

type Hub struct {
HubID cdssdk.HubID `gorm:"column:HubID; primaryKey; type:bigint; autoIncrement" json:"hubID"`
Name string `gorm:"column:Name; type:varchar(255); not null" json:"name"`
Address cdssdk.HubAddressInfo `gorm:"column:Address; type:json; serializer:union" json:"address"`
}

type HubStat struct {
StorageID int `json:"storageID"`
DataCount int `json:"dataCount"`
}

type Storage struct {
StorageID cdssdk.StorageID `gorm:"column:StorageID; primaryKey; type:bigint; autoIncrement" json:"storageID"`
HubID cdssdk.HubID `gorm:"column:HubID; type:bigint; not null" json:"hubID"`
DataCount int64 `gorm:"column:DataCount; type:bigint; not null" json:"dataCount"`
NewDataCount int64 `gorm:"column:NewDataCount; type:bigint; not null" json:"newDataCount"`
Timestamp time.Time `gorm:"column:Timestamp; type:datatime; not null" json:"timestamp"`
}
type StorageRepository struct {
repo *GormRepository
}

func NewStorageRepository(db *gorm.DB) *StorageRepository {
return &StorageRepository{repo: NewGormRepository(db)}
}

func (r *StorageRepository) CreateStorage(storage *Storage) error {
return r.repo.Create(storage)
}

func (r *StorageRepository) UpdateStorage(storage *Storage) error {
return r.repo.Update(storage)
}

func (r *StorageRepository) GetStorageByID(id int) (*Storage, error) {
var storage Storage
err := r.repo.GetByID(uint(id), &storage)
if err != nil {
return nil, err
}
return &storage, nil
}

func (r *StorageRepository) GetAllStorages() ([]Storage, error) {
var storages []Storage
err := r.repo.GetAll(&storages)
if err != nil {
return nil, err
}
return storages, nil
}

func ProcessHubStat(data stgmod.HubStat) {
repo := NewStorageRepository(db)

storage, err := repo.GetStorageByID(data.Body.StorageID)
if err != nil {
if errors.Is(err, gorm.ErrRecordNotFound) {
// 插入新记录
newStorage := &Storage{
StorageID: cdssdk.StorageID(data.Body.StorageID),
DataCount: int64(data.Body.DataCount),
NewDataCount: 0,
}
repo.CreateStorage(newStorage)
} else {
log.Printf("Error querying storage: %v", err)
}
} else {
// 更新记录
newDataCount := int64(data.Body.DataCount) - storage.DataCount
storage.DataCount = int64(data.Body.DataCount)
storage.NewDataCount = newDataCount
repo.UpdateStorage(storage)
}
}

+ 53
- 0
datamap/internal/models/hubtrans.go View File

@@ -0,0 +1,53 @@
package models

import (
cdssdk "gitlink.org.cn/cloudream/common/sdks/storage"
stgmod "gitlink.org.cn/cloudream/storage/common/models"
"gorm.io/gorm"
"time"
)

type HubRequest struct {
RequestID int64 `gorm:"column:HubID; primaryKey; type:bigint; autoIncrement" json:"hubID"`
SourceHubID cdssdk.HubID `gorm:"column:SourceHubID; type:bigint; not null" json:"sourceHubID"`
TargetHubID cdssdk.HubID `gorm:"column:TargetHubID; type:bigint; not null" json:"targetHubID"`
DataTransfer int64 `gorm:"column:DataTransfer; type:bigint; not null" json:"dataTransfer"`
RequestCount int64 `gorm:"column:RequestCount; type:bigint; not null" json:"requestCount"`
FailedRequest int64 `gorm:"column:FailedRequest; type:bigint; not null" json:"failedRequest"`
AvgTransferCount int64 `gorm:"column:AvgTransferCount; type:bigint; not null" json:"avgTransferCount"`
MaxTransferCount int64 `gorm:"column:MaxTransferCount; type:bigint; not null" json:"maxTransferCount"`
MinTransferCount int64 `gorm:"column:MinTransferCount; type:bigint; not null" json:"minTransferCount"`
StartTimestamp time.Time `gorm:"column:StartTimestamp; type:datatime; not null" json:"startTimestamp"`
EndTimestamp time.Time `gorm:"column:EndTimestamp; type:datatime; not null" json:"endTimestamp"`
}

type HubRequestRepository struct {
repo *GormRepository
}

func NewHubRequestRepository(db *gorm.DB) *HubRequestRepository {
return &HubRequestRepository{repo: NewGormRepository(db)}
}

func (r *HubRequestRepository) CreateHubRequest(request *HubRequest) error {
return r.repo.Create(request)
}

func ProcessHubTrans(data stgmod.HubTrans) {
repo := NewHubRequestRepository(db)

hubRequest := &HubRequest{
SourceHubID: cdssdk.HubID(data.Body.SourceHubID),
TargetHubID: cdssdk.HubID(data.Body.TargetHubID),
DataTransfer: data.Body.DataTransferCount,
RequestCount: data.Body.RequestCount,
FailedRequest: data.Body.FailedRequestCount,
AvgTransferCount: data.Body.AvgTransferCount,
MaxTransferCount: data.Body.MaxTransferCount,
MinTransferCount: data.Body.MinTransferCount,
StartTimestamp: data.Body.StartTimestamp,
EndTimestamp: data.Body.EndTimestamp,
}

repo.CreateHubRequest(hubRequest)
}

+ 1
- 61
datamap/internal/models/models.go View File

@@ -1,9 +1,8 @@
package models

import (
"time"

cdssdk "gitlink.org.cn/cloudream/common/sdks/storage"
"time"
)

type RequestID int64
@@ -92,73 +91,14 @@ type Relationship struct {

//数据库结构定义

type Hub struct {
HubID cdssdk.HubID `gorm:"column:HubID; primaryKey; type:bigint; autoIncrement" json:"hubID"`
Name string `gorm:"column:Name; type:varchar(255); not null" json:"name"`
Address cdssdk.HubAddressInfo `gorm:"column:Address; type:json; serializer:union" json:"address"`
}

func (Hub) TableName() string {
return "Hub"
}

type Storage struct {
StorageID cdssdk.StorageID `gorm:"column:StorageID; primaryKey; type:bigint; autoIncrement" json:"storageID"`
HubID cdssdk.HubID `gorm:"column:HubID; type:bigint; not null" json:"hubID"`
DataCount int64 `gorm:"column:DataCount; type:bigint; not null" json:"dataCount"`
NewDataCount int64 `gorm:"column:NewDataCount; type:bigint; not null" json:"newDataCount"`
Timestamp time.Time `gorm:"column:Timestamp; type:datatime; not null" json:"timestamp"`
}

func (Storage) TableName() string {
return "Storage"
}

type HubRequest struct {
RequestID int64 `gorm:"column:HubID; primaryKey; type:bigint; autoIncrement" json:"hubID"`
SourceHubID cdssdk.HubID `gorm:"column:SourceHubID; type:bigint; not null" json:"sourceHubID"`
TargetHubID cdssdk.HubID `gorm:"column:TargetHubID; type:bigint; not null" json:"targetHubID"`
DataTransfer int64 `gorm:"column:DataTransfer; type:bigint; not null" json:"dataTransfer"`
RequestCount int64 `gorm:"column:RequestCount; type:bigint; not null" json:"requestCount"`
FailedRequest int64 `gorm:"column:FailedRequest; type:bigint; not null" json:"failedRequest"`
AvgTransferCount int64 `gorm:"column:AvgTransferCount; type:bigint; not null" json:"avgTransferCount"`
MaxTransferCount int64 `gorm:"column:MaxTransferCount; type:bigint; not null" json:"maxTransferCount"`
MinTransferCount int64 `gorm:"column:MinTransferCount; type:bigint; not null" json:"minTransferCount"`
StartTimestamp time.Time `gorm:"column:StartTimestamp; type:datatime; not null" json:"startTimestamp"`
EndTimestamp time.Time `gorm:"column:EndTimestamp; type:datatime; not null" json:"endTimestamp"`
}

func (HubRequest) TableName() string {
return "HubRequest"
}

type Object struct {
ObjectID cdssdk.ObjectID `gorm:"column:ObjectID; primaryKey; type:bigint; autoIncrement" json:"objectID"`
PackageID cdssdk.PackageID `gorm:"column:PackageID; type:bigint; not null" json:"packageID"`
Path string `gorm:"column:Path; type:varchar(1024); not null" json:"path"`
Size int64 `gorm:"column:Size; type:bigint; not null" json:"size"`
FileHash string `gorm:"column:FileHash; type:varchar(255); not null" json:"fileHash"`
Status Status `gorm:"column:Status; type:tinyint; not null" json:"status"`
FaultTolerance float64 `gorm:"column:faultTolerance; type:float; not null" json:"faultTolerance"`
Redundancy float64 `gorm:"column:redundancy; type:float; not null" json:"redundancy"`
AvgAccessCost float64 `gorm:"column:avgAccessCost; type:float; not null" json:"avgAccessCost"`
Timestamp time.Time `gorm:"column:Timestamp; type:datatime; not null" json:"timestamp"`
}

func (Object) TableName() string {
return "Object"
}

type BlockDistribution struct {
BlockID int64 `gorm:"column:BlockID; primaryKey; type:bigint; autoIncrement" json:"blockID"`
ObjectID cdssdk.ObjectID `gorm:"column:ObjectID; type:bigint; not null" json:"objectID"`
Type string `gorm:"column:Type; type:varchar(1024); not null" json:"type"`
Index int64 `gorm:"column:Index; type:bigint; not null" json:"index"`
StorageID cdssdk.StorageID `gorm:"column:StorageID; type:bigint; not null" json:"storageID"`
Status Status `gorm:"column:Status; type:tinyint; not null" json:"status"`
Timestamp time.Time `gorm:"column:Timestamp; type:datatime; not null" json:"timestamp"`
}

func (BlockDistribution) TableName() string {
return "BlockDistribution"
}


+ 70
- 0
datamap/internal/models/object.go View File

@@ -0,0 +1,70 @@
package models

import (
cdssdk "gitlink.org.cn/cloudream/common/sdks/storage"
stgmod "gitlink.org.cn/cloudream/storage/common/models"
"gorm.io/gorm"
"log"
"time"
)

type Object struct {
ObjectID cdssdk.ObjectID `gorm:"column:ObjectID; primaryKey; type:bigint; autoIncrement" json:"objectID"`
PackageID cdssdk.PackageID `gorm:"column:PackageID; type:bigint; not null" json:"packageID"`
Path string `gorm:"column:Path; type:varchar(1024); not null" json:"path"`
Size int64 `gorm:"column:Size; type:bigint; not null" json:"size"`
FileHash string `gorm:"column:FileHash; type:varchar(255); not null" json:"fileHash"`
Status Status `gorm:"column:Status; type:tinyint; not null" json:"status"`
FaultTolerance float64 `gorm:"column:faultTolerance; type:float; not null" json:"faultTolerance"`
Redundancy float64 `gorm:"column:redundancy; type:float; not null" json:"redundancy"`
AvgAccessCost float64 `gorm:"column:avgAccessCost; type:float; not null" json:"avgAccessCost"`
Timestamp time.Time `gorm:"column:Timestamp; type:datatime; not null" json:"timestamp"`
}

// BlockTransferRepository 块传输记录的 Repository
type BlockTransferRepository struct {
repo *GormRepository
}

// NewBlockTransferRepository 创建 BlockTransferRepository 实例
func NewBlockTransferRepository(db *gorm.DB) *BlockTransferRepository {
return &BlockTransferRepository{repo: NewGormRepository(db)}
}

// CreateBlockTransfer 创建块传输记录
func (r *BlockTransferRepository) CreateBlockTransfer(transfer *Object) error {
return r.repo.Create(transfer)
}

// GetAllBlockTransfers 获取所有块传输记录
func (r *BlockTransferRepository) GetAllBlockTransfers() ([]Object, error) {
var transfers []Object
err := r.repo.GetAll(&transfers)
if err != nil {
return nil, err
}
return transfers, nil
}

// ProcessBlockTransInfo 处理 BlockTransInfo 数据
func ProcessBlockTransInfo(data stgmod.Object) {
repo := NewBlockTransferRepository(db)
//TODO 数据待调整
transfer := &Object{
ObjectID: 0,
PackageID: 0,
Path: data.Path,
Size: 0,
FileHash: "",
Status: 0,
FaultTolerance: 0,
Redundancy: 0,
AvgAccessCost: 0,
Timestamp: time.Time{},
}
err := repo.CreateBlockTransfer(transfer)
if err != nil {
log.Printf("Failed to create block transfer record: %v", err)
}

}

+ 43
- 0
datamap/internal/models/repository.go View File

@@ -0,0 +1,43 @@
package models

import (
"gorm.io/gorm"
)

// Repository 通用接口
type Repository interface {
Create(value interface{}) error
Update(value interface{}) error
Delete(value interface{}, id uint) error
GetByID(id uint, out interface{}) error
GetAll(out interface{}) error
}

// GormRepository 基于 GORM 的通用实现
type GormRepository struct {
db *gorm.DB
}

func NewGormRepository(db *gorm.DB) *GormRepository {
return &GormRepository{db: db}
}

func (r *GormRepository) Create(value interface{}) error {
return r.db.Create(value).Error
}

func (r *GormRepository) Update(value interface{}) error {
return r.db.Save(value).Error
}

func (r *GormRepository) Delete(value interface{}, id uint) error {
return r.db.Delete(value, id).Error
}

func (r *GormRepository) GetByID(id uint, out interface{}) error {
return r.db.First(out, id).Error
}

func (r *GormRepository) GetAll(out interface{}) error {
return r.db.Find(out).Error
}

+ 0
- 22
datamap/internal/mq/hub.go View File

@@ -1,22 +0,0 @@
package mq

import (
"gitlink.org.cn/cloudream/common/pkgs/logger"
"gitlink.org.cn/cloudream/common/pkgs/mq"
datamapmq "gitlink.org.cn/cloudream/storage/common/pkgs/mq/datamap"
)

func (svc *Service) GetHubStat(msg *datamapmq.GetHubStat) (*datamapmq.GetHubStatResp, *mq.CodeMessage) {
logger.WithField("HubID", msg.HubID)

//从datamapmq队列接收数据到stgmod.HubStat

//从datamapmq队列接收数据到stgmod.HubStat,然后将该数据和mysql数据库中获取到的models.Storage做对比,用stgmode
return &datamapmq.GetHubStatResp{}, nil
}

func (svc *Service) GetHubTrans(msg *datamapmq.GetHubTrans) (*datamapmq.GetHubTransResp, *mq.CodeMessage) {
logger.WithField("HubID", msg.HubID)

return &datamapmq.GetHubTransResp{}, nil
}

+ 80
- 0
datamap/internal/mq/mq.go View File

@@ -0,0 +1,80 @@
package mq

import (
"encoding/json"
"fmt"
"github.com/streadway/amqp"
stgmod "gitlink.org.cn/cloudream/storage/common/models"
"gitlink.org.cn/cloudream/storage/datamap/internal/config"
"gitlink.org.cn/cloudream/storage/datamap/internal/models"
"log"
)

func InitMQ(cfg config.RabbitMQConfig) (*amqp.Connection, error) {
conn, err := amqp.Dial(fmt.Sprintf("amqp://%s:%s@%s:%s/",
cfg.User, cfg.Password, cfg.Host, cfg.Port))
if err != nil {
return nil, err
}

// 启动队列监听
go listenQueues(conn)

return conn, nil
}

func listenQueues(conn *amqp.Connection) {
queues := []string{
"datamap_storageinfo",
"datamap_hubtransfer",
"datamap_blocktransfer",
"datamap_blockdistribution",
"datamap_objectchange",
"datamap_packagechange",
"datamap_bucketchange",
}

for _, queue := range queues {
go func(q string) {
ch, err := conn.Channel()
if err != nil {
log.Printf("Failed to open channel for queue %s: %v", q, err)
return
}
defer ch.Close()

msgs, err := ch.Consume(q, "", true, false, false, false, nil)
if err != nil {
log.Printf("Failed to register consumer for queue %s: %v", q, err)
return
}

for msg := range msgs {
processMessage(q, msg.Body)
}
}(queue)
}
}

func processMessage(queue string, body []byte) {
switch queue {
case "datamap_storageinfo":
var data stgmod.HubStat
json.Unmarshal(body, &data)
models.ProcessHubStat(data)
case "datamap_hubtransfer":
var data stgmod.HubTrans
json.Unmarshal(body, &data)
models.ProcessHubTrans(data)
case "datamap_blocktransfer":
var data stgmod.Object
json.Unmarshal(body, &data)
models.ProcessBlockTransInfo(data)
case "datamap_blockdistribution":
var data stgmod.BlockTransInfo
json.Unmarshal(body, &data)
models.ProcessBlockDistributionInfo(data)
default:
log.Printf("Unknown queue: %s", queue)
}
}

+ 0
- 15
datamap/internal/mq/service.go View File

@@ -1,15 +0,0 @@
package mq

import (
"gorm.io/gorm"
)

type Service struct {
db *gorm.DB
}

func NewService(db *gorm.DB) *Service {
return &Service{
db: db,
}
}

+ 22
- 0
datamap/internal/server/server.go View File

@@ -0,0 +1,22 @@
package server

import (
"github.com/gin-gonic/gin"
"github.com/streadway/amqp"
"gitlink.org.cn/cloudream/storage/datamap/internal/handlers"
"gorm.io/gorm"
"log"
)

func StartServer(db *gorm.DB, mq *amqp.Connection) {
r := gin.Default()

// 注册HTTP接口
r.GET("/storage", handlers.GetStorageData)
r.GET("/block-distribution", handlers.GetBlockDistributionData)

// 启动服务
if err := r.Run(":8080"); err != nil {
log.Fatalf("Failed to start server: %v", err)
}
}

+ 19
- 6
datamap/main.go View File

@@ -1,16 +1,29 @@
package main

import (
"fmt"
"os"

"gitlink.org.cn/cloudream/storage/datamap/internal/config"
"gitlink.org.cn/cloudream/storage/datamap/internal/db"
"gitlink.org.cn/cloudream/storage/datamap/internal/mq"
"gitlink.org.cn/cloudream/storage/datamap/internal/server"
"log"
)

func main() {
err := config.Init()
// 加载配置
cfg := config.LoadConfig()

// 初始化数据库
dbConn, err := db.InitDB(cfg.Database)
if err != nil {
log.Fatalf("Failed to initialize database: %v", err)
}

// 初始化RabbitMQ
mqConn, err := mq.InitMQ(cfg.RabbitMQ)
if err != nil {
fmt.Printf("init config failed, err: %s", err.Error())
os.Exit(1)
log.Fatalf("Failed to initialize RabbitMQ: %v", err)
}

// 启动Gin服务
server.StartServer(dbConn, mqConn)
}

+ 28
- 18
go.mod View File

@@ -22,10 +22,11 @@ require (
github.com/samber/lo v1.38.1
github.com/smartystreets/goconvey v1.8.1
github.com/spf13/cobra v1.8.0
github.com/spf13/viper v1.19.0
github.com/tencentyun/cos-go-sdk-v5 v0.7.56
gitlink.org.cn/cloudream/common v0.0.0
google.golang.org/grpc v1.57.0
google.golang.org/protobuf v1.31.0
google.golang.org/grpc v1.62.1
google.golang.org/protobuf v1.33.0
gorm.io/gorm v1.25.7
)

@@ -40,14 +41,25 @@ require (
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.6 // indirect
github.com/aws/smithy-go v1.22.1 // indirect
github.com/clbanning/mxj v1.8.4 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/google/go-querystring v1.0.0 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mozillazg/go-httpheader v0.2.1 // indirect
github.com/stretchr/testify v1.8.4 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
golang.org/x/time v0.7.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

require (
@@ -60,7 +72,6 @@ require (
github.com/go-playground/validator/v10 v10.8.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/gopherjs/gopherjs v1.17.2 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
@@ -79,23 +90,22 @@ require (
github.com/sirupsen/logrus v1.9.2
github.com/smarty/assertions v1.15.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/streadway/amqp v1.1.0 // indirect
github.com/streadway/amqp v1.1.0
github.com/ugorji/go/codec v1.2.11 // indirect
github.com/zyedidia/generic v1.2.1 // indirect
go.etcd.io/etcd/api/v3 v3.5.9 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.9 // indirect
go.etcd.io/etcd/client/v3 v3.5.9 // indirect
go.etcd.io/etcd/api/v3 v3.5.12 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.12 // indirect
go.etcd.io/etcd/client/v3 v3.5.12 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/crypto v0.9.0 // indirect
golang.org/x/exp v0.0.0-20230519143937-03e91628a987 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/sync v0.1.0
golang.org/x/sys v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
google.golang.org/genproto v0.0.0-20230526161137-0005af68ea54 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/sync v0.6.0
golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240311132316-a219d84964c2 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240314234333-6e1732d8331c // indirect
gorm.io/driver/mysql v1.5.7
)

+ 71
- 36
go.sum View File

@@ -37,8 +37,13 @@ github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
github.com/gin-gonic/gin v1.7.7 h1:3DoBmSbJbZAWqXJC3SLjAPfutPJJRN1U5pALB7EeTTs=
@@ -64,14 +69,14 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk=
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4=
github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gopherjs/gopherjs v1.17.2 h1:fQnZVsXk8uxXIStYb0N4bGk7jeyTalG/wsZjQ25dO0g=
github.com/gopherjs/gopherjs v1.17.2/go.mod h1:pRRIvn/QzFLrKfvEz3qUuEhtE/zLCWfreZ6J5gM2i+k=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
@@ -81,6 +86,8 @@ github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+l
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
github.com/hashicorp/golang-lru/v2 v2.0.5 h1:wW7h1TG88eUIJ2i69gaE3uNVtEPIagzhGvHgwfx2Vm4=
github.com/hashicorp/golang-lru/v2 v2.0.5/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/huaweicloud/huaweicloud-sdk-go-obs v3.24.9+incompatible h1:XQVXdk+WAJ4fSNB6mMRuYNvFWou7BZs6SZB925hPrnk=
github.com/huaweicloud/huaweicloud-sdk-go-obs v3.24.9+incompatible/go.mod h1:l7VUhRbTKCzdOacdT4oWCwATKyvZqUOlOqr0Ous3k4s=
github.com/imdario/mergo v0.3.15 h1:M8XP7IuFNsqUx6VPK2P9OSmsYsI/YFaGil0uD21V3dM=
@@ -106,12 +113,18 @@ github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZX
github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY=
github.com/klauspost/reedsolomon v1.11.8 h1:s8RpUW5TK4hjr+djiOpbZJB4ksx+TdYbRH7vHQpwPOY=
github.com/klauspost/reedsolomon v1.11.8/go.mod h1:4bXRN+cVzMdml6ti7qLouuYi32KHJ5MGv0Qd8a47h6A=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII=
github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY=
github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q=
github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4=
github.com/magefile/mage v1.15.0 h1:BvGheCMAsG3bWUDbZ8AyXXpCNwU9u5CB6sM+HNb9HYg=
github.com/magefile/mage v1.15.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A=
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA=
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
@@ -128,14 +141,23 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/mozillazg/go-httpheader v0.2.1 h1:geV7TrjbL8KXSyvghnFm+NyTux/hxwueTSrwhe88TQQ=
github.com/mozillazg/go-httpheader v0.2.1/go.mod h1:jJ8xECTlalr6ValeXYdOF8fFUISeBAdw6E61aqQma60=
github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM=
github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ=
github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4=
github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE=
github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ=
github.com/samber/lo v1.38.1 h1:j2XEAqXKb09Am4ebOg31SpvzUTTs6EN3VfgeLUhPdXM=
github.com/samber/lo v1.38.1/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXnEA=
github.com/sirupsen/logrus v1.9.2 h1:oxx1eChJGI6Uks2ZC4W1zpLlVgqB8ner4EuQwV4Ik1Y=
@@ -144,15 +166,24 @@ github.com/smarty/assertions v1.15.0 h1:cR//PqUBUiQRakZWqBiFFQ9wb8emQGDb0HeGdqGB
github.com/smarty/assertions v1.15.0/go.mod h1:yABtdzeQs6l1brC900WlRNwj6ZR55d7B+E8C6HtKdec=
github.com/smartystreets/goconvey v1.8.1 h1:qGjIddxOk4grTu9JPOU31tVfq3cNdBlNa5sSznIX1xY=
github.com/smartystreets/goconvey v1.8.1/go.mod h1:+/u4qLyY6x1jReYOp7GOM2FSt8aP9CzCZL03bI28W60=
github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo=
github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0=
github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8=
github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY=
github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0=
github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0=
github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI=
github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg=
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=
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
@@ -161,8 +192,11 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.7.4/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.563/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/kms v1.0.563/go.mod h1:uom4Nvi9W+Qkom0exYiJ9VWJjXwyxtPYTkKkaLMlfE0=
github.com/tencentyun/cos-go-sdk-v5 v0.7.56 h1:fOA3l3XbVN2kTjQKYPvhDms0Fq8zDcinO3boXodFaLw=
@@ -175,12 +209,12 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/zyedidia/generic v1.2.1 h1:Zv5KS/N2m0XZZiuLS82qheRG4X1o5gsWreGb0hR7XDc=
github.com/zyedidia/generic v1.2.1/go.mod h1:ly2RBz4mnz1yeuVbQA/VFwGjK3mnHGRj1JuoG336Bis=
go.etcd.io/etcd/api/v3 v3.5.9 h1:4wSsluwyTbGGmyjJktOf3wFQoTBIURXHnq9n/G/JQHs=
go.etcd.io/etcd/api/v3 v3.5.9/go.mod h1:uyAal843mC8uUVSLWz6eHa/d971iDGnCRpmKd2Z+X8k=
go.etcd.io/etcd/client/pkg/v3 v3.5.9 h1:oidDC4+YEuSIQbsR94rY9gur91UPL6DnxDCIYd2IGsE=
go.etcd.io/etcd/client/pkg/v3 v3.5.9/go.mod h1:y+CzeSmkMpWN2Jyu1npecjB9BBnABxGM4pN8cGuJeL4=
go.etcd.io/etcd/client/v3 v3.5.9 h1:r5xghnU7CwbUxD/fbUtRyJGaYNfDun8sp/gTr1hew6E=
go.etcd.io/etcd/client/v3 v3.5.9/go.mod h1:i/Eo5LrZ5IKqpbtpPDuaUnDOUv471oDg8cjQaUr2MbA=
go.etcd.io/etcd/api/v3 v3.5.12 h1:W4sw5ZoU2Juc9gBWuLk5U6fHfNVyY1WC5g9uiXZio/c=
go.etcd.io/etcd/api/v3 v3.5.12/go.mod h1:Ot+o0SWSyT6uHhA56al1oCED0JImsRiU9Dc26+C2a+4=
go.etcd.io/etcd/client/pkg/v3 v3.5.12 h1:EYDL6pWwyOsylrQyLp2w+HkQ46ATiOvoEdMarindU2A=
go.etcd.io/etcd/client/pkg/v3 v3.5.12/go.mod h1:seTzl2d9APP8R5Y2hFL3NVlD6qC/dOT+3kvrqPyTas4=
go.etcd.io/etcd/client/v3 v3.5.12 h1:v5lCPXn1pf1Uu3M4laUE2hp/geOTc5uPcYYsNe1lDxg=
go.etcd.io/etcd/client/v3 v3.5.12/go.mod h1:tSbBCakoWmmddL+BKVAJHa9km+O/E+bumDe9mSbPiqw=
go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ=
go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA=
@@ -193,10 +227,10 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g=
golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0=
golang.org/x/exp v0.0.0-20230519143937-03e91628a987 h1:3xJIFvzUFbu4ls0BTBYcgbCGhA63eAOEMxIHugyXJqA=
golang.org/x/exp v0.0.0-20230519143937-03e91628a987/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w=
golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA=
golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs=
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g=
golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
@@ -204,13 +238,13 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M=
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ=
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -222,15 +256,15 @@ golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/time v0.7.0 h1:ntUhktv3OPE6TgYxXWv9vKvUSJyIFJlyohwbkEwPrKQ=
golang.org/x/time v0.7.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
@@ -241,20 +275,21 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/genproto v0.0.0-20230526161137-0005af68ea54 h1:9NWlQfY2ePejTmfwUH1OWwmznFa+0kKcHGPDvcPza9M=
google.golang.org/genproto v0.0.0-20230526161137-0005af68ea54/go.mod h1:zqTuNwFlFRsw5zIts5VnzLQxSRqh+CGOTVMlYbY0Eyk=
google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9 h1:m8v1xLLLzMe1m5P+gCTF8nJB9epwZQUBERm20Oy1poQ=
google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig=
google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 h1:0nDDozoAU19Qb2HwhXadU8OcsiO/09cnTqhUtq2MEOM=
google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA=
google.golang.org/grpc v1.57.0 h1:kfzNeI/klCGD2YPMUlaGNT3pxvYfga7smW3Vth8Zsiw=
google.golang.org/grpc v1.57.0/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo=
google.golang.org/genproto/googleapis/api v0.0.0-20240311132316-a219d84964c2 h1:rIo7ocm2roD9DcFIX67Ym8icoGCKSARAiPljFhh5suQ=
google.golang.org/genproto/googleapis/api v0.0.0-20240311132316-a219d84964c2/go.mod h1:O1cOfN1Cy6QEYr7VxtjOyP5AdAuR0aJ/MYZaaof623Y=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240314234333-6e1732d8331c h1:lfpJ/2rWPa/kJgxyyXM8PrNnfCzcmxJ265mADgwmvLI=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240314234333-6e1732d8331c/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY=
google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk=
google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=


Loading…
Cancel
Save