disk

package
v0.0.0-...-4aebee4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

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

func NewTencentCloudDisk

func NewTencentCloudDisk() CloudDisk

create new tencent cloud disk

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 (cloud *TencentCloudDisk) GetDownloadPresignedURL(userId string, filePath string, fileName string) (string, error)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL