constraintchecker

package
v0.0.0-...-40f086d Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ConstrainFuncMap = map[string]Constraint{
		"(":  ExclusiveLeftBound,
		")":  ExclusiveRightBound,
		"[":  InclusiveLeftBound,
		"]":  InclusiveRightBound,
		"(]": ExclusiveInclusiveBound,
		"[)": InclusiveExclusiveBound,
		"()": ExclusiveBound,
		"[]": InclusiveBound,
		"=":  Member,
	}
	TypeConvMap = map[types.DataTypeName]func(string) (interface{}, error){
		"bool":   func(r string) (interface{}, error) { return strconv.ParseBool(r) },
		"int":    func(r string) (interface{}, error) { return paramToInt(r) },
		"real":   func(r string) (interface{}, error) { return paramToFloat(r) },
		"string": func(r string) (v interface{}, e error) { v = r; return },
	}
)

Functions

func CheckFile

func CheckFile(ind map[string]types.InducedFileParameter, primary, function map[string]types.FileParameter, param types.FileParameter, val types.InducedFileParameter) (err error)

func CheckParam

func CheckParam(ind map[string]types.InducedParameter, primary, function map[string]types.TransformParameter, param types.TransformParameter, val types.InducedParameter) (err error)

func CheckState

func CheckState(ind map[string]types.InducedStateParameter, primary, function map[string]types.StateParameter, param types.StateParameter, val types.InducedStateParameter) (err error)

func ExclusiveBound

func ExclusiveBound(value string, params ...string) (valid bool, err error)

()

func ExclusiveInclusiveBound

func ExclusiveInclusiveBound(value string, params ...string) (valid bool, err error)

(]

func ExclusiveLeftBound

func ExclusiveLeftBound(value string, params ...string) (valid bool, err error)

(

func ExclusiveRightBound

func ExclusiveRightBound(value string, params ...string) (valid bool, err error)

)

func InclusiveBound

func InclusiveBound(value string, params ...string) (valid bool, err error)

[]

func InclusiveExclusiveBound

func InclusiveExclusiveBound(value string, params ...string) (valid bool, err error)

[)

func InclusiveLeftBound

func InclusiveLeftBound(value string, params ...string) (valid bool, err error)

[

func InclusiveRightBound

func InclusiveRightBound(value string, params ...string) (valid bool, err error)

]

func Member

func Member(value string, params ...string) (valid bool, err error)

Types

type Constraint

type Constraint func(value string, params ...string) (valid bool, err error)

type ValidateConstraintDefinition func(params ...string) error

Jump to

Keyboard shortcuts

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