storage

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseStorage

type BaseStorage struct {
	Name string `json:"name" db:"name"`
	Type string `json:"type" db:"type"`
	Data string `json:"data" db:"data"`
}

type S3Storage

type S3Storage struct {
	S3StorageMarshaler S3StorageMarshaler `json:"-"`
	Session            *session.Session   `json:"-"`
	S3Client           s3iface.S3API      `json:"-"`
	Name               string             `json:"name"`
	Endpoint           string             `json:"endpoint"`
	Region             string             `json:"region"`
	AccessKey          string             `json:"access_key"`
	SecretKey          string             `json:"secret_key"`
	BucketName         string             `json:"bucket_name"`
}

func NewS3StorageFromJson

func NewS3StorageFromJson(storageData json.RawMessage) (*S3Storage, error)

func (*S3Storage) DecryptKeys

func (s *S3Storage) DecryptKeys() error

func (*S3Storage) DownloadDirectory

func (s *S3Storage) DownloadDirectory(remotePath, localPath string) error

func (*S3Storage) InitializeS3Storage

func (s *S3Storage) InitializeS3Storage() error

func (*S3Storage) UploadDirectory

func (s *S3Storage) UploadDirectory(directoryPath string) error

UploadDirectory uploads the files in the specified directory (including subdirectories) to an S3 storage bucket. If a file already exists in the remote storage, it will be overwritten.

type S3StorageMarshaler

type S3StorageMarshaler interface {
	MarshalS3Storage(s3Storage *S3Storage) ([]byte, error)
}

type S3StorageMarshalerImpl

type S3StorageMarshalerImpl struct {
}

func (*S3StorageMarshalerImpl) MarshalS3Storage

func (s *S3StorageMarshalerImpl) MarshalS3Storage(s3Storage *S3Storage) ([]byte, error)

type Storage

type Storage interface {
	UploadDirectory(directoryPath string) error
	DownloadDirectory(remotePath, localPath string) error
}

type StorageCreator

type StorageCreator interface {
	CreateStorage(storageData json.RawMessage) (Storage, error)
}

type StorageCreatorImpl

type StorageCreatorImpl struct {
}

func (*StorageCreatorImpl) CreateStorage

func (c *StorageCreatorImpl) CreateStorage(storage json.RawMessage) (Storage, error)

Jump to

Keyboard shortcuts

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