dummy

package
v0.0.0-...-acd7349 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2013 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Overview

The dummy provider implements an environment provider for testing purposes, registered with environs under the name "dummy".

The configuration YAML for the testing environment must specify a "state-server" property with a boolean value. If this is true, a state server will be started the first time StateInfo is called on a newly reset environment.

The configuration data also accepts a "broken" property of type boolean. If this is non-empty, any operation after the environment has been opened will return the error "broken environment", and will also log that.

The DNS name of instances is the same as the Id, with ".dns" appended.

To avoid enumerating all possible series and architectures, any series or architecture with the prefix "unknown" is treated as bad when starting a new instance.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Listen

func Listen(c chan<- Operation)

Listen closes the previously registered listener (if any). Subsequent operations on any dummy environment can be received on c (if not nil).

func Poison

func Poison(ss environs.Storage, path string, err error)

Poison causes all fetches of the given path to return the given error.

func Reset

func Reset()

Reset resets the entire dummy environment and forgets any registered operation listener. All opened environments after Reset will share the same underlying state.

func ResetPublicStorage

func ResetPublicStorage(e environs.Environ)

ResetPublicStorage clears the contents of the specified environment's public storage.

func SetStorageDelay

func SetStorageDelay(d time.Duration)

SetStorageDelay causes any storage download operation in any current environment to be delayed for the given duration.

Types

type GenericOperation

type GenericOperation struct {
	Env string
}

type OpBootstrap

type OpBootstrap struct {
	Env         string
	Constraints constraints.Value
}

type OpClosePorts

type OpClosePorts struct {
	Env        string
	MachineId  string
	InstanceId instance.Id
	Ports      []instance.Port
}

type OpDestroy

type OpDestroy GenericOperation

type OpOpenPorts

type OpOpenPorts struct {
	Env        string
	MachineId  string
	InstanceId instance.Id
	Ports      []instance.Port
}

type OpPutFile

type OpPutFile struct {
	Env      string
	FileName string
}

type OpStartInstance

type OpStartInstance struct {
	Env          string
	MachineId    string
	MachineNonce string
	Instance     instance.Instance
	Constraints  constraints.Value
	Info         *state.Info
	APIInfo      *api.Info
	Secret       string
}

type OpStopInstances

type OpStopInstances struct {
	Env       string
	Instances []instance.Instance
}

type Operation

type Operation interface{}

Operation represents an action on the dummy provider.

Jump to

Keyboard shortcuts

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