Documentation ¶
Index ¶
- func NewMinio(cfg MinioConfig) (*minio.Client, error)
- type ImageStorage
- type LocalImageStorage
- func (s *LocalImageStorage) DeleteImage(ctx context.Context, filename string, relativePath string) (err error)
- func (s *LocalImageStorage) GetImage(ctx context.Context, filename string, relativePath string) (image []byte, err error)
- func (s *LocalImageStorage) IsImageExist(ctx context.Context, filename string, relativePath string) (exist bool, err error)
- func (s *LocalImageStorage) RewriteImage(ctx context.Context, img []byte, filename string, relativePath string) (err error)
- func (s *LocalImageStorage) SaveImage(ctx context.Context, img []byte, filename string, relativePath string) (err error)
- func (s *LocalImageStorage) Shutdown()
- type MinioConfig
- type MinioStorage
- func (s *MinioStorage) DeleteImage(ctx context.Context, filename string, category string) (err error)
- func (s *MinioStorage) GetImage(ctx context.Context, filename string, category string) (image []byte, err error)
- func (s *MinioStorage) IsImageExist(ctx context.Context, filename string, category string) (exist bool, err error)
- func (s *MinioStorage) RewriteImage(ctx context.Context, img []byte, filename string, category string) (err error)
- func (s *MinioStorage) SaveImage(ctx context.Context, img []byte, filename string, category string) (err error)
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 (*LocalImageStorage) IsImageExist ¶
func (*LocalImageStorage) RewriteImage ¶
func (*LocalImageStorage) Shutdown ¶
func (s *LocalImageStorage) Shutdown()
type MinioConfig ¶
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 (*MinioStorage) IsImageExist ¶
func (*MinioStorage) RewriteImage ¶
Click to show internal directories.
Click to hide internal directories.