huawei

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: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CloudHuawei 云服务商:华为云
	CloudHuawei = "huawei"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type OBS

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

OBS 华为云 OBS 客户端

func NewOBS

func NewOBS(endpoint, accessKeyID, accessKeySecret, bucketName string, opts ...Option) (*OBS, error)

NewOBS 创建一个华为云 OBS 客户端

func (*OBS) AuthorizedUpload

func (o *OBS) AuthorizedUpload(key string, expires int) (string, error)

AuthorizedUpload 授权上传至华为云 OBS,expires:过期时间(秒)

func (*OBS) Cloud

func (o *OBS) Cloud() string

Cloud 获取云服务商名称

func (*OBS) DeleteObjects

func (o *OBS) DeleteObjects(keys ...string) error

DeleteObjects 批量删除华为云 OBS 上的对象

func (*OBS) GetObject

func (o *OBS) GetObject(key string) (io.ReadCloser, error)

GetObject 获取对象在华为云 OBS 的存储数据

func (*OBS) GetThumbnailSuffix

func (o *OBS) GetThumbnailSuffix(width, height int, size int64) string

GetThumbnailSuffix 获取缩略图后缀

func (*OBS) GetURL

func (o *OBS) GetURL(key string) string

GetURL 获取对象在华为云 OBS 上的完整访问 URL

func (*OBS) PutObject

func (o *OBS) PutObject(key string, reader io.Reader) (string, error)

PutObject 上传对象至华为云 OBS

func (*OBS) UploadFile

func (o *OBS) UploadFile(key, filePath string, partSize int64, routines int) (string, error)

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

type Option

type Option func(o *OBS)

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