minioclient

package
v1.90.1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MinioError = errs.Class("minio")

MinioError is class for minio errors.

Functions

This section is empty.

Types

type Client

type Client interface {
	MakeBucket(ctx context.Context, bucket, region string) error
	RemoveBucket(ctx context.Context, bucket string) error
	GetBucketLocation(ctx context.Context, bucket string) (string, error)
	ListBuckets(ctx context.Context) ([]string, error)
	ListBucketsAttribution(ctx context.Context) ([]string, error)

	Upload(ctx context.Context, bucket, objectName string, data []byte) error
	Download(ctx context.Context, bucket, objectName string, buffer []byte) ([]byte, error)
	Delete(ctx context.Context, bucket, objectName string) error
	ListObjects(ctx context.Context, bucket, prefix string) []string
}

Client is the common interface for different implementations.

func NewMinio

func NewMinio(conf Config) (Client, error)

NewMinio creates new Client.

type Config

type Config struct {
	S3Gateway     string
	Satellite     string
	AccessKey     string
	SecretKey     string
	APIKey        string
	EncryptionKey string
	NoSSL         bool
	ConfigDir     string
}

Config is the setup for a particular client.

type Minio

type Minio struct {
	API *minio.Client
	// contains filtered or unexported fields
}

Minio implements basic S3 Client with minio.

func (*Minio) Delete

func (client *Minio) Delete(ctx context.Context, bucket, objectName string) error

Delete deletes object.

func (*Minio) Download

func (client *Minio) Download(ctx context.Context, bucket, objectName string, buffer []byte) ([]byte, error)

Download downloads object data.

func (*Minio) GetBucketLocation

func (client *Minio) GetBucketLocation(ctx context.Context, bucket string) (string, error)

GetBucketLocation returns the bucket's location.

func (*Minio) ListBuckets

func (client *Minio) ListBuckets(ctx context.Context) ([]string, error)

ListBuckets lists all buckets.

func (*Minio) ListBucketsAttribution

func (client *Minio) ListBucketsAttribution(ctx context.Context) ([]string, error)

ListBucketsAttribution lists all buckets with attribution.

func (*Minio) ListObjects

func (client *Minio) ListObjects(ctx context.Context, bucket, prefix string) []string

ListObjects lists objects.

func (*Minio) MakeBucket

func (client *Minio) MakeBucket(ctx context.Context, bucket, region string) error

MakeBucket makes a new bucket.

func (*Minio) RemoveBucket

func (client *Minio) RemoveBucket(ctx context.Context, bucket string) error

RemoveBucket removes a bucket.

func (*Minio) Upload

func (client *Minio) Upload(ctx context.Context, bucket, objectName string, data []byte) error

Upload uploads object data to the specified path.

func (*Minio) UploadMultipart

func (client *Minio) UploadMultipart(ctx context.Context, bucket, objectName string, data []byte, partSize int, threshold int, metadata map[string]string) error

UploadMultipart uses multipart uploads, has hardcoded threshold.

Jump to

Keyboard shortcuts

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