21 lines
666 B
Go
21 lines
666 B
Go
package storage
|
||
|
||
import "time"
|
||
|
||
type ObjectInfo struct {
|
||
Size int64
|
||
MimeType string
|
||
Hash string
|
||
PutTime int64
|
||
}
|
||
|
||
type Storage interface {
|
||
Put(fileName, objectName string, onProcess func(fsize, uploaded int64)) error
|
||
Get(objectName, fileName string) error
|
||
Del(objectName string) error
|
||
Url(objectName string, expire time.Duration, https ...bool) string //https参数是否生成https参数
|
||
Stat(objectName string) (*ObjectInfo, error)
|
||
List(objectPrefix string) ([]string, error)
|
||
Fetch(url, objectName string, local ...bool) error //local参数决定是否先下载到本地在上传,七牛云下载企业微信的文件需要不能直接下载
|
||
}
|