This commit is contained in:
withchao
2023-03-15 11:24:59 +08:00
parent 316fa10257
commit e9865539de
7 changed files with 144 additions and 140 deletions
+4 -5
View File
@@ -20,10 +20,8 @@ type ApplyPutArgs struct {
}
type ObjectInfo struct {
URL string
Size int64
Hash string
Expiration time.Time
Size int64
Hash string
}
type Interface interface {
@@ -40,7 +38,8 @@ type Interface interface {
// DataBucket 永久存储的桶名
DataBucket() string
// GetURL 通过桶名和对象名返回URL
GetURL(bucket string, name string) string
//GetURL(bucket string, name string) string
GetURL(ctx context.Context, bucket string, name string, expires time.Duration) (string, error)
// PresignedPutURL 申请上传,返回PUT的上传地址
PresignedPutURL(ctx context.Context, args *ApplyPutArgs) (string, error)
// GetObjectInfo 获取对象信息