mock

package
v0.0.0-...-2f78cd6 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action int
const (
	// A container has been started.
	Started Action = iota
	// A container has been stopped.
	Stopped
)

func (Action) String

func (action Action) String() string

type ContainerFactory

type ContainerFactory interface {
	kvm.ContainerFactory

	AddListener(chan<- Event)
	RemoveListener(chan<- Event)
	HasListener(chan<- Event) bool
}

func MockFactory

func MockFactory() ContainerFactory

type Event

type Event struct {
	Action     Action
	InstanceId string
}

type MockContainer

type MockContainer struct {
	StartParams kvm.StartParams
	// contains filtered or unexported fields
}

func (*MockContainer) EnsureCachedImage

func (mock *MockContainer) EnsureCachedImage(params kvm.StartParams) error

EnsureCachedImage is the first supply of start-params to the container. We set it here for subsequent test assertions. Start is called by the manager immediately after, with the same argument.

func (*MockContainer) IsRunning

func (mock *MockContainer) IsRunning() bool

func (*MockContainer) Name

func (mock *MockContainer) Name() string

Name returns the name of the container.

func (*MockContainer) Start

func (mock *MockContainer) Start(params kvm.StartParams) error

func (*MockContainer) Stop

func (mock *MockContainer) Stop() error

Stop terminates the running container.

func (*MockContainer) String

func (mock *MockContainer) String() string

String returns information about the container.

Jump to

Keyboard shortcuts

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