runners

package
v0.1.53 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckForRuntimes added in v0.1.6

func CheckForRuntimes(ctx context.Context, requirements []*agentv0.Runtime) error

func DockerEngineRunning added in v0.1.35

func DockerEngineRunning(ctx context.Context) bool

func IsFreePort added in v0.1.24

func IsFreePort(port int) bool

func WaitForPortUnbound added in v0.1.23

func WaitForPortUnbound(ctx context.Context, port int) error

WaitForPortUnbound waits for the portMapping to be unbound

Types

type CPU added in v0.0.71

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

type Docker added in v0.0.87

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

func NewDocker added in v0.0.87

func NewDocker(ctx context.Context) (*Docker, error)

NewDocker creates a new docker runner

func (*Docker) ForwardLogs added in v0.1.24

func (docker *Docker) ForwardLogs(reader io.Reader)

func (*Docker) GetImage added in v0.0.87

func (docker *Docker) GetImage(ctx context.Context, image *configurations.DockerImage) error

func (*Docker) ImageExists added in v0.0.87

func (docker *Docker) ImageExists(ctx context.Context, image *configurations.DockerImage) (bool, error)

func (*Docker) Init added in v0.0.87

func (docker *Docker) Init(ctx context.Context, image *configurations.DockerImage) error

func (*Docker) Running added in v0.1.35

func (docker *Docker) Running() bool

func (*Docker) SetCommand added in v0.1.24

func (docker *Docker) SetCommand(bin string, args ...string)

SetCommand to run

func (*Docker) Silence added in v0.1.9

func (docker *Docker) Silence()

func (*Docker) Start added in v0.0.87

func (docker *Docker) Start(ctx context.Context) error

func (*Docker) Stop added in v0.0.91

func (docker *Docker) Stop() error

func (*Docker) WithCommand added in v0.1.6

func (docker *Docker) WithCommand(cmd ...string)

func (*Docker) WithEnvironmentVariables added in v0.1.6

func (docker *Docker) WithEnvironmentVariables(envs ...string)

func (*Docker) WithMount added in v0.1.24

func (docker *Docker) WithMount(sourceDir string, targetDir string) *Docker

func (*Docker) WithName added in v0.1.24

func (docker *Docker) WithName(name string)

func (*Docker) WithOut added in v0.1.24

func (docker *Docker) WithOut(writer io.Writer)

func (*Docker) WithPort added in v0.1.6

func (docker *Docker) WithPort(port DockerPortMapping)

func (*Docker) WithWorkDir added in v0.1.25

func (docker *Docker) WithWorkDir(dir string)

type DockerContainerInstance added in v0.0.87

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

type DockerPortMapping added in v0.1.24

type DockerPortMapping struct {
	Host      int
	Container int
}

type Event added in v0.0.71

type Event struct {
	// Err is the state of error of the service
	Err error

	// Status is the state of the service
	ProcessState

	// CPU
	*observabilityv0.CPU

	// Memory
	*observabilityv0.Memory
}

Event represents data of a **running** service Generic so most fields will be nil

type Memory added in v0.0.71

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

type MultiReader added in v0.1.22

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

func NewMultiReader added in v0.1.22

func NewMultiReader(readers ...io.Reader) *MultiReader

func (*MultiReader) Read added in v0.1.22

func (mrc *MultiReader) Read(p []byte) (n int, err error)

type ProcessState added in v0.0.71

type ProcessState int
const (
	Unknown  ProcessState = iota
	NotFound ProcessState = iota
	Running
	InterruptibleSleep
	UninterruptibleSleep
	Stopped
	Zombie
	Dead
	TracingStop
	Idle
	Parked
	Waking
)

func (ProcessState) String added in v0.0.71

func (ps ProcessState) String() string

type Runner

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

func NewRunner added in v0.1.22

func NewRunner(ctx context.Context, bin string, args ...string) (*Runner, error)

func (*Runner) Finish added in v0.1.22

func (runner *Runner) Finish()

func (*Runner) Finished added in v0.1.22

func (runner *Runner) Finished() bool

func (*Runner) ForwardLogs added in v0.1.22

func (runner *Runner) ForwardLogs(reader io.Reader)

func (*Runner) Run

func (runner *Runner) Run() error

Run execute and wait: great for tasks that we expect to finish

func (*Runner) Start added in v0.0.85

func (runner *Runner) Start(args ...string) error

Start executing and return

func (*Runner) Stop added in v0.1.21

func (runner *Runner) Stop() error

func (*Runner) Wait

func (runner *Runner) Wait() error

func (*Runner) WithDebug added in v0.1.22

func (runner *Runner) WithDebug(debug bool) *Runner

func (*Runner) WithDir added in v0.1.22

func (runner *Runner) WithDir(dir string) *Runner

func (*Runner) WithEnvs added in v0.1.22

func (runner *Runner) WithEnvs(envs ...string) *Runner

func (*Runner) WithOut added in v0.1.22

func (runner *Runner) WithOut(out io.Writer)

type Tracked added in v0.0.71

type Tracked interface {
	GetState(ctx context.Context) (ProcessState, error)
	GetCPU(ctx context.Context) (*CPU, error)
	GetMemory(ctx context.Context) (*Memory, error)
}

type TrackedProcess added in v0.0.71

type TrackedProcess struct {
	PID    int
	Killed bool
}

func (*TrackedProcess) GetCPU added in v0.0.71

func (p *TrackedProcess) GetCPU(ctx context.Context) (*CPU, error)

func (*TrackedProcess) GetMemory added in v0.0.71

func (p *TrackedProcess) GetMemory(ctx context.Context) (*Memory, error)

func (*TrackedProcess) GetState added in v0.0.71

func (p *TrackedProcess) GetState(ctx context.Context) (ProcessState, error)

Jump to

Keyboard shortcuts

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