mock

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

Documentation

Index

Constants

View Source
const (
	// CloudMock 云服务商:模拟
	CloudMock = "mock"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MSS

type MSS struct{}

MSS 模拟 MSS 客户端

func NewMSS

func NewMSS() *MSS

NewMSS 创建一个模拟 MSS 客户端

func (*MSS) AuthorizedUpload

func (m *MSS) AuthorizedUpload(key string, expires int) (string, error)

AuthorizedUpload 授权上传至模拟 MSS,expires:过期时间(秒)

func (*MSS) Cloud

func (m *MSS) Cloud() string

Cloud 获取云服务商名称

func (*MSS) DeleteObjects

func (m *MSS) DeleteObjects(keys ...string) error

DeleteObjects 批量删除模拟 MSS 上的对象

func (*MSS) GetObject

func (m *MSS) GetObject(key string) (io.ReadCloser, error)

GetObject 获取对象在模拟 MSS 的存储数据

func (*MSS) GetThumbnailSuffix

func (m *MSS) GetThumbnailSuffix(width, height int, size int64) string

GetThumbnailSuffix 获取缩略图后缀

func (*MSS) GetURL

func (m *MSS) GetURL(key string) string

GetURL 获取对象在模拟 MSS 上的完整访问 URL

func (*MSS) PutObject

func (m *MSS) PutObject(key string, reader io.Reader) (string, error)

PutObject 上传对象至模拟 MSS

func (*MSS) UploadFile

func (m *MSS) UploadFile(key, filePath string, partSize int64, routines int) (string, error)

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

Jump to

Keyboard shortcuts

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