minio

package
v0.0.0-...-f55c371 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package minio @Link https://gitee.com/linngc/central.mirror @Copyright Copyright (c) 2022 central CLI @Author linngc @License

Package minio @Link https://gitee.com/linngc/central.mirror @Copyright Copyright (c) 2022 center CLI @Author linngc @License

Package minio @Link https://gitee.com/linngc/central.mirror @Copyright Copyright (c) 2022 central CLI @Author linngc @License

Package minio @Link https://gitee.com/linngc/central.mirror @Copyright Copyright (c) 2022 central CLI @Author linngc @License

Package minio @Link https://gitee.com/linngc/center.mirror @Copyright Copyright (c) 2022 center CLI @Author linngc @License

Index

Constants

This section is empty.

Variables

View Source
var (
	Request = &Minio{}
)

Functions

func NewClientV1

func NewClientV1(types enums.CosType, proxy string) (client service.OssService)

NewClientV1 缓存到minio Cos客户端管理

func OnConfig

func OnConfig(str string)

OnConfig 初始化配置参数信息到内存

Types

type Minio

type Minio struct {
	CosType enums.CosType `dc:"代理仓库缓存类型"`

	Endpoint  string `yaml:"endpoint"   dc:"minio服务地址"`
	SecretId  string `yaml:"secretId" dc:"服务 ID"`
	SecretKey string `yaml:"secretKey"   dc:"服务 Key"`
	Bucket    string `yaml:"bucket"   dc:"对应的桶名称"`
	Region    string `yaml:"region"  dc:"存储地区区域"`
	UseSSL    bool   `yaml:"useSSL"  dc:"服务协议类型,默认不支持ssl"`
	// contains filtered or unexported fields
}

func (*Minio) BucketInfo

func (c *Minio) BucketInfo(ctx context.Context) (*model.BucketInfo, error)

BucketInfo 获取组件配置的Bucket快信息

func (*Minio) GetData

func (c *Minio) GetData(moduleName string, data []byte) (m *model.ObjectsInfo)

GetData 组装数据存储对象

func (*Minio) GetLocation

func (c *Minio) GetLocation(moduleName string) string

GetLocation 组装并获取存储位置

func (*Minio) GetObject

func (c *Minio) GetObject(ctx context.Context, moduleName string) (m *model.ObjectsInfo, err error)

GetObject 获取返回文件流与error @param moduleName 参数是 文件模块名称(请求的文件全路径名称)

func (*Minio) GetObjectExists

func (c *Minio) GetObjectExists(ctx context.Context, moduleName string) (bool, error)

GetObjectExists 获取文件是否存在 @param moduleName 参数是 文件模块名称(请求的文件全路径名称)

func (*Minio) GetObjectList

func (c *Minio) GetObjectList(ctx context.Context, moduleNames []string) (list []*model.ObjectsInfo, err error)

GetObjectList 获取对象存储服务下所有件夹列表 @param moduleName 参数是 文件模块名称(请求的文件全路径名称)

func (*Minio) GetObjectUrl

func (c *Minio) GetObjectUrl(ctx context.Context, moduleName string) (string, error)

GetObjectUrl 获取文件的外链url @param moduleName 参数是 文件模块名称(请求的文件全路径名称)

func (*Minio) PutByObject

func (c *Minio) PutByObject(ctx context.Context, moduleName string, reader []byte) (err error)

PutByObject 上传对象 @param moduleName 参数是 文件模块名称(请求的文件全路径名称) @param reader 参数是 文件字节数据

func (*Minio) PutByObjectList

func (c *Minio) PutByObjectList(ctx context.Context, maps map[string][]byte) (err error)

PutByObjectList 上传对象 @param maps key 参数是 文件模块名称(请求的文件全路径名称),value 参数是 文件字节数据

func (*Minio) RemoveByObject

func (c *Minio) RemoveByObject(ctx context.Context, moduleName string) error

RemoveByObject 删除对象 @param moduleName 参数是 文件模块名称(请求的文件全路径名称)

func (*Minio) RemoveByObjectList

func (c *Minio) RemoveByObjectList(ctx context.Context, moduleNames []string) error

RemoveByObjectList 删除对象集合 @param moduleName 参数是 文件模块名称(请求的文件全路径名称)

Jump to

Keyboard shortcuts

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