local

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

Documentation

Index

Constants

View Source
const (
	// CloudLocal 云服务商:本地
	CloudLocal = "local"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LSS

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

LSS 本地 LSS 客户端

func NewLSS

func NewLSS(endpoint, bucketName string, opts ...Option) (*LSS, error)

NewLSS 创建一个本地 LSS 客户端

func (*LSS) AuthorizedUpload

func (l *LSS) AuthorizedUpload(key string, expires int) (string, error)

AuthorizedUpload 授权上传至本地 LSS,expires:过期时间(秒)

func (*LSS) Cloud

func (l *LSS) Cloud() string

Cloud 获取云服务商名称

func (*LSS) DeleteObjects

func (l *LSS) DeleteObjects(keys ...string) error

DeleteObjects 批量删除本地 LSS 上的对象

func (*LSS) GetObject

func (l *LSS) GetObject(key string) (io.ReadCloser, error)

GetObject 获取对象在本地 LSS 的存储数据

func (*LSS) GetThumbnailSuffix

func (l *LSS) GetThumbnailSuffix(width, height int, size int64) string

GetThumbnailSuffix 获取缩略图后缀

func (*LSS) GetURL

func (l *LSS) GetURL(key string) string

GetURL 获取对象在本地 LSS 上的完整访问 URL

func (*LSS) PutObject

func (l *LSS) PutObject(key string, reader io.Reader) (string, error)

PutObject 上传对象至本地 LSS

func (*LSS) UploadFile

func (l *LSS) UploadFile(key, filePath string, partSize int64, routines int) (string, error)

UploadFile 上传文件至本地 LSS,filePath:文件路径,partSize:分块大小(字节),routines:并发数

type Option

type Option func(l *LSS)

Option 可选配置

func WithSecure

func WithSecure(secure ...bool) Option

WithSecure 使用安全配置

Jump to

Keyboard shortcuts

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