minioHandler

package
v0.0.0-...-d9f87ad Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2022 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectMinio

func ConnectMinio(endpoint, accessKeyID, secretKeyID string, useSSL bool) *minio.Client

Types

type Config

type Config struct {
	Workers         int    `env:"CONTENT_SERVICE_MINIO_WORKERS"`
	ChannelCapacity int    `env:"CONTENT_SERVICE_MINIO_CHANNEL_CAPACITY"`
	BucketName      string `env:"CONTENT_SERVICE_MINIO_BUCKET_NAME"`
	Endpoint        string `env:"CONTENT_SERVICE_MINIO_ENDPOINT"`
	AccessKeyID     string `env:"CONTENT_SERVICE_MINIO_ACCESS_KEY"`
	SecretKeyID     string `env:"CONTENT_SERVICE_MINIO_SECRET_KEY"`
	UseSSL          bool   `env:"CONTENT_SERVICE_MINIO_USE_SSL"`
}

func NewConfig

func NewConfig() *Config

func (*Config) FromENV

func (c *Config) FromENV() error

type FileMessage

type FileMessage struct {
	Header *multipart.FileHeader
	File   io.Reader
	Owner  string
	Ctx    context.Context
}

type MinioHandler

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

func New

func New(fileMessagesChan chan FileMessage, config *Config) *MinioHandler

func (*MinioHandler) InitGoroutines

func (mh *MinioHandler) InitGoroutines()

func (*MinioHandler) MinioDeleteFile

func (mh *MinioHandler) MinioDeleteFile(key string, ctx context.Context, owner string) error

func (*MinioHandler) MinioGetFile

func (mh *MinioHandler) MinioGetFile(ctx context.Context, key string, owner string) (*minio.Object, *minio.ObjectInfo, error)

func (*MinioHandler) MinioListFiles

func (mh *MinioHandler) MinioListFiles(ctx context.Context, prefix string) []*Object

func (*MinioHandler) MinioUploadObject

func (mh *MinioHandler) MinioUploadObject(messages <-chan FileMessage)

type Object

type Object struct {
	Key   string `json:"key"`
	Size  int64  `json:"size"`
	Owner string `json:"owner"`
}

Jump to

Keyboard shortcuts

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