minioHelper

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2025 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InfoConfig

type InfoConfig struct {
	EndPoint  string
	AccessKey string
	SecretKey string
	Secure    bool
	Bucket    string
	Domain    string
	TempDir   string
}

InfoConfig 对象服务 MinIO 配置

type Service

type Service struct {
	Client  *minio.Client
	Bucket  string
	Domain  string
	TempDir string
}

Service 服务结构体

func Init

func Init(config *InfoConfig) (*Service, error)

Init 创建并返回 MinIO 服务实例

func (*Service) DeleteObject

func (ms *Service) DeleteObject(objectKey string) error

DeleteObject 用于删除相应对象

func (*Service) GetObjectKeyFromUrl

func (ms *Service) GetObjectKeyFromUrl(fullUrl string) (objectKey string, ok bool)

GetObjectKeyFromUrl 从 Url 中提取 ObjectKey 若该 Url 不是来自此 Minio, 则 ok 为 false

func (*Service) PutObject

func (ms *Service) PutObject(objectKey string, reader io.Reader, size int64, contentType string) (string, error)

PutObject 用于上传对象

Jump to

Keyboard shortcuts

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