inventory

package
v0.0.0-...-a011eca Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2022 License: BSD-3-Clause, GPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// WaterType is the component type of water
	WaterType = "water"
)

Variables

View Source
var (
	// ErrUnknownType is returned if type is not in inventory
	ErrUnknownType = errors.New("unknown type requested from inventory")
)

Functions

func NewComponent

func NewComponent(ctx context.Context, typ string) (*wtype.Liquid, error)

NewComponent returns a new component of the given type

func NewContext

func NewContext(ctx context.Context, inv Inventory) context.Context

NewContext returns a context with the given inventory

func NewPlate

func NewPlate(ctx context.Context, typ string) (*wtype.Plate, error)

NewPlate returns a new plate of the given type

func NewTipbox

func NewTipbox(ctx context.Context, typ string) (*wtype.LHTipbox, error)

NewTipbox returns a new tipbox of the given type

func NewTipwaste

func NewTipwaste(ctx context.Context, typ string) (*wtype.LHTipwaste, error)

NewTipwaste returns a new tipwaste of the given type

func XXXNewPlates

func XXXNewPlates(ctx context.Context) ([]*wtype.Plate, error)

XXXNewPlates is a transitional call that will be removed once the planner requires input plate types to be explicitly set.

Types

type Inventory

type Inventory interface {
	NewComponent(ctx context.Context, typ string) (*wtype.Liquid, error)
	NewPlate(ctx context.Context, typ string) (*wtype.Plate, error)
	NewTipwaste(ctx context.Context, typ string) (*wtype.LHTipwaste, error)
	NewTipbox(ctx context.Context, typ string) (*wtype.LHTipbox, error)
}

An Inventory returns items by name

func GetInventory

func GetInventory(ctx context.Context) Inventory

GetInventory returns an Inventory instance from Context

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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