testing

package
v4.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: LGPL-3.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Getter

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

Getter implements dependency.Getter for convenient testing of dependency.StartFuncs.

func StubGetter

func StubGetter(raw map[string]interface{}) *Getter

StubGetter returns a Getter.

func (*Getter) Get

func (g *Getter) Get(name string, outPtr interface{}) error

Get is part of the dependency.Getter interface.

type StubResource

type StubResource struct {
	Outputs []interface{}
	Error   error
}

StubResource is used to define the behaviour of a StubGetResource func for a particular resource name.

func NewStubResource

func NewStubResource(outputs ...interface{}) StubResource

NewStubResource creates a single StubResource with the given outputs. (If you need to specify an error result, use the StubResource type directly.)

type StubResources

type StubResources map[string]StubResource

StubResources defines the complete behaviour of a StubGetResource func.

func NewStubResources

func NewStubResources(raw map[string]interface{}) StubResources

NewStubResources converts raw into a StubResources by assuming that any non-error value is intended to be an output. Multiple outputs can set by specifying a slice of interface{}s.

func (StubResources) Getter

func (resources StubResources) Getter() dependency.Getter

Getter returns a dependency.Getter that never aborts, backed by resources.

Jump to

Keyboard shortcuts

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