From 98dfa92c0d2abbe7c9432ad052114ebca2de490c Mon Sep 17 00:00:00 2001 From: Sydonian <794346190@qq.com> Date: Wed, 13 Nov 2024 10:42:46 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=85=B1=E4=BA=AB=E5=AD=98?= =?UTF-8?q?=E5=82=A8=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sdks/storage/shared_storage.go | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/sdks/storage/shared_storage.go b/sdks/storage/shared_storage.go index ec1c67c..4f4fa0c 100644 --- a/sdks/storage/shared_storage.go +++ b/sdks/storage/shared_storage.go @@ -1,14 +1,32 @@ package cdssdk import ( + "fmt" + "gitlink.org.cn/cloudream/common/pkgs/types" "gitlink.org.cn/cloudream/common/utils/serder" ) type SharedStoreConfig interface { - GetType() string + GetSharedStoreType() 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) +}