From cdb5faf043c64cf71e45bada2494daab10f4830b Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Mon, 21 Feb 2022 18:06:11 +0800 Subject: [PATCH] =?UTF-8?q?refactor=F0=9F=8E=A8:=20=20upgrade=20OXS=20inte?= =?UTF-8?q?rface?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/file_store/interface.go | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/common/file_store/interface.go b/common/file_store/interface.go index 5ba5c42..acecbe9 100644 --- a/common/file_store/interface.go +++ b/common/file_store/interface.go @@ -1,6 +1,27 @@ package file_store +// DriverType 驱动类型 +type DriverType string + +const ( + // HuaweiOBS 华为云OBS + HuaweiOBS DriverType = "HuaweiOBS" + // AliYunOSS 阿里云OSS + AliYunOSS DriverType = "AliYunOSS" + // QiNiuKodo 七牛云kodo + QiNiuKodo DriverType = "QiNiuKodo" +) + +type ClientOption map[string]interface{} + +// TODO: FileStoreType名称待定 + +// FileStoreType OXS type FileStoreType interface { - Setup() error - UpLoad(yourObjectName string, localFile string) error + // Setup 装载 endpoint sss + Setup(endpoint, accessKeyID, accessKeySecret, BucketName string, options ...ClientOption) error + // UpLoad 上传 + UpLoad(yourObjectName string, localFile interface{}) error + // GetTempToken 获取临时Token + GetTempToken() (string, error) }