containers

package
v0.0.0-...-3511abf Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// RecentExitsCacheSize is the number of cached stops we keep, before forgetting about them.
	RecentExitsCacheSize = 32
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager manages containers. It is able to start and signal them and tracks some updates to their state.

func New

New returns a new container manager.

func (*Manager) Close

func (m *Manager) Close()

Close all managed containers by sending them a SIGKILL and wait for them to close.

func (*Manager) Detach

func (m *Manager) Detach()

Detach from all running containers without affecting them.

func (*Manager) NumContainers

func (m *Manager) NumContainers() int

NumContainers returns the number of containers being managed.

func (*Manager) ReattachContainers

func (m *Manager) ReattachContainers(
	ctx context.Context, expectedSurvivors []aproto.ContainerReattach,
) ([]aproto.ContainerReattachAck, error)

ReattachContainers takes a list of expected survivors and returns the results of the attempted reattach. A result is returned for every expected survivor. An error indicates a total failure.

func (*Manager) RevalidateContainers

func (m *Manager) RevalidateContainers(
	ctx context.Context, expectedSurvivors []aproto.ContainerReattach,
) ([]aproto.ContainerReattachAck, error)

RevalidateContainers rectifies a list of containers the mananger is expected to know about with what the manager does know about, and returns updates about the expected containers.

func (*Manager) SignalContainer

func (m *Manager) SignalContainer(ctx context.Context, msg aproto.SignalContainer)

SignalContainer signals a container.

func (*Manager) StartContainer

func (m *Manager) StartContainer(ctx context.Context, req aproto.StartContainer) error

StartContainer starts a container according to the provided spec, relaying its state changes via events.

Jump to

Keyboard shortcuts

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