streamer

package
v0.9.238 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2025 License: AGPL-3.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OPTIMAL_SOFT_LIMIT = 0
	OPTIMAL_HARD_LIMIT = 0
	OPTIMAL_MAX_SIZE   = 4 * utils.MEBIBYTE
)
View Source
const (
	CAPTURE_SOCK        = "streamer-capture.sock"
	SERVE_SOCK          = "streamer-serve.sock"
	INIT_PROGRESS_MSG   = "socket-init"
	STOP_LISTENER_MSG   = "stop-listener"
	IMG_FILE_PATTERN    = "img-*"
	IMG_FILE_FORMATTER  = "img-%d"
	CONNECTION_TIMEOUT  = 30 * time.Second
	DEFAULT_PARALLELISM = 4
	PIPE_SIZE           = 4 * utils.MEBIBYTE
)

Variables

This section is empty.

Functions

func CheckCriu

func CheckCriu(manager plugins.Manager) types.Check

func CheckKernelSettings

func CheckKernelSettings() types.Check

func CheckVersion

func CheckVersion(manager plugins.Manager) types.Check

func Checks

func Checks(m plugins.Manager) types.Checks

func PrepareDumpDir

func PrepareDumpDir(next types.Dump) types.Dump

This adapter sets up the cedana-image-streamer for directly streaming files to the dump directory.

func PrepareDumpDirForRestore

func PrepareDumpDirForRestore(next types.Restore) types.Restore

Types

type File

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

Implementation of the afero.File interface that uses streaming as the backend

func (*File) Close

func (f *File) Close() (err error)

func (*File) Name

func (f *File) Name() string

func (*File) Read

func (f *File) Read(p []byte) (n int, err error)

func (*File) ReadAt

func (f *File) ReadAt(p []byte, off int64) (n int, err error)

func (*File) Readdir

func (f *File) Readdir(count int) ([]os.FileInfo, error)

func (*File) Readdirnames

func (f *File) Readdirnames(n int) ([]string, error)

func (*File) Seek

func (f *File) Seek(offset int64, whence int) (int64, error)

func (*File) Stat

func (f *File) Stat() (os.FileInfo, error)

func (*File) Sync

func (f *File) Sync() error

func (*File) Truncate

func (f *File) Truncate(size int64) error

func (*File) Write

func (f *File) Write(p []byte) (n int, err error)

func (*File) WriteAt

func (f *File) WriteAt(p []byte, off int64) (n int, err error)

func (*File) WriteString

func (f *File) WriteString(s string) (ret int, err error)

type Fs

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

Implementation of the afero.Fs filesystem interface that uses streaming as the backend using the streamer plugin.

func NewStreamingFs

func NewStreamingFs(
	ctx context.Context,
	wg *sync.WaitGroup,
	streamerBinary string,
	dir string,
	parallelism int32,
	mode Mode,
	compressions ...string,
) (fs *Fs, wait func() error, err error)

For READ_ONLY mode, compression is automatically determined. For WRITE_ONLY mode, compression may be specified. Returns a wait function that *must* be called to tell the streamer to shutdown, and wait for it to finish streaming and exit gracefully. The wait function returns any IO errors that occurred during the streaming process.

func (*Fs) Chmod

func (fs *Fs) Chmod(name string, mode os.FileMode) error

func (*Fs) Chown

func (fs *Fs) Chown(name string, uid, gid int) error

func (*Fs) Chtimes

func (fs *Fs) Chtimes(name string, atime, mtime time.Time) error

func (*Fs) Create

func (fs *Fs) Create(name string) (afero.File, error)

func (*Fs) Mkdir

func (fs *Fs) Mkdir(name string, perm os.FileMode) error

func (*Fs) MkdirAll

func (fs *Fs) MkdirAll(path string, perm os.FileMode) error

func (*Fs) Name

func (fs *Fs) Name() string

func (*Fs) Open

func (fs *Fs) Open(name string) (afero.File, error)

func (*Fs) OpenFile

func (fs *Fs) OpenFile(name string, flag int, perm os.FileMode) (afero.File, error)

func (*Fs) Remove

func (fs *Fs) Remove(name string) error

func (*Fs) RemoveAll

func (fs *Fs) RemoveAll(path string) error

func (*Fs) Rename

func (fs *Fs) Rename(oldname, newname string) error

func (*Fs) Stat

func (fs *Fs) Stat(name string) (os.FileInfo, error)

type Mode

type Mode int
const (
	READ_ONLY Mode = iota
	WRITE_ONLY
)

Image streamer can only be in one of these modes, never both

Jump to

Keyboard shortcuts

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