Documentation
¶
Overview ¶
Package storage provides methods related to storage handling
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Region string `json:"region"` Bucket string `json:"bucket"` Key string `json:"key"` }
Config config holds the information related to storage configs
type FileStorage ¶
type FileStorage struct {
// contains filtered or unexported fields
}
FileStorage implements the Storage interface
func NewFileStorage ¶
func NewFileStorage(fileName string) (*FileStorage, error)
NewFileStorage returns a new file storage with fullPath
func (*FileStorage) IsExist ¶
func (f *FileStorage) IsExist() bool
IsExist implements storage interface returns whether the file already exists or not
func (*FileStorage) Read ¶
func (f *FileStorage) Read() ([]byte, error)
Read implements the storage interface Reads the bytes from the file storage
type MockStorage ¶
MockStorage provides mock Storage implementation
func (*MockStorage) IsExist ¶
func (m *MockStorage) IsExist() bool
IsExist implements the Storage interface
func (*MockStorage) Read ¶
func (m *MockStorage) Read() ([]byte, error)
Read implements the storage interface
type S3Storage ¶
type S3Storage struct {
// contains filtered or unexported fields
}
S3Storage is the wrapper for the aws s3 client
func NewS3Storage ¶
NewS3Storage constructs a new s3 client
func (*S3Storage) IsExist ¶
IsExist retrieves metadata from an object to verify whether object exists
type Storage ¶
Storage interface provides all methods required for read/write/checkExistence of any snapshot or diff
func NewStorage ¶
NewStorage gives the current implementation of Storage returns storage object if initialised properly throws error if storage cannot be initialised Default it returns file storage