storages

package
v0.0.29 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2021 License: AGPL-3.0 Imports: 16 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) CreateDirectory

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

func (*FileManager) CreateFile

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

func (*FileManager) FetchDirectory added in v0.0.25

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

func (*FileManager) FetchFile

func (m *FileManager) FetchFile(volume *models.Volume, fileName string) (*os.File, 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 *models.Volume, fileName string) (*os.File, error)
	FetchDirectory(volume *models.Volume, directory string) (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