tau

package module
v0.0.0-...-b5442c7 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2023 License: MIT Imports: 4 Imported by: 0

README

Container

kind = "container"
name = "busybox"
image = "docker.io/library/busybox:1.35.0"
command = "sleep 1m"

Pod

kind = "pod"
name = "busybox"

[[containers]]
name = "busybox"
image = "docker.io/library/busybox:1.35.0"
command = "sleep 20"

[[containers]]
name = "busybox-2"
image = "docker.io/library/busybox:1.35.0"
command = "sleep 10"

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrContainerNotFound = errors.New("container not found")

Functions

This section is empty.

Types

type Container

type Container struct {
	Name    string
	Image   string
	Command string
}

type ContainerRuntime

type ContainerRuntime interface {
	// Start creates and starts a container.
	Start(Container) error
	// Stop stops a running container.
	// Runtime waits for the container to stop gracefully for the given timeout.
	// After the timeout, the container is killed.
	// If the container is not found, ErrContainerNotFound is returned.
	Stop(containerName string, timeout time.Duration) error
	// Remove removes a container.
	// Running containers are killed before removal.
	// If the container is not found, no error is returned.
	Remove(containerName string) error
	// State returns the state of a container.
	// If the container is not found, ErrContainerNotFound is returned.
	State(containerName string) (ContainerState, error)
}

type ContainerState

type ContainerState int
const (
	ContainerStateRunning ContainerState = iota + 1
	ContainerStateSucceeded
	ContainerStateFailed
)

type Descriptor

type Descriptor struct {
	Name string
	Kind Kind
}

type Kind

type Kind string
const (
	KindContainer Kind = "container"
	KindPod       Kind = "pod"
)

type Resource

type Resource interface {
	Create(ContainerRuntime) error
	Remove(ContainerRuntime) error
	UpdateStatus(ContainerRuntime) error

	Descriptor() Descriptor
	State() State
	Status() []StatusEntry

	encoding.BinaryMarshaler
	encoding.BinaryUnmarshaler
}

type State

type State int
const (
	StateCreating State = iota
	StateRunning
	StateSucceeded
	StateFailed
)

func (State) String

func (s State) String() string

type StatusEntry

type StatusEntry struct {
	Title string
	Value string
}

Directories

Path Synopsis
api
cmd
tau
internal
pkg
mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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