mycomponent

package
v0.0.0-...-1a56975 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DoStuffElegantly bool
}

Config allows you to pass test/suite specific configuration during initialization.

type Instance

type Instance interface {
	// DoStuff that matters, or returns an error if it fails.
	DoStuff() error
}

Instance is an example component. Consider implementing your component as an interface, so that others can add environment specific implementations.

func New

func New(ctx resource.Context, cfg Config) (i Instance, err error)

New is the canonical method the users will look for creating a new instance of component. It should be possible (and easy) to create multiple instance of your component.

func NewOrFail

func NewOrFail(t *testing.T, ctx resource.Context, cfg Config) Instance

NewOrFail is a very useful convenience for allocating components within tests.

Jump to

Keyboard shortcuts

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