Documentation
¶
Index ¶
- Variables
- func SetBaseCloudDisk()
- type CloudDisk
- type NewCloudDisk
- type TencentCloudDisk
- func (cloud *TencentCloudDisk) DeleteObject(userId string, filePath string, items []string) error
- func (cloud *TencentCloudDisk) DeleteObjectFilefolder(userId string, filePath string) error
- func (cloud *TencentCloudDisk) GetDownloadPresignedURL(userId string, filePath string, fileName string) (string, error)
- func (cloud *TencentCloudDisk) GetObjectURL(userId string, filePath string, fileName string) (string, error)
- func (cloud *TencentCloudDisk) GetUploadPresignedURL(userId string, filePath string, fileName string) (string, error)
- func (cloud *TencentCloudDisk) IsObjectExist(userId string, filePath string, fileName string) (bool, error)
- func (cloud *TencentCloudDisk) UploadSimpleFile(localFilePath string, userId string, md5 string, fileSize int64) error
Constants ¶
This section is empty.
Variables ¶
View Source
var NewCloudDiskMap map[string]NewCloudDisk
Functions ¶
func SetBaseCloudDisk ¶
func SetBaseCloudDisk()
Types ¶
type CloudDisk ¶
type CloudDisk interface { // GetUploadPresignedURL generate presigned URL. // user can use presigned url to upload file by put method GetUploadPresignedURL(userId string, filePath string, fileName string) (string, error) // GetDownloadPresignedURL generate presigned URL. // user can use presigned url to download file by get method GetDownloadPresignedURL(userId string, filePath string, fileName string) (string, error) // GetObjectURL generate a object URL. User can use URL to view the file. GetObjectURL(userId string, filePath string, fileName string) (string, error) // DeleteObject delete user object DeleteObject(userId string, filePath string, items []string) error // DeleteObjectFilefold delete user object folder DeleteObjectFilefolder(userId string, filePath string) error // IsObjectExist check file is exist IsObjectExist(userId string, filePath string, fileName string) (bool, error) // UploadSimpleFile upload file smaller than 1GB to the cloud UploadSimpleFile(localFilePath string, userId string, md5 string, fileSize int64) error }
var BaseCloudDisk CloudDisk
type NewCloudDisk ¶
type NewCloudDisk func() CloudDisk
type TencentCloudDisk ¶
type TencentCloudDisk struct {
// contains filtered or unexported fields
}
func (*TencentCloudDisk) DeleteObject ¶
func (cloud *TencentCloudDisk) DeleteObject(userId string, filePath string, items []string) error
DeleteObject use items to build keys
func (*TencentCloudDisk) DeleteObjectFilefolder ¶
func (cloud *TencentCloudDisk) DeleteObjectFilefolder(userId string, filePath string) error
DeleteObjectFilefolder delete user filefolder in cloud
func (*TencentCloudDisk) GetDownloadPresignedURL ¶
func (*TencentCloudDisk) GetObjectURL ¶
func (cloud *TencentCloudDisk) GetObjectURL(userId string, filePath string, fileName string) (string, error)
GetObjectURL use userId, filePath, fileName to generate cloud disk key
func (*TencentCloudDisk) GetUploadPresignedURL ¶
func (cloud *TencentCloudDisk) GetUploadPresignedURL(userId string, filePath string, fileName string) (string, error)
GetUploadPresignedURL use userId, filePath, fileName to generate cloud disk key
func (*TencentCloudDisk) IsObjectExist ¶
func (cloud *TencentCloudDisk) IsObjectExist(userId string, filePath string, fileName string) (bool, error)
IsObjectExist check object is exist
func (*TencentCloudDisk) UploadSimpleFile ¶
func (cloud *TencentCloudDisk) UploadSimpleFile(localFilePath string, userId string, md5 string, fileSize int64) error
UploadSimpleFile upload file smaller than 1GB to the cloud
Click to show internal directories.
Click to hide internal directories.