runtime

package
v0.0.0-...-0ea8511 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Valid is the list of valid runtimes.

Functions

func Register

func Register(rt Runtime, f Creator)

Register registers a runtime.

func StringList

func StringList() string

StringList returns the list of valid runtimes.

Types

type Creator

type Creator func() (Runner, error)

Creator is a function that creates a Runner.

type Runner

type Runner interface {
	// Run runs a container with the given working directory and entrypoint,
	// returning the container ID.
	Run(ctx context.Context, workingDir, cmd string) (string, error)
}

Runner is the interface implemented by container runtimes.

func New

func New(rt Runtime) (Runner, error)

New returns an instantiated runtime.

type Runtime

type Runtime string

Runtime represents a type of container runtime.

const (
	// Docker is the runtime powered by Docker.
	Docker Runtime = "docker"

	// ContainerD is the runtime powered by ContainerD.
	ContainerD Runtime = "containerd"
)

func (*Runtime) Set

func (r *Runtime) Set(s string) error

Set implements flag.Value

func (*Runtime) String

func (r *Runtime) String() string

String implements flag.Value

Directories

Path Synopsis
Package all imports all runtimes
Package all imports all runtimes

Jump to

Keyboard shortcuts

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