aliyun

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

Documentation

Index

Constants

View Source
const (
	// CloudAliyun 云服务商:阿里云
	CloudAliyun = "aliyun"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type OSS

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

OSS 阿里云 OSS 客户端

func NewOSS

func NewOSS(endpoint, accessKeyID, accessKeySecret, bucketName string, opts ...Option) (*OSS, error)

NewOSS 创建一个阿里云 OSS 客户端

func (*OSS) AuthorizedUpload

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

AuthorizedUpload 授权上传至阿里云 OSS,expires:过期时间(秒)

func (*OSS) Cloud

func (o *OSS) Cloud() string

Cloud 获取云服务商名称

func (*OSS) DeleteObjects

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

DeleteObjects 批量删除阿里云 OSS 上的对象

func (*OSS) GetObject

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

GetObject 获取对象在阿里云 OSS 的存储数据

func (*OSS) GetThumbnailSuffix

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

GetThumbnailSuffix 获取缩略图后缀

func (*OSS) GetURL

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

GetURL 获取对象在阿里云 OSS 上的完整访问 URL

func (*OSS) PutObject

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

PutObject 上传对象至阿里云 OSS

func (*OSS) UploadFile

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

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

type Option

type Option func(o *OSS)

Option 可选配置

func WithNotSetACL

func WithNotSetACL(notSetACL ...bool) Option

WithNotSetACL 不设置权限规则

func WithUploadInternal

func WithUploadInternal(uploadInternal ...bool) Option

WithUploadInternal 使用内网上传配置

Jump to

Keyboard shortcuts

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