storage

package
v0.0.0-...-0741b92 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	PutObject(objectName string, data []byte) (string, error)
	GetObject(objectName string) ([]byte, error)
	Size(objectName string) int64
	IsExists(objectName string) bool
	Proxy(c echo.Context, objectName string) error
}

type FileSystemBackend

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

func NewFileSystemBackend

func NewFileSystemBackend(dir string) *FileSystemBackend

func (*FileSystemBackend) GetObject

func (fs *FileSystemBackend) GetObject(objectName string) ([]byte, error)

func (*FileSystemBackend) IsExists

func (fs *FileSystemBackend) IsExists(objectName string) bool

func (*FileSystemBackend) Proxy

func (fs *FileSystemBackend) Proxy(c echo.Context, objectName string) error

func (*FileSystemBackend) PutObject

func (fs *FileSystemBackend) PutObject(objectName string, data []byte) (string, error)

func (*FileSystemBackend) Size

func (fs *FileSystemBackend) Size(objectName string) int64

type Storage

type Storage interface {
	GetFile(directory string, filename string) (*entity.ProcessingFile, error)
	ReadFileBytes(file *entity.ProcessingFile, directories ...string) error
	StoreFile(file *entity.ProcessingFile, directories ...string) error
	Proxy(c echo.Context, objectName string) error
}

func NewStorage

func NewStorage(backend Backend) Storage

Jump to

Keyboard shortcuts

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