filecontainer

package
v0.0.5-dev.2 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LockTypeFileOnly LockType = 0
	LockTypeAll      LockType = 1

	UploadTypeTar UploadType = 0

	LocalTarName = "artifact.tar.gz"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FileManager

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

func CreateFileManager

func CreateFileManager(storage storageabstraction.IFileStorage, logger log.Logger) *FileManager

func (FileManager) BackupDirectory

func (fileManager FileManager) BackupDirectory(path string, writer io.Writer) error

func (FileManager) GetFile

func (fileManager FileManager) GetFile(path string) (io.ReadCloser, error)

GetFile returns an error or a stream of data which represent the requested file

func (FileManager) GetUploadWriter

func (fileManager FileManager) GetUploadWriter(path string, callbacks UploadCallBacks) (TarUploader, error)

func (FileManager) UploadTar

func (fileManager FileManager) UploadTar(path string, callbacks UploadCallBacks, reader io.Reader) error

type IFileManager

type IFileManager interface {
	GetFile(path string) (io.ReadCloser, error)
	GetUploadWriter(path string, callbacks UploadCallBacks) (TarUploader, error)
	BackupDirectory(path string, writer io.Writer) error
	UploadTar(path string, callbacks UploadCallBacks, reader io.Reader) error
}

type LockType

type LockType int

type TarUploader

type TarUploader interface {
	io.Writer
	Done()
	Error()
}

type UploadCallBacks

type UploadCallBacks struct {
	OnExtractionFinished func(err error)
	OnReadyToExtract     func() error
}

type UploadLockObject

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

type UploadObject

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

type UploadType

type UploadType int

type Uploader

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

func CreateUploader

func CreateUploader(rootDir string, logger log.Logger, fileStorage storageabstraction.IFileStorage) *Uploader

func (*Uploader) UploadTar

func (uploader *Uploader) UploadTar(rootPath string, callbacks UploadCallBacks) (TarUploader, error)

Jump to

Keyboard shortcuts

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