component

package
v0.0.0-...-040724e Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2019 License: BSD-3-Clause, GPL-2.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UpdateParamTypes

func UpdateParamTypes(desc *Component) error

UpdateParamTypes updates types in description of a component based return values of the constructor.

Types

type Component

type Component struct {
	Name        string
	Stage       api.ElementStage
	Constructor func() interface{}
	Description Description
}

Component is an antha component / element.

func (*Component) NewParams

func (a *Component) NewParams() (map[string]interface{}, error)

NewParams returns new objects instances for each input and output parameter.

If a component has parameters:

Parameters (
  String string
  Number int
)
Data(...)
Inputs(...)
Outputs(...)

The result of NewParams will be:

map[string]interface{} {
  "String": new(string),
  "Number": new(int),
  ...
}

type Description

type Description struct {
	Desc   string
	Path   string
	Params []ParamDesc
}

Description is a description of a component.

type ParamDesc

type ParamDesc struct {
	Name string // Name of parameter
	Desc string // Description of parameter from doc string
	Kind string // Input, Output, Data or Parameter
	Type string // Full go type name
}

ParamDesc is a description of the parameters of a component.

Jump to

Keyboard shortcuts

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