storages

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2021 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProviderSet = wire.NewSet(NewFileManager)

Functions

This section is empty.

Types

type FileManager

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

func (*FileManager) ArchiveDirectory

func (m *FileManager) ArchiveDirectory(volume, directory string) (file *os.File, err error)

func (*FileManager) ArchiveVolume

func (m *FileManager) ArchiveVolume(volume *models.Volume) (file *os.File, err error)

func (*FileManager) CreateDirectory

func (m *FileManager) CreateDirectory(volume, directory string) error

func (*FileManager) CreateFile

func (m *FileManager) CreateFile(volume, fileName string, data []byte) error

func (*FileManager) FetchFile

func (m *FileManager) FetchFile(volume, fileName string) ([]byte, error)

func (*FileManager) IsFileExists

func (m *FileManager) IsFileExists(volume, fileName string) bool

type Storage

type Storage interface {
	CreateDirectory(volume, directory string) error
	CreateFile(volume, fileName string, data []byte) error
	IsFileExists(volume, fileName string) bool
	FetchFile(volume, fileName string) ([]byte, error)

	ArchiveDirectory(volume, directory string) (file *os.File, err error)
	ArchiveVolume(volume *models.Volume) (file *os.File, err error)
}

func CreateFileRepository

func CreateFileRepository(f string) (Storage, error)

func NewFileManager

func NewFileManager(logger *zap.Logger, fm files.FileManager) Storage

Jump to

Keyboard shortcuts

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