Documentation ¶
Index ¶
- Constants
- func NewStorage(ossName string, config Config) error
- type AliYun
- func (aliYun *AliYun) DeleteObject(objectKey string) error
- func (aliYun *AliYun) GetObjectToFile(objectKey, filePath string) error
- func (aliYun *AliYun) GetObjectUrl(objectKey string) string
- func (aliYun *AliYun) IsExists(objectKey string) (bool, error)
- func (aliYun *AliYun) PutObject(objectKey string, reader io.Reader) error
- func (aliYun *AliYun) PutObjectFromFile(objectKey, filePath string) error
- type Config
- type QiNiu
- func (q *QiNiu) DeleteObject(objectKey string) error
- func (q *QiNiu) GetObjectToFile(objectKey, filePath string) error
- func (q *QiNiu) GetObjectUrl(objectKey string) string
- func (q *QiNiu) IsExists(objectKey string) (bool, error)
- func (q *QiNiu) PutObject(objectKey string, reader io.Reader) error
- func (q *QiNiu) PutObjectFromFile(objectKey, filePath string) error
- type Storage
- type Tencent
- func (t *Tencent) DeleteObject(objectKey string) error
- func (t *Tencent) GetObjectToFile(objectKey, filePath string) error
- func (t *Tencent) GetObjectUrl(objectKey string) string
- func (t *Tencent) IsExists(objectKey string) (bool, error)
- func (t *Tencent) PutObject(objectKey string, reader io.Reader) error
- func (t *Tencent) PutObjectFromFile(objectKey, filePath string) error
Constants ¶
View Source
const ( AliYunConst = "aliYun" TencentConst = "tencent" QinNiuConst = "qiNiu" )
View Source
const (
TempFileSuffix = ".temp" // Temp file suffix
)
Variables ¶
This section is empty.
Functions ¶
func NewStorage ¶
Types ¶
type AliYun ¶
type AliYun struct {
// contains filtered or unexported fields
}
func (*AliYun) DeleteObject ¶
DeleteObject 删除文件
func (*AliYun) GetObjectToFile ¶
GetObjectToFile 获取文件
func (*AliYun) GetObjectUrl ¶
GetObjectUrl 获取访问URL
func (*AliYun) PutObjectFromFile ¶
type QiNiu ¶
type QiNiu struct {
// contains filtered or unexported fields
}
func (*QiNiu) GetObjectToFile ¶
GetObjectToFile 获取文件
func (*QiNiu) GetObjectUrl ¶
GetObjectUrl 获取访问URL
func (*QiNiu) PutObjectFromFile ¶
type Storage ¶
type Storage interface { GetObjectToFile(objectKey, downloadedFileName string) error DeleteObject(objectKey string) error PutObject(objectKey string, reader io.Reader) error PutObjectFromFile(objectKey, filePath string) error IsExists(objectKey string) (bool, error) GetObjectUrl(objectKey string) string }
func GetStorage ¶
type Tencent ¶
type Tencent struct {
// contains filtered or unexported fields
}
func (*Tencent) GetObjectToFile ¶
获取文件
func (*Tencent) GetObjectUrl ¶
GetObjectUrl 获取访问URL
func (*Tencent) PutObjectFromFile ¶
PutObjectFromFile 上传文件
Click to show internal directories.
Click to hide internal directories.