dummy

package
v0.0.0-...-f88c608 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 License: AGPL-3.0 Imports: 33 Imported by: 0

Documentation

Overview

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

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.

Index

Constants

View Source
const BootstrapInstanceId = "localhost"

Variables

This section is empty.

Functions

func Listen

func Listen(c chan<- Operation)

Listen directs subsequent operations on any dummy environment to channel c (if not nil).

func SetInstanceAddresses

func SetInstanceAddresses(inst instances.Instance, addrs []network.ProviderAddress)

SetInstanceAddresses sets the addresses associated with the given dummy instance.

func SetInstanceStatus

func SetInstanceStatus(inst instances.Instance, status string)

SetInstanceStatus sets the status associated with the given dummy instance.

func SetSupportsSpaceDiscovery

func SetSupportsSpaceDiscovery(supports bool) bool

SetSupportsSpaceDiscovery allows to enable and disable SupportsSpaceDiscovery for tests.

func SetSupportsSpaces

func SetSupportsSpaces(supports bool) bool

SetSupportsSpaces allows to enable and disable SupportsSpaces for tests.

Types

type OpBootstrap

type OpBootstrap struct {
	Context environs.BootstrapContext
	Env     string
	Args    environs.BootstrapParams
}

type OpDestroy

type OpDestroy struct {
	Env         string
	Cloud       string
	CloudRegion string
	Error       error
}

type OpFinalizeBootstrap

type OpFinalizeBootstrap struct {
	Context        environs.BootstrapContext
	Env            string
	InstanceConfig *instancecfg.InstanceConfig
}

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