| @@ -1,14 +1,32 @@ | |||||
| package cdssdk | package cdssdk | ||||
| import ( | import ( | ||||
| "fmt" | |||||
| "gitlink.org.cn/cloudream/common/pkgs/types" | "gitlink.org.cn/cloudream/common/pkgs/types" | ||||
| "gitlink.org.cn/cloudream/common/utils/serder" | "gitlink.org.cn/cloudream/common/utils/serder" | ||||
| ) | ) | ||||
| type SharedStoreConfig interface { | type SharedStoreConfig interface { | ||||
| GetType() string | |||||
| GetSharedStoreType() string | |||||
| // 输出调试用的字符串,不要包含敏感信息 | // 输出调试用的字符串,不要包含敏感信息 | ||||
| String() string | String() string | ||||
| } | } | ||||
| var _ = serder.UseTypeUnionInternallyTagged(types.Ref(types.NewTypeUnion[SharedStoreConfig]()), "type") | |||||
| var _ = serder.UseTypeUnionInternallyTagged(types.Ref(types.NewTypeUnion[SharedStoreConfig]( | |||||
| (*LocalSharedStorage)(nil), | |||||
| )), "type") | |||||
| type LocalSharedStorage struct { | |||||
| Type string `json:"type"` | |||||
| // 调度Package时的Package的根路径 | |||||
| LoadBase string `json:"loadBase"` | |||||
| } | |||||
| func (s *LocalSharedStorage) GetSharedStoreType() string { | |||||
| return "Local" | |||||
| } | |||||
| func (s *LocalSharedStorage) String() string { | |||||
| return fmt.Sprintf("Local[LoadBase=%v]", s.LoadBase) | |||||
| } | |||||