api

package
v0.1.16 Latest Latest
Warning

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

Go to latest
Published: May 25, 2019 License: Apache-2.0 Imports: 14 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FILE_ENDINGS = []string{".yaml", ".json"} // Order of endings matters!

Functions

func CreateAndConnectOperator

func CreateAndConnectOperator(insName string, def core.OperatorDef, ordered bool) (*core.Operator, error)

func ParseJSONOperatorDef

func ParseJSONOperatorDef(defStr string) (core.OperatorDef, error)

func ParsePortReference

func ParsePortReference(refStr string, par *core.Operator) (*core.Port, error)

func ParseTypeDef

func ParseTypeDef(defStr string) core.TypeDef

func ParseYAMLOperatorDef

func ParseYAMLOperatorDef(defStr string) (core.OperatorDef, error)

func ParseYAMLPackageDef added in v0.1.14

func ParseYAMLPackageDef(defStr string) (core.PackageDef, error)

func TestOperator

func TestOperator(testDataFilePath string, writer io.Writer, failFast bool) (int, int, error)

TestOperator reads a file with test data and its corresponding operator and performs the tests. It returns the number of failed and succeeded tests and and error in case something went wrong. Test failures do not lead to an error. Test failures are printed to the writer.

Types

type Environ

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

func NewEnviron

func NewEnviron() *Environ

func NewTestEnviron added in v0.1.5

func NewTestEnviron(cwd string) *Environ

func (*Environ) BuildAndCompileOperator

func (e *Environ) BuildAndCompileOperator(opFilePath string, gens map[string]*core.TypeDef, props map[string]interface{}) (*core.Operator, error)

func (*Environ) GetFilePathWithFileEnding

func (e *Environ) GetFilePathWithFileEnding(relFilePath string, enforcedPath string) (string, string, error)

func (*Environ) GetOperatorPath

func (e *Environ) GetOperatorPath(operator string, currDir string) (string, error)

func (*Environ) IsLocalOperator

func (e *Environ) IsLocalOperator(operator string) bool

func (*Environ) ListOperatorNames

func (e *Environ) ListOperatorNames() ([]string, error)

func (*Environ) ReadOperatorDef

func (e *Environ) ReadOperatorDef(opDefFilePath string, pathsRead []string) (core.OperatorDef, error)

ReadOperatorDef reads the operator definition for the given file.

func (*Environ) ReadPackageDef added in v0.1.14

func (e *Environ) ReadPackageDef(pkgDefFilePath string) (core.PackageDef, error)

ReadOperatorDef reads the operator definition for the given file.

func (*Environ) WorkingDir

func (e *Environ) WorkingDir() string

type TestCaseDef

type TestCaseDef struct {
	Name        string                   `json:"name" yaml:"name"`
	Description string                   `json:"description" yaml:"description"`
	Generics    map[string]*core.TypeDef `json:"generics" yaml:"generics"`
	Properties  map[string]interface{}   `json:"properties" yaml:"properties"`
	Data        struct {
		In  []interface{} `json:"in" yaml:"in"`
		Out []interface{} `json:"out" yaml:"out"`
	}
}

type TestDef

type TestDef struct {
	OperatorFile string        `json:"operatorFile" yaml:"operatorFile"`
	Description  string        `json:"description" yaml:"description"`
	TestCases    []TestCaseDef `json:"testCases" yaml:"testCases"`
	// contains filtered or unexported fields
}

func (TestDef) Valid

func (t TestDef) Valid() bool

func (TestDef) Validate

func (t TestDef) Validate() error

Jump to

Keyboard shortcuts

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