services

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type DefaultService

type DefaultService struct {
	Repository repositories.Repository
	Storage    storages.Storage
	// contains filtered or unexported fields
}

func (DefaultService) CopyFile added in v0.0.25

func (d DefaultService) CopyFile(ov, od, of, nv, nd, nf string) (*models.Volume, error)

func (DefaultService) CreateDirectory

func (d DefaultService) CreateDirectory(baseVolumeName, dirname string) (*models.Volume, error)

func (DefaultService) CreateFile

func (d DefaultService) CreateFile(baseVolumeName, dirname, filename string, file []byte) (*models.Volume, error)

func (DefaultService) CreateVolume

func (d DefaultService) CreateVolume(accountID uint64) (*models.Volume, error)

func (DefaultService) GetDirectory

func (d DefaultService) GetDirectory(volumeName, dirname string) (file *os.File, err error)

func (DefaultService) GetFile

func (d DefaultService) GetFile(volumeName, filename string) (*os.File, error)

func (DefaultService) GetVolume

func (d DefaultService) GetVolume(volumeName string) (*models.Volume, error)

func (DefaultService) GetVolumeChain

func (d DefaultService) GetVolumeChain(volume *models.Volume) ([]*models.Volume, error)

func (DefaultService) RemoveFile added in v0.0.25

func (d DefaultService) RemoveFile(baseVolumeName, dirname, filename string) (*models.Volume, error)

type Service

type Service interface {
	CreateVolume(createdBy uint64) (*models.Volume, error)

	CreateDirectory(baseVolumeName, dirname string) (*models.Volume, error)
	CreateFile(baseVolumeName, dirname, filename string, file []byte) (*models.Volume, error)
	RemoveFile(baseVolumeName, dirname, filename string) (*models.Volume, error)
	CopyFile(ov, od, of, nv, nd, nf string) (*models.Volume, error)

	GetVolume(volumeName string) (*models.Volume, error)
	GetDirectory(volumeName, dirname string) (file *os.File, err error)
	GetFile(volumeName, filename string) (*os.File, error)
}

func CreateVolumesService

func CreateVolumesService(cf string, sto storages.Storage, repository repositories.Repository) (Service, error)

func NewVolumeService

func NewVolumeService(logger *zap.Logger, Storage storages.Storage, Repository repositories.Repository) Service

Jump to

Keyboard shortcuts

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