|
|
|
@@ -14,6 +14,11 @@ type Storage struct { |
|
|
|
MasterHub HubID `json:"masterHub" gorm:"column:MasterHub; type:bigint; not null"` |
|
|
|
// 存储服务的地址,包含鉴权所需数据 |
|
|
|
Address StorageAddress `json:"address" gorm:"column:Address; type:json; not null; serializer:union"` |
|
|
|
// 分片存储服务的配置数据 |
|
|
|
ShardStore ShardStoreConfig `json:"shardStore" gorm:"column:ShardStore; type:json; serializer:union"` |
|
|
|
// 共享存储服务的配置数据 |
|
|
|
SharedStore SharedStoreConfig `json:"sharedStore" gorm:"column:SharedStore; type:json; serializer:union"` |
|
|
|
// SharedStore |
|
|
|
// 存储服务拥有的特别功能 |
|
|
|
Features []StorageFeature `json:"features" gorm:"column:Features; type:json; serializer:union"` |
|
|
|
} |
|
|
|
@@ -26,19 +31,6 @@ func (s *Storage) String() string { |
|
|
|
return fmt.Sprintf("%v(%v)", s.Name, s.StorageID) |
|
|
|
} |
|
|
|
|
|
|
|
// 共享存储服务的配置数据 |
|
|
|
type SharedStorage struct { |
|
|
|
StorageID StorageID `json:"storageID" gorm:"column:StorageID; primaryKey; type:bigint"` |
|
|
|
// 调度文件时保存文件的根路径 |
|
|
|
LoadBase string `json:"loadBase" gorm:"column:LoadBase; type:varchar(1024); not null"` |
|
|
|
// 回源数据时数据存放位置的根路径 |
|
|
|
DataReturnBase string `json:"dataReturnBase" gorm:"column:DataReturnBase; type:varchar(1024); not null"` |
|
|
|
} |
|
|
|
|
|
|
|
func (SharedStorage) TableName() string { |
|
|
|
return "SharedStorage" |
|
|
|
} |
|
|
|
|
|
|
|
// 存储服务地址 |
|
|
|
type StorageAddress interface { |
|
|
|
GetType() string |
|
|
|
|