mgr

package
v0.1.0-M4 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// ManagerServiceLocalID local ID for the manager service.
	ManagerServiceLocalID = "container-management.service.local.v1.service-manager"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerManager

type ContainerManager interface {

	// Load loads the containers from the persistent memory cache
	Load(ctx context.Context) error

	// Restore recovers containers that are active in the underlying container management system
	Restore(ctx context.Context) error

	// Create creates a new container
	Create(ctx context.Context, config *types.Container) (*types.Container, error)

	// Get the detailed information about a container
	Get(ctx context.Context, id string) (*types.Container, error)

	// List returns the list of available containers
	List(ctx context.Context) ([]*types.Container, error)

	// Start starts a container that has been stopped or created
	Start(ctx context.Context, id string) error

	// Attach attaches the container's IO
	Attach(ctx context.Context, id string, attachConfig *streams.AttachConfig) error

	// Stop stops a running container
	Stop(ctx context.Context, id string, stopOpts *types.StopOpts) error

	// Update updates a running container
	Update(ctx context.Context, id string, updateOpts *types.UpdateOpts) error

	// Restart restarts a running container
	Restart(ctx context.Context, id string, timeout int64) error

	// Pause pauses a running container
	Pause(ctx context.Context, id string) error

	// Unpause resumes a paused container
	Unpause(ctx context.Context, id string) error

	// Rename renames a container
	Rename(ctx context.Context, id string, name string) error

	// Remove removes a container, it may be running or stopped and so on
	Remove(ctx context.Context, id string, force bool) error

	// Metrics retrieves metrics data about a container
	Metrics(ctx context.Context, id string) (*types.Metrics, error)

	// Dispose stops and disposes the network manager
	Dispose(ctx context.Context) error
}

ContainerManager represents the container manager abstraction

type ContainerManagerOpt

type ContainerManagerOpt func(mgrOptions *mgrOpts) error

ContainerManagerOpt provides container manager options

func WithMgrContainerClientServiceID

func WithMgrContainerClientServiceID(containerClientServiceID string) ContainerManagerOpt

WithMgrContainerClientServiceID sets container manager client service ID.

func WithMgrDefaultContainerStopTimeout

func WithMgrDefaultContainerStopTimeout(networkManagerCtrsStopTimeout int64) ContainerManagerOpt

WithMgrDefaultContainerStopTimeout sets default container stop timeout.

func WithMgrMetaPath

func WithMgrMetaPath(metaPath string) ContainerManagerOpt

WithMgrMetaPath sets container manager meta path.

func WithMgrNetworkManagerServiceID

func WithMgrNetworkManagerServiceID(networkManagerServiceID string) ContainerManagerOpt

WithMgrNetworkManagerServiceID sets container manager network service ID.

func WithMgrRootExec

func WithMgrRootExec(rootExec string) ContainerManagerOpt

WithMgrRootExec sets container manager root exec.

Jump to

Keyboard shortcuts

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