diff --git a/sdks/storage/shared_storage.go b/sdks/storage/shared_storage.go index 7364143..59d1341 100644 --- a/sdks/storage/shared_storage.go +++ b/sdks/storage/shared_storage.go @@ -7,27 +7,27 @@ import ( "gitlink.org.cn/cloudream/common/utils/serder" ) -type SharedStoreConfig interface { - GetSharedStoreType() string +type PublicStoreConfig interface { + GetPublicStoreType() string // 输出调试用的字符串,不要包含敏感信息 String() string } -var _ = serder.UseTypeUnionInternallyTagged(types.Ref(types.NewTypeUnion[SharedStoreConfig]( - (*LocalSharedStorage)(nil), +var _ = serder.UseTypeUnionInternallyTagged(types.Ref(types.NewTypeUnion[PublicStoreConfig]( + (*LocalPublicStorage)(nil), )), "type") -type LocalSharedStorage struct { +type LocalPublicStorage struct { serder.Metadata `union:"Local"` Type string `json:"type"` // 调度Package时的Package的根路径 LoadBase string `json:"loadBase"` } -func (s *LocalSharedStorage) GetSharedStoreType() string { +func (s *LocalPublicStorage) GetPublicStoreType() string { return "Local" } -func (s *LocalSharedStorage) String() string { +func (s *LocalPublicStorage) String() string { return fmt.Sprintf("Local[LoadBase=%v]", s.LoadBase) } diff --git a/sdks/storage/storage.go b/sdks/storage/storage.go index f8e686b..cfbca6d 100644 --- a/sdks/storage/storage.go +++ b/sdks/storage/storage.go @@ -17,8 +17,7 @@ type Storage struct { // 分片存储服务的配置数据 ShardStore ShardStoreConfig `json:"shardStore" gorm:"column:ShardStore; type:json; serializer:union"` // 共享存储服务的配置数据 - SharedStore SharedStoreConfig `json:"sharedStore" gorm:"column:SharedStore; type:json; serializer:union"` - // SharedStore + PublicStore PublicStoreConfig `json:"publicStore" gorm:"column:PublicStore; type:json; serializer:union"` // 存储服务拥有的特别功能 Features []StorageFeature `json:"features" gorm:"column:Features; type:json; serializer:union"` }