fake_container_pool

package
v0.0.0-...-68efac8 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2014 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeContainer

type FakeContainer struct {
	*fakes.FakeContainer

	Spec api.ContainerSpec

	SnapshotError  error
	SavedSnapshots []io.Writer

	StartError error
	Started    bool
	Mtu        uint32

	CleanedUp bool
	// contains filtered or unexported fields
}

func NewFakeContainer

func NewFakeContainer(spec api.ContainerSpec) *FakeContainer

func (*FakeContainer) Cleanup

func (c *FakeContainer) Cleanup()

func (*FakeContainer) GraceTime

func (c *FakeContainer) GraceTime() time.Duration

func (*FakeContainer) Handle

func (c *FakeContainer) Handle() string

func (*FakeContainer) ID

func (c *FakeContainer) ID() string

func (*FakeContainer) Properties

func (c *FakeContainer) Properties() api.Properties

func (*FakeContainer) Snapshot

func (c *FakeContainer) Snapshot(snapshot io.Writer) error

func (*FakeContainer) Start

func (c *FakeContainer) Start(mtu uint32) error

type FakeContainerPool

type FakeContainerPool struct {
	DidSetup bool

	MaxContainersValue int

	Pruned         bool
	PruneError     error
	KeptContainers map[string]bool

	CreateError  error
	RestoreError error
	DestroyError error

	ContainerSetup func(*FakeContainer)

	CreatedContainers   []linux_backend.Container
	DestroyedContainers []linux_backend.Container
	RestoredSnapshots   []io.Reader
}

func New

func New() *FakeContainerPool

func (*FakeContainerPool) Create

func (*FakeContainerPool) Destroy

func (p *FakeContainerPool) Destroy(container linux_backend.Container) error

func (*FakeContainerPool) MaxContainers

func (p *FakeContainerPool) MaxContainers() int

func (*FakeContainerPool) Prune

func (p *FakeContainerPool) Prune(keep map[string]bool) error

func (*FakeContainerPool) Restore

func (p *FakeContainerPool) Restore(snapshot io.Reader) (linux_backend.Container, error)

func (*FakeContainerPool) Setup

func (p *FakeContainerPool) Setup() error

Jump to

Keyboard shortcuts

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