minio

package module
v0.0.0-...-2aa3a47 Latest Latest
Warning

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

Go to latest
Published: May 26, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultContentType = "multipart/form-data"
)

Variables

View Source
var (
	ErrorBucketExist = errors.New("bucket already exist")
)

Functions

This section is empty.

Types

type Credentials

type Credentials struct {
	Endpoint  string `json:"endpoint"`
	Url       string `json:"url"`
	AccessKey string `json:"accessKey"`
	SecretKey string `json:"secretKey"`
	Api       string `json:"api"`
	Path      string `json:"path"`
}

{"url":"http://127.0.0.1:9000","accessKey":"MJKJ20AedWTKEfDVXJGh","secretKey":"eVJLUEZv0jNLFZjKBHX62GgiMNCG19YqO5SyWc0F","api":"s3v4","path":"auto"}

type Service

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

func NewService

func NewService(credentialFile string) (*Service, error)

func (*Service) GetFile

func (s *Service) GetFile(bucketName, objectName string) (*minio.Object, error)

func (*Service) MakeBucket

func (s *Service) MakeBucket(bucketName string) error

func (*Service) UploadHttpFile

func (s *Service) UploadHttpFile(bucketName, ossName string, fileSize int64, reader io.Reader) error

UploadHttpFile http方式存储文件

@param bucketName string 桶对象 @param ossName string 资源对象名(上传后存储的名字) @param fileSize int64 文件大小 @param reader io.Reader io文件

@return

func (*Service) UploadLocalFile

func (s *Service) UploadLocalFile(bucketName, ossName, file string) error

UploadLocalFile 上传本地文件到oss服务

@param bucketName string 桶对象 @param ossName string 资源对象名(上传后存储的名字) @param file string 具体的文件(相对路径,并完整路径名称)

@return

Jump to

Keyboard shortcuts

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