runner

package
v0.0.0-...-9c77b49 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2018 License: MPL-2.0 Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Args

type Args struct {
	ID          string
	ProcessArgs []string
}

Args represents the required options for services.

type Option

type Option func(*Options)

Option is the functional option func.

func WithContainerImage

func WithContainerImage(o string) Option

WithContainerImage sets the image ref.

func WithContainerOpts

func WithContainerOpts(o ...containerd.NewContainerOpts) Option

WithContainerOpts sets the containerd container options.

func WithEnv

func WithEnv(o []string) Option

WithEnv sets the environment variables of a service.

func WithOCISpecOpts

func WithOCISpecOpts(o ...oci.SpecOpts) Option

WithOCISpecOpts sets the OCI spec options.

func WithType

func WithType(o Type) Option

WithType sets the type of a service.

type Options

type Options struct {
	// Env describes the service's environment variables. Elements should be in
	// the format <key=<value>
	Env []string
	// ContainerOpts describes the container options.
	ContainerOpts []containerd.NewContainerOpts
	// OCISpecOpts describes the OCI spec options.
	OCISpecOpts []oci.SpecOpts
	// ContainerImage is the container's image.
	ContainerImage string
	// Type describes the service's restart policy.
	Type Type
}

Options is the functional options struct.

func DefaultOptions

func DefaultOptions() *Options

DefaultOptions describes the default options to a runner.

type Runner

type Runner interface {
	Run(*userdata.UserData, *Args, ...Option)
}

Runner describes the requirements for running a process.

type Type

type Type int

Type represents the service's restart policy.

const (
	// Forever will always restart a process.
	Forever Type = iota
	// Once will restart the process only if it did not exit successfully.
	Once
)

Directories

Path Synopsis
log

Jump to

Keyboard shortcuts

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