Browse Source

增加serverless的feature

gitlink
Sydonian 1 year ago
parent
commit
b0636d7673
1 changed files with 23 additions and 7 deletions
  1. +23
    -7
      sdks/storage/storage_feature.go

+ 23
- 7
sdks/storage/storage_feature.go View File

@@ -13,24 +13,25 @@ type StorageFeature interface {
} }


var _ = serder.UseTypeUnionInternallyTagged(types.Ref(types.NewTypeUnion[StorageFeature]( var _ = serder.UseTypeUnionInternallyTagged(types.Ref(types.NewTypeUnion[StorageFeature](
(*BypassUploadFeature)(nil),
(*BypassWriteFeature)(nil),
(*MultipartUploadFeature)(nil), (*MultipartUploadFeature)(nil),
(*InternalServerlessCallFeature)(nil),
)), "type") )), "type")


// 存储服务支持被非MasterHub直接上传文件 // 存储服务支持被非MasterHub直接上传文件
type BypassUploadFeature struct {
serder.Metadata `union:"BypassUpload"`
type BypassWriteFeature struct {
serder.Metadata `union:"BypassWrite"`
Type string `json:"type"` Type string `json:"type"`
// 存放上传文件的临时目录 // 存放上传文件的临时目录
TempRoot string `json:"tempRoot"` TempRoot string `json:"tempRoot"`
} }


func (f *BypassUploadFeature) GetType() string {
return "BypassUpload"
func (f *BypassWriteFeature) GetType() string {
return "BypassWrite"
} }


func (f *BypassUploadFeature) String() string {
return "BypassUpload"
func (f *BypassWriteFeature) String() string {
return "BypassWrite"
} }


// 存储服务支持分段上传 // 存储服务支持分段上传
@@ -46,3 +47,18 @@ func (f *MultipartUploadFeature) GetType() string {
func (f *MultipartUploadFeature) String() string { func (f *MultipartUploadFeature) String() string {
return "MultipartUpload" return "MultipartUpload"
} }

// 在存储服务所在的环境中部署有内部的Serverless服务
type InternalServerlessCallFeature struct {
serder.Metadata `union:"InternalServerlessCall"`
Type string `json:"type"`
CommandDir string `json:"commandDir"` // 存放命令文件的目录
}

func (f *InternalServerlessCallFeature) GetType() string {
return "InternalServerlessCall"
}

func (f *InternalServerlessCallFeature) String() string {
return "InternalServerlessCall"
}

Loading…
Cancel
Save