Documentation
¶
Index ¶
- Variables
- type DefaultService
- func (d DefaultService) CreateDirectory(baseVolumeName, dirname string) (*models.Volume, error)
- func (d DefaultService) CreateFile(baseVolumeName, filename string, file []byte) (*models.Volume, error)
- func (d DefaultService) CreateVolume(accountID uint64) (*models.Volume, error)
- func (d DefaultService) DownloadDirectory(volumeName, dirname string) (file *os.File, err error)
- func (d DefaultService) GetDirectory(volumeName, dirname string) (directories, files []string, err error)
- func (d DefaultService) GetFile(volumeName, dirname, filename string) ([]byte, error)
- func (d DefaultService) GetVolume(volumeName string) (*models.Volume, error)
- func (d DefaultService) GetVolumeChain(volume *models.Volume) ([]*models.Volume, error)
- func (d DefaultService) GetVolumeFileRecords(volume *models.Volume, filePath string) (*models.FileRecords, error)
- type Service
Constants ¶
This section is empty.
Variables ¶
View Source
var ProviderSet = wire.NewSet(NewVolumeService)
Functions ¶
This section is empty.
Types ¶
type DefaultService ¶
type DefaultService struct {
Repository repositories.Repository
Storage storages.Storage
// contains filtered or unexported fields
}
func (DefaultService) CreateDirectory ¶
func (d DefaultService) CreateDirectory(baseVolumeName, dirname string) (*models.Volume, error)
func (DefaultService) CreateFile ¶
func (DefaultService) CreateVolume ¶
func (d DefaultService) CreateVolume(accountID uint64) (*models.Volume, error)
func (DefaultService) DownloadDirectory ¶
func (d DefaultService) DownloadDirectory(volumeName, dirname string) (file *os.File, err error)
func (DefaultService) GetDirectory ¶
func (d DefaultService) GetDirectory(volumeName, dirname string) (directories, files []string, err error)
func (DefaultService) GetFile ¶
func (d DefaultService) GetFile(volumeName, dirname, filename string) ([]byte, error)
func (DefaultService) GetVolume ¶
func (d DefaultService) GetVolume(volumeName string) (*models.Volume, error)
func (DefaultService) GetVolumeChain ¶
func (DefaultService) GetVolumeFileRecords ¶
func (d DefaultService) GetVolumeFileRecords(volume *models.Volume, filePath string) (*models.FileRecords, error)
type Service ¶
type Service interface {
CreateVolume(createdBy uint64) (*models.Volume, error)
CreateFile(baseVolumeName, filename string, file []byte) (*models.Volume, error)
CreateDirectory(volumeName, dirname string) (*models.Volume, error)
GetVolume(volumeName string) (*models.Volume, error)
DownloadDirectory(volumeName, dirname string) (file *os.File, err error)
GetDirectory(volumeName, dirname string) (directories, files []string, err error)
GetFile(volumeName, dirname, filename string) ([]byte, error)
GetVolumeFileRecords(volume *models.Volume, filePath string) (*models.FileRecords, 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
Click to show internal directories.
Click to hide internal directories.