miniocli

package
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckBucket

func CheckBucket(ctx context.Context, bucketName string) (err error)

CheckBucket 检查桶是否存在,不存在则创建

func Connect

func Connect(addr string, options ...Option)

Connect 连接minio

func DelObject

func DelObject(ctx context.Context, bucketName, objName string) (err error)

DelObject 删除对象

func GetObject

func GetObject(ctx context.Context, bucketName, objName string) (obj *minio.Object, err error)

GetObject 获取对象

func PreSignedGetObject

func PreSignedGetObject(ctx context.Context, bucketName, objName string, expiration time.Duration) (url string, err error)

PreSignedGetObject 生成带有授权访问的临时URL

func PutObject

func PutObject(ctx context.Context, bucketName, objectName string, reader io.Reader, objectSize int64, contentType string) (err error)

PutObject 上传对象

Types

type Option

type Option func(*Options)

func WithAccess

func WithAccess(id, secret string) Option

WithAccess 设置访问密钥

func WithSSL

func WithSSL(useSSL bool) Option

WithSSL 使用SSL

type Options

type Options struct {
	AccessKeyID     string
	SecretAccessKey string
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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