runtime

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2025 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDocker

func NewDocker(client *dockerclient.Client, opts ...dockerOption) *docker

func WithContext

func WithContext(ctx context.Context) func(*docker)

func WithHidePullOutput added in v0.0.16

func WithHidePullOutput(hide bool) func(*docker)

func WithLogger

func WithLogger(logger logr.Logger) func(*docker)

func WithVolumes added in v0.0.16

func WithVolumes(volumes []string) func(*docker)

Types

type Await

type Await interface {
	Wait() error
}

type ContainerSpec

type ContainerSpec struct {
	Name            string
	Args            []string
	Command         []string
	Image           string
	ImagePullPolicy PullImagePolicy
	Stdin           bool
	TTY             bool
	Env             []string
	User            string
	PWD             string
	RestartPolicy   RestartPolicy
}

func GetContainerSpecByName

func GetContainerSpecByName(pod *Pod, name string) (ContainerSpec, error)

type ContainerStatus

type ContainerStatus struct {
	ContainerID string
	ContainerIP string
	Name        string
	Ready       bool
	Started     bool
	ExitCode    int
}

func GetContainerStatusByID

func GetContainerStatusByID(pod *Pod, id string) (ContainerStatus, error)

func GetContainerStatusByName

func GetContainerStatusByName(pod *Pod, name string) (ContainerStatus, error)

type Event

type Event struct {
	Container string
	ExitCode  int
	Type      EventType
	Error     error
}

type EventType

type EventType string
var (
	EventTypeError   EventType = "error"
	EventTypeStart   EventType = "start"
	EventTypeRestart EventType = "restart"
	EventTypeExit    EventType = "exit"
	EventTypeDelete  EventType = "delete"
)

type Interface

type Interface interface {
	//Watch(ctx context.Context, pod *Pod) chan Event
	CreatePod(ctx context.Context, pod *Pod, stdin io.Reader, stdout, stderr io.Writer) (Await, error)
	DeletePod(ctx context.Context, pod *Pod) error
}

type Pod

type Pod struct {
	Name   string
	Spec   PodSpec
	Status PodStatus
}

type PodSpec

type PodSpec struct {
	Containers     []ContainerSpec
	InitContainers []ContainerSpec
	Volumes        []Volume
}

type PodStatus

type PodStatus struct {
	PodIP          string
	Containers     []ContainerStatus
	InitContainers []ContainerStatus
}

type PullImagePolicy

type PullImagePolicy string
var (
	PullImagePolicyAlways  PullImagePolicy = "Always"
	PullImagePolicyNever   PullImagePolicy = "Never"
	PullImagePolicyMissing PullImagePolicy = "Missing"
)

type RestartPolicy

type RestartPolicy string
var (
	RestartPolicyNever     RestartPolicy = "Never"
	RestartPolicyOnFailure RestartPolicy = "OnFailure"
	RestartPolicyAlways    RestartPolicy = "Always"
)

type Result

type Result struct {
	ExitCode int
}

func (*Result) Error

func (e *Result) Error() string

type Volume

type Volume struct {
	Path     string
	HostPath string
}

Jump to

Keyboard shortcuts

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