storage

package
v0.0.0-...-45bb23c Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSConfig

type AWSConfig struct {
	BucketName string
	AccID      string
	SecretKey  string
	Region     string
}

AWSConfig is config for aws s3 storage.

type MinioConfig

type MinioConfig struct {
	BucketName string
	AccID      string
	SecretKey  string
	Region     string
	Endpoint   string
}

MinioConfig is config for minio storage.

type MinioStorage

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

MinioStorage holds config and minio client.

func NewMinio

func NewMinio(conf *MinioConfig) (*MinioStorage, error)

NewMinio is constructor for MinioStorage.

func (*MinioStorage) DownloadImageFromID

func (m *MinioStorage) DownloadImageFromID(fileID string) (string, error)

DownloadImageFromID downloads image from image id.

func (*MinioStorage) UploadFile

func (m *MinioStorage) UploadFile(image io.ReadSeeker, fileID string) error

UploadFile uploads file to minio bucket.

type Storage

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

Storage holds config and s3 methods.

func NewS3

func NewS3(conf *AWSConfig) (*Storage, error)

NewS3 is constructor for Storage.

func (*Storage) DownloadImageFromID

func (s *Storage) DownloadImageFromID(fileID string) (string, error)

DownloadImageFromID downloads image from image id.

func (*Storage) UploadFile

func (s *Storage) UploadFile(image io.ReadSeeker, fileID string) error

UploadFile uploads file to aws s3 bucket.

type StoragesInterface

type StoragesInterface interface {
	UploadFile(image io.ReadSeeker, fileID string) error
	DownloadImageFromID(fileID string) (string, error)
}

StoragesInterface contains all minio and aws s3 methods.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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