|
|
|
@@ -39,12 +39,30 @@ type StorageType interface { |
|
|
|
} |
|
|
|
|
|
|
|
var _ = serder.UseTypeUnionInternallyTagged(types.Ref(types.NewTypeUnion[StorageType]( |
|
|
|
(*MashupStorageType)(nil), |
|
|
|
(*LocalStorageType)(nil), |
|
|
|
(*OBSType)(nil), |
|
|
|
(*OSSType)(nil), |
|
|
|
(*COSType)(nil), |
|
|
|
(*EFileType)(nil), |
|
|
|
)), "type") |
|
|
|
|
|
|
|
// 多种存储服务的混合存储服务。需谨慎选择存储服务的组合,避免出Bug |
|
|
|
type MashupStorageType struct { |
|
|
|
serder.Metadata `union:"Mashup"` |
|
|
|
Type string `json:"type"` |
|
|
|
Agent StorageType `json:"agent"` // 创建Agent时,使用的存储服务类型 |
|
|
|
Feature StorageType `json:"feature"` // 根据Feature创建组件时使用的存储服务类型 |
|
|
|
} |
|
|
|
|
|
|
|
func (a *MashupStorageType) GetStorageType() string { |
|
|
|
return "Mashup" |
|
|
|
} |
|
|
|
|
|
|
|
func (a *MashupStorageType) String() string { |
|
|
|
return "Mashup" |
|
|
|
} |
|
|
|
|
|
|
|
type LocalStorageType struct { |
|
|
|
serder.Metadata `union:"Local"` |
|
|
|
Type string `json:"type"` |
|
|
|
@@ -112,3 +130,23 @@ func (a *COSType) GetStorageType() string { |
|
|
|
func (a *COSType) String() string { |
|
|
|
return "COS" |
|
|
|
} |
|
|
|
|
|
|
|
type EFileType struct { |
|
|
|
serder.Metadata `union:"EFile"` |
|
|
|
Type string `json:"type"` |
|
|
|
TokenURL string `json:"tokenURL"` |
|
|
|
APIURL string `json:"apiURL"` |
|
|
|
TokenExpire int `json:"tokenExpire"` // 单位秒 |
|
|
|
User string `json:"user"` |
|
|
|
Password string `json:"password"` |
|
|
|
OrgID string `json:"orgID"` |
|
|
|
ClusterID string `json:"clusterID"` |
|
|
|
} |
|
|
|
|
|
|
|
func (a *EFileType) GetStorageType() string { |
|
|
|
return "EFile" |
|
|
|
} |
|
|
|
|
|
|
|
func (a *EFileType) String() string { |
|
|
|
return "EFile" |
|
|
|
} |