You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

shared_storage.go 774 B

123456789101112131415161718192021222324252627282930313233
  1. package cdssdk
  2. import (
  3. "fmt"
  4. "gitlink.org.cn/cloudream/common/pkgs/types"
  5. "gitlink.org.cn/cloudream/common/utils/serder"
  6. )
  7. type SharedStoreConfig interface {
  8. GetSharedStoreType() string
  9. // 输出调试用的字符串,不要包含敏感信息
  10. String() string
  11. }
  12. var _ = serder.UseTypeUnionInternallyTagged(types.Ref(types.NewTypeUnion[SharedStoreConfig](
  13. (*LocalSharedStorage)(nil),
  14. )), "type")
  15. type LocalSharedStorage struct {
  16. serder.Metadata `union:"Local"`
  17. Type string `json:"type"`
  18. // 调度Package时的Package的根路径
  19. LoadBase string `json:"loadBase"`
  20. }
  21. func (s *LocalSharedStorage) GetSharedStoreType() string {
  22. return "Local"
  23. }
  24. func (s *LocalSharedStorage) String() string {
  25. return fmt.Sprintf("Local[LoadBase=%v]", s.LoadBase)
  26. }