sys

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const WorkerImageBuildPrefix = "worker-img-build_"

WorkerImageBuildPrefix is the prefix used for all files that are written as part of the storage volume creation process for the worker image.

Variables

This section is empty.

Functions

func GetExecPath added in v0.2.0

func GetExecPath() string

GetExecPath returns the path to the current binary.

func ReplaceDaemon added in v0.2.0

func ReplaceDaemon() error

ReplaceDaemon replaces the daemon by re-execing the binary.

Types

type OS

type OS struct {

	// Directories
	CacheDir string // Cache directory (e.g., /var/cache/migration-manager/)
	LogDir   string // Log directory (e.g. /var/log/).
	RunDir   string // Runtime directory (e.g. /run/migration-manager/).
	VarDir   string // Data directory (e.g. /var/lib/migration-manager/).
	ShareDir string // Static directory (e.g. /usr/share/migration-manager/).
	UsrDir   string // Static directory (e.g. /usr/lib/migration-manager/).

	ArtifactDir string // Location of user-supplied files (e.g. /var/lib/migration-manager/artifacts/).
	ImageDir    string // Location of the worker images (e.g. /usr/share/migration-manager/images/).
	DatabaseDir string // Location of the database files (e.g. /var/lib/migration-manager/database/).
	ACMEDir     string // Location of ACME account files (e.g. /var/cache/migration-manager/acme/).

	ConfigFile string // System config yaml file (e.g. /var/lib/migration-manager/config.yml).
	// contains filtered or unexported fields
}

OS is a high-level facade for accessing operating-system level functionalities.

func DefaultOS

func DefaultOS() *OS

DefaultOS returns a fresh uninitialized OS instance with default values.

func (*OS) GetUnixSocket

func (s *OS) GetUnixSocket() string

GetUnixSocket returns the full path to the unix.socket file that this daemon is listening on.

func (*OS) Init added in v0.2.0

func (s *OS) Init() error

func (*OS) LoadWorkerImage

func (s *OS) LoadWorkerImage(ctx context.Context, arch string) (string, error)

LoadWorkerImage writes the VMWare vix tarball to the worker image. If the worker image does not exist, it is fetched from the current project version's corresponding GitHub release.

func (*OS) WorkerImageExists

func (s *OS) WorkerImageExists(arch string) (string, error)

WorkerImageExists checks if the worker image and binary exist on the filesystem.

func (*OS) WriteFile added in v0.2.0

func (s *OS) WriteFile(filePath string, reader io.ReadCloser) error

WriteFile reads from the reader and writes to the given file path. While the write is in progress, a {filePath).part file will be present.

Jump to

Keyboard shortcuts

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