Documentation
¶
Index ¶
- Variables
- func InitializeStorageContainer(config *settings.Config) error
- type LocalFileSystemObjectStorage
- func (s *LocalFileSystemObjectStorage) Delete(ctx core.Context, path string) error
- func (s *LocalFileSystemObjectStorage) Exists(ctx core.Context, path string) (bool, error)
- func (s *LocalFileSystemObjectStorage) Read(ctx core.Context, path string) (ObjectInStorage, error)
- func (s *LocalFileSystemObjectStorage) Save(ctx core.Context, path string, object ObjectInStorage) error
- type MinIOObjectStorage
- func (s *MinIOObjectStorage) Delete(ctx core.Context, path string) error
- func (s *MinIOObjectStorage) Exists(ctx core.Context, path string) (bool, error)
- func (s *MinIOObjectStorage) Read(ctx core.Context, path string) (ObjectInStorage, error)
- func (s *MinIOObjectStorage) Save(ctx core.Context, path string, object ObjectInStorage) error
- type ObjectInStorage
- type ObjectStorage
- type StorageContainer
- func (s *StorageContainer) DeleteAvatar(ctx core.Context, path string) error
- func (s *StorageContainer) DeleteTransactionPicture(ctx core.Context, path string) error
- func (s *StorageContainer) ExistsAvatar(ctx core.Context, path string) (bool, error)
- func (s *StorageContainer) ExistsTransactionPicture(ctx core.Context, path string) (bool, error)
- func (s *StorageContainer) ReadAvatar(ctx core.Context, path string) (ObjectInStorage, error)
- func (s *StorageContainer) ReadTransactionPicture(ctx core.Context, path string) (ObjectInStorage, error)
- func (s *StorageContainer) SaveAvatar(ctx core.Context, path string, object ObjectInStorage) error
- func (s *StorageContainer) SaveTransactionPicture(ctx core.Context, path string, object ObjectInStorage) error
- type WebDAVObjectStorage
- func (s *WebDAVObjectStorage) Delete(ctx core.Context, path string) error
- func (s *WebDAVObjectStorage) Exists(ctx core.Context, path string) (bool, error)
- func (s *WebDAVObjectStorage) Read(ctx core.Context, path string) (ObjectInStorage, error)
- func (s *WebDAVObjectStorage) Save(ctx core.Context, path string, object ObjectInStorage) error
Constants ¶
This section is empty.
Variables ¶
var (
Container = &StorageContainer{}
)
Initialize a object storage container singleton instance
Functions ¶
func InitializeStorageContainer ¶
InitializeStorageContainer initializes the current object storage according to the config
Types ¶
type LocalFileSystemObjectStorage ¶
type LocalFileSystemObjectStorage struct {
// contains filtered or unexported fields
}
LocalFileSystemObjectStorage represents local file system object storage
func NewLocalFileSystemObjectStorage ¶
func NewLocalFileSystemObjectStorage(config *settings.Config, pathPrefix string) (*LocalFileSystemObjectStorage, error)
NewLocalFileSystemObjectStorage returns a local file system object storage
func (*LocalFileSystemObjectStorage) Delete ¶
func (s *LocalFileSystemObjectStorage) Delete(ctx core.Context, path string) error
Delete returns whether delete the object according to specified the file path successfully
func (*LocalFileSystemObjectStorage) Read ¶
func (s *LocalFileSystemObjectStorage) Read(ctx core.Context, path string) (ObjectInStorage, error)
Read returns the object instance according to specified the file path
func (*LocalFileSystemObjectStorage) Save ¶
func (s *LocalFileSystemObjectStorage) Save(ctx core.Context, path string, object ObjectInStorage) error
Save returns whether save the object instance successfully
type MinIOObjectStorage ¶
type MinIOObjectStorage struct {
// contains filtered or unexported fields
}
MinIOObjectStorage represents MinIO object storage
func NewMinIOObjectStorage ¶
func NewMinIOObjectStorage(config *settings.Config, pathPrefix string) (*MinIOObjectStorage, error)
NewMinIOObjectStorage returns a MinIO object storage
func (*MinIOObjectStorage) Delete ¶
func (s *MinIOObjectStorage) Delete(ctx core.Context, path string) error
Delete returns whether delete the object according to specified the file path successfully
func (*MinIOObjectStorage) Read ¶
func (s *MinIOObjectStorage) Read(ctx core.Context, path string) (ObjectInStorage, error)
Read returns the object instance according to specified the file path
func (*MinIOObjectStorage) Save ¶
func (s *MinIOObjectStorage) Save(ctx core.Context, path string, object ObjectInStorage) error
Save returns whether save the object instance successfully
type ObjectInStorage ¶
type ObjectInStorage interface {
io.ReadCloser
io.Seeker
}
ObjectInStorage represents the object instance in the storage
type ObjectStorage ¶
type ObjectStorage interface {
Exists(ctx core.Context, path string) (bool, error)
Read(ctx core.Context, path string) (ObjectInStorage, error)
Save(ctx core.Context, path string, object ObjectInStorage) error
Delete(ctx core.Context, path string) error
}
ObjectStorage represents an object storage to store file object
type StorageContainer ¶
type StorageContainer struct {
// contains filtered or unexported fields
}
StorageContainer contains the current object storage
func (*StorageContainer) DeleteAvatar ¶
func (s *StorageContainer) DeleteAvatar(ctx core.Context, path string) error
DeleteAvatar returns whether delete the avatar file from the current avatar object storage successfully
func (*StorageContainer) DeleteTransactionPicture ¶ added in v0.6.0
func (s *StorageContainer) DeleteTransactionPicture(ctx core.Context, path string) error
DeleteTransactionPicture returns whether delete the transaction picture file from the current transaction picture object storage successfully
func (*StorageContainer) ExistsAvatar ¶
ExistsAvatar returns whether the avatar file exists from the current avatar object storage
func (*StorageContainer) ExistsTransactionPicture ¶ added in v0.6.0
ExistsTransactionPicture returns whether the transaction picture file exists from the current transaction picture object storage
func (*StorageContainer) ReadAvatar ¶
func (s *StorageContainer) ReadAvatar(ctx core.Context, path string) (ObjectInStorage, error)
ReadAvatar returns the avatar file from the current avatar object storage
func (*StorageContainer) ReadTransactionPicture ¶ added in v0.6.0
func (s *StorageContainer) ReadTransactionPicture(ctx core.Context, path string) (ObjectInStorage, error)
ReadTransactionPicture returns the transaction picture file from the current transaction picture object storage
func (*StorageContainer) SaveAvatar ¶
func (s *StorageContainer) SaveAvatar(ctx core.Context, path string, object ObjectInStorage) error
SaveAvatar returns whether save the avatar file into the current avatar object storage successfully
func (*StorageContainer) SaveTransactionPicture ¶ added in v0.6.0
func (s *StorageContainer) SaveTransactionPicture(ctx core.Context, path string, object ObjectInStorage) error
SaveTransactionPicture returns whether save the transaction picture file into the current transaction picture object storage successfully
type WebDAVObjectStorage ¶ added in v1.0.0
type WebDAVObjectStorage struct {
// contains filtered or unexported fields
}
WebDAVObjectStorage represents WebDAV object storage
func NewWebDAVObjectStorage ¶ added in v1.0.0
func NewWebDAVObjectStorage(config *settings.Config, pathPrefix string) (*WebDAVObjectStorage, error)
NewWebDAVObjectStorage returns a WebDAV object storage
func (*WebDAVObjectStorage) Delete ¶ added in v1.0.0
func (s *WebDAVObjectStorage) Delete(ctx core.Context, path string) error
Delete returns whether delete the object according to specified the file path successfully
func (*WebDAVObjectStorage) Read ¶ added in v1.0.0
func (s *WebDAVObjectStorage) Read(ctx core.Context, path string) (ObjectInStorage, error)
Read returns the object instance according to specified the file path
func (*WebDAVObjectStorage) Save ¶ added in v1.0.0
func (s *WebDAVObjectStorage) Save(ctx core.Context, path string, object ObjectInStorage) error
Save returns whether save the object instance successfully