minio

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 (
	// CloudMinIO 云服务商:MinIO
	CloudMinIO = "minio"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MinIO

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

MinIO 客户端

func NewMinIO

func NewMinIO(endpoint, accessKeyID, accessKeySecret, bucketName string, opts ...Option) (*MinIO, error)

NewMinIO 新建一个 MinIO 客户端

func (*MinIO) AuthorizedUpload

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

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

func (*MinIO) Cloud

func (m *MinIO) Cloud() string

Cloud 获取云服务商名称

func (*MinIO) DeleteObjects

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

DeleteObjects 批量删除 MinIO 上的对象

func (*MinIO) GetObject

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

GetObject 获取对象在 MinIO 的存储数据

func (*MinIO) GetThumbnailSuffix

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

GetThumbnailSuffix 获取缩略图后缀

func (*MinIO) GetURL

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

GetURL 获取对象在 MinIO 上的完整访问 URL

func (*MinIO) PutObject

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

PutObject 上传对象至 MinIO

func (*MinIO) UploadFile

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

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

type Option

type Option func(m *MinIO)

Option 可选配置

func WithNotSetACL

func WithNotSetACL(notSetACL ...bool) Option

WithNotSetACL 不设置权限规则

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