Documentation ¶
Index ¶
- Constants
- func NewStorage(ossName string, config Config) error
- type Aliyun
- func (a *Aliyun) DeleteObject(objectKey string) error
- func (a *Aliyun) GetObjectToFile(objectKey, filePath string) error
- func (a *Aliyun) GetObjectUrl(objectKey string) string
- func (a *Aliyun) IsExists(objectKey string) (bool, error)
- func (a *Aliyun) PutObject(objectKey string, reader io.Reader) error
- func (a *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 ( ALIYUN = "aliyun" TENCENT = "tencent" QINIU = "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) GetObjectToFile ¶
获取文件
func (*Aliyun) PutObjectFromFile ¶
type Qiniu ¶
type Qiniu struct {
// contains filtered or unexported fields
}
func (*Qiniu) GetObjectToFile ¶
获取文件
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) PutObjectFromFile ¶
上传文件
Click to show internal directories.
Click to hide internal directories.