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.

storage_feature.go 1.6 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. package cdssdk
  2. import (
  3. "gitlink.org.cn/cloudream/common/pkgs/types"
  4. "gitlink.org.cn/cloudream/common/utils/serder"
  5. )
  6. // 存储服务特性
  7. type StorageFeature interface {
  8. GetType() string
  9. // 输出调试用的字符串,不要包含敏感信息
  10. String() string
  11. }
  12. var _ = serder.UseTypeUnionInternallyTagged(types.Ref(types.NewTypeUnion[StorageFeature](
  13. (*BypassWriteFeature)(nil),
  14. (*MultipartUploadFeature)(nil),
  15. (*InternalServerlessCallFeature)(nil),
  16. )), "type")
  17. // 存储服务支持被非MasterHub直接上传文件
  18. type BypassWriteFeature struct {
  19. serder.Metadata `union:"BypassWrite"`
  20. Type string `json:"type"`
  21. // 存放上传文件的临时目录
  22. TempRoot string `json:"tempRoot"`
  23. }
  24. func (f *BypassWriteFeature) GetType() string {
  25. return "BypassWrite"
  26. }
  27. func (f *BypassWriteFeature) String() string {
  28. return "BypassWrite"
  29. }
  30. // 存储服务支持分段上传
  31. type MultipartUploadFeature struct {
  32. serder.Metadata `union:"MultipartUpload"`
  33. Type string `json:"type"`
  34. }
  35. func (f *MultipartUploadFeature) GetType() string {
  36. return "MultipartUpload"
  37. }
  38. func (f *MultipartUploadFeature) String() string {
  39. return "MultipartUpload"
  40. }
  41. // 在存储服务所在的环境中部署有内部的Serverless服务
  42. type InternalServerlessCallFeature struct {
  43. serder.Metadata `union:"InternalServerlessCall"`
  44. Type string `json:"type"`
  45. CommandDir string `json:"commandDir"` // 存放命令文件的目录
  46. }
  47. func (f *InternalServerlessCallFeature) GetType() string {
  48. return "InternalServerlessCall"
  49. }
  50. func (f *InternalServerlessCallFeature) String() string {
  51. return "InternalServerlessCall"
  52. }