minio_adapter

package
v0.0.0-...-949e8d3 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSendingObject = fmt.Errorf("error while sending object to storage")

Functions

This section is empty.

Types

type Adapter

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

func New

func New(logger *zerolog.Logger, config *MinioConfig, secure bool) (*Adapter, error)

New creates a new MinIO file storage Adapter.

func (a *Adapter) GetPublicLink(objName string) string

func (*Adapter) Remove

func (a *Adapter) Remove(ctx context.Context, objName string) error

func (*Adapter) Save

func (a *Adapter) Save(ctx context.Context, objName, contentType string, data io.Reader, size int64) (string, error)

Save saves file in the MinIO and returns created object's name.

type MinioConfig

type MinioConfig struct {
	ServerURL  string `long:"url"`
	AccessKey  string `long:"access"`
	SecretKey  string `long:"secret"`
	BucketName string `long:"bucket"`
	TestFile   string `long:"test-file"`
}

Jump to

Keyboard shortcuts

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