Browse Source

SharedStore重命名为PublicStore

feature_wq
Sydonian 10 months ago
parent
commit
e747959082
2 changed files with 8 additions and 9 deletions
  1. +7
    -7
      sdks/storage/shared_storage.go
  2. +1
    -2
      sdks/storage/storage.go

+ 7
- 7
sdks/storage/shared_storage.go View File

@@ -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)
}

+ 1
- 2
sdks/storage/storage.go View File

@@ -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"`
}


Loading…
Cancel
Save