repository

package
v0.0.0-...-bc40552 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMinio

func NewMinio(cfg MinioConfig) (*minio.Client, error)

Types

type ImageStorage

type ImageStorage interface {
	SaveImage(ctx context.Context, img []byte, filename string, category string) error
	GetImage(ctx context.Context, imageID string, category string) ([]byte, error)
	IsImageExist(ctx context.Context, imageID string, category string) (bool, error)
	DeleteImage(ctx context.Context, imageID string, category string) error
	RewriteImage(ctx context.Context, img []byte, filename string, category string) error
}

type LocalImageStorage

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

func NewLocalStorage

func NewLocalStorage(logger *logrus.Logger, baseStoragePath string) *LocalImageStorage

func (*LocalImageStorage) DeleteImage

func (s *LocalImageStorage) DeleteImage(ctx context.Context, filename string, relativePath string) (err error)

func (*LocalImageStorage) GetImage

func (s *LocalImageStorage) GetImage(ctx context.Context, filename string, relativePath string) (image []byte, err error)

func (*LocalImageStorage) IsImageExist

func (s *LocalImageStorage) IsImageExist(ctx context.Context, filename string, relativePath string) (exist bool, err error)

func (*LocalImageStorage) RewriteImage

func (s *LocalImageStorage) RewriteImage(ctx context.Context, img []byte, filename string, relativePath string) (err error)

func (*LocalImageStorage) SaveImage

func (s *LocalImageStorage) SaveImage(ctx context.Context, img []byte, filename string, relativePath string) (err error)

func (*LocalImageStorage) Shutdown

func (s *LocalImageStorage) Shutdown()

type MinioConfig

type MinioConfig struct {
	Endpoint        string
	AccessKeyID     string
	SecretAccessKey string
	Secure          bool
}

type MinioStorage

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

func NewMinioStorage

func NewMinioStorage(logger *logrus.Logger, storage *minio.Client) *MinioStorage

func (*MinioStorage) DeleteImage

func (s *MinioStorage) DeleteImage(ctx context.Context, filename string, category string) (err error)

func (*MinioStorage) GetImage

func (s *MinioStorage) GetImage(ctx context.Context, filename string, category string) (image []byte, err error)

func (*MinioStorage) IsImageExist

func (s *MinioStorage) IsImageExist(ctx context.Context, filename string, category string) (exist bool, err error)

func (*MinioStorage) RewriteImage

func (s *MinioStorage) RewriteImage(ctx context.Context, img []byte, filename string, category string) (err error)

func (*MinioStorage) SaveImage

func (s *MinioStorage) SaveImage(ctx context.Context, img []byte, filename string, category string) (err error)

Directories

Path Synopsis
Package mock_repository is a generated GoMock package.
Package mock_repository is a generated GoMock package.

Jump to

Keyboard shortcuts

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