Documentation
¶
Index ¶
- func MarshalS3Storage(s3Storage *S3Storage) ([]byte, error)
- type BaseStorage
- type S3Storage
- func (s *S3Storage) DecryptKeys() error
- func (s *S3Storage) DownloadDirectory(remotePath, localPath string) error
- func (s *S3Storage) GetName() string
- func (s *S3Storage) GetType() StorageType
- func (s *S3Storage) InitializeS3Storage() error
- func (s *S3Storage) UploadDirectory(directoryPath string) error
- type Storage
- type StorageManager
- type StorageType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalS3Storage ¶ added in v0.3.0
Types ¶
type BaseStorage ¶
type BaseStorage struct {
Name string `json:"name" db:"name"`
Type StorageType `json:"type" db:"type"`
Data string `json:"data" db:"data"`
}
type S3Storage ¶
type S3Storage struct {
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 NewS3StorageFromBase ¶ added in v0.3.0
func NewS3StorageFromBase(baseStorage BaseStorage) (*S3Storage, error)
func (*S3Storage) DecryptKeys ¶
func (*S3Storage) DownloadDirectory ¶
func (*S3Storage) GetType ¶ added in v0.3.0
func (s *S3Storage) GetType() StorageType
func (*S3Storage) InitializeS3Storage ¶
func (*S3Storage) UploadDirectory ¶
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 Storage ¶
type Storage interface {
UploadDirectory(directoryPath string) error
DownloadDirectory(remotePath, localPath string) error
GetName() string
GetType() StorageType
}
func CreateStorage ¶ added in v0.3.0
func CreateStorage(baseStorage BaseStorage) (Storage, error)
type StorageManager ¶ added in v0.3.0
type StorageManager struct {
// contains filtered or unexported fields
}
func NewStorageManager ¶ added in v0.3.0
func NewStorageManager() *StorageManager
func (*StorageManager) AddStorage ¶ added in v0.3.0
func (sm *StorageManager) AddStorage(stor Storage)
func (*StorageManager) DeleteStorage ¶ added in v0.3.0
func (sm *StorageManager) DeleteStorage(name string)
func (*StorageManager) GetAllStorages ¶ added in v0.3.0
func (sm *StorageManager) GetAllStorages() []Storage
func (*StorageManager) GetStorage ¶ added in v0.3.0
func (sm *StorageManager) GetStorage(name string) Storage
Click to show internal directories.
Click to hide internal directories.