vetu

package
v0.116.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrVetuNotFound = errors.New("vetu command not found")
	ErrVetuFailed   = errors.New("vetu command returned non-zero exit code")
)
View Source
var (
	ErrFailed     = errors.New("vetu isolation failed")
	ErrSyncFailed = errors.New("failed to sync project directory")
)

Functions

func Cleanup

func Cleanup() error

func Cmd

func Cmd(
	ctx context.Context,
	additionalEnvironment map[string]string,
	name string,
	args ...string,
) (string, string, error)

func CmdWithLogger

func CmdWithLogger(
	ctx context.Context,
	additionalEnvironment map[string]string,
	logger *echelon.Logger,
	name string,
	args ...string,
) (string, string, error)

func Installed

func Installed() bool

Types

type Option

type Option func(*Vetu)

func WithBridgedInterface

func WithBridgedInterface(bridgedInterface string) Option

func WithDiskSize added in v0.108.3

func WithDiskSize(diskSize uint32) Option

func WithHostNetworking added in v0.108.2

func WithHostNetworking() Option

func WithLogger

func WithLogger(logger logger.Lightweight) Option

type VM

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

func NewVMClonedFrom

func NewVMClonedFrom(
	ctx context.Context,
	from string,
	to string,
	lazyPull bool,
	env map[string]string,
	logger *echelon.Logger,
) (*VM, error)

func (*VM) Close

func (vm *VM) Close() error

func (*VM) Configure added in v0.108.5

func (vm *VM) Configure(
	ctx context.Context,
	cpu uint32,
	memory uint32,
	diskSize uint32,
	logger *echelon.Logger,
) error

func (*VM) ErrChan

func (vm *VM) ErrChan() chan error

func (*VM) Ident

func (vm *VM) Ident() string

func (*VM) RetrieveIP

func (vm *VM) RetrieveIP(ctx context.Context) (string, error)

func (*VM) Start

func (vm *VM) Start(
	ctx context.Context,
	bridgedInterface string,
	hostNetworking bool,
)

type Vetu

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

func New

func New(
	vmName string,
	sshUser string,
	sshPassword string,
	sshPort uint16,
	cpu uint32,
	memory uint32,
	opts ...Option,
) (*Vetu, error)

func (*Vetu) Attributes added in v0.114.2

func (vetu *Vetu) Attributes() []attribute.KeyValue

func (*Vetu) Close

func (vetu *Vetu) Close(ctx context.Context) error

func (*Vetu) Image added in v0.110.0

func (vetu *Vetu) Image() string

func (*Vetu) Run

func (vetu *Vetu) Run(ctx context.Context, config *runconfig.RunConfig) error

func (*Vetu) Warmup added in v0.116.0

func (vetu *Vetu) Warmup(
	ctx context.Context,
	ident string,
	env map[string]string,
	logger *echelon.Logger,
) error

func (*Vetu) WorkingDirectory

func (vetu *Vetu) WorkingDirectory(projectDir string, dirtyMode bool) string

Jump to

Keyboard shortcuts

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