gosdk/storage/storage.go

21 lines
614 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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) string
Stat(objectName string) (*ObjectInfo, error)
List(objectPrefix string) ([]string, error)
Fetch(url, objectName string, local ...bool) error //local参数决定是否先下载到本地在上传七牛云下载企业微信的文件需要不能直接下载
}