tencent

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CloudTencent 云服务商:腾讯云
	CloudTencent = "tencent"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type COS

type COS struct {
	// contains filtered or unexported fields
}

COS 腾讯云 COS 客户端

func NewCOS

func NewCOS(endpoint, accessKeyID, accessKeySecret, bucketName string, opts ...Option) (*COS, error)

NewCOS 创建一个腾讯云 COS 客户端

func (*COS) AuthorizedUpload

func (c *COS) AuthorizedUpload(key string, expires int) (string, error)

AuthorizedUpload 授权上传至腾讯云 COS,expires:过期时间(秒)

func (*COS) Cloud

func (c *COS) Cloud() string

Cloud 获取云服务商名称

func (*COS) DeleteObjects

func (c *COS) DeleteObjects(keys ...string) error

DeleteObjects 批量删除腾讯云 COS 上的对象

func (*COS) GetObject

func (c *COS) GetObject(key string) (io.ReadCloser, error)

GetObject 获取对象在腾讯云 COS 的存储数据

func (*COS) GetThumbnailSuffix

func (c *COS) GetThumbnailSuffix(width, height int, size int64) string

GetThumbnailSuffix 获取缩略图后缀

func (*COS) GetURL

func (c *COS) GetURL(key string) string

GetURL 获取对象在腾讯云 COS 上的完整访问 URL

func (*COS) PutObject

func (c *COS) PutObject(key string, reader io.Reader) (string, error)

PutObject 上传对象至腾讯云 COS

func (*COS) UploadFile

func (c *COS) UploadFile(key, filePath string, partSize int64, routines int) (string, error)

UploadFile 上传文件至腾讯云 COS,filePath:文件路径,partSize:分块大小(字节),routines:并发数

type Option

type Option func(c *COS)

Option 可选配置

func WithNotSetACL

func WithNotSetACL(notSetACL ...bool) Option

WithNotSetACL 不设置权限规则

Jump to

Keyboard shortcuts

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