storage

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DirAccessFailed string = "can't access container directory"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerHandle

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

func (*ContainerHandle) BundleDir

func (h *ContainerHandle) BundleDir() string

func (*ContainerHandle) ContainerDir

func (h *ContainerHandle) ContainerDir() string

func (*ContainerHandle) ContainerID

func (h *ContainerHandle) ContainerID() container.ID

func (*ContainerHandle) RootfsDir

func (h *ContainerHandle) RootfsDir() string

func (*ContainerHandle) RuntimeSpecFile

func (h *ContainerHandle) RuntimeSpecFile() string

type ContainerStore

type ContainerStore interface {
	RootDir() string

	// CreateContainer creates container's dir in a non-volatile location
	// (it also may store some container's metadata inside).
	CreateContainer(
		container.ID,
		*rollback.Rollback,
	) (*ContainerHandle, error)

	CreateContainerBundle(
		id container.ID,
		spec oci.RuntimeSpec,
		rootfs string,
	) error

	GetContainer(container.ID) (*ContainerHandle, error)

	// Removes <container_dir>.
	DeleteContainer(container.ID) error

	FindContainers() ([]*ContainerHandle, error)

	ContainerStateRead(container.ID) (state []byte, err error)

	// Updates container's state on disk (atomically, using os.Rename).
	// Container state is stored in <container_dir>/state.json.
	ContainerStateWriteAtomic(id container.ID, state []byte) error

	// Unlinks <container_dir>/state.json file effectively marking
	// the container as ready to be cleaned up.
	ContainerStateDeleteAtomic(container.ID) error
}

func NewContainerStore

func NewContainerStore(rootdir string) ContainerStore

Jump to

Keyboard shortcuts

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