Documentation ¶
Index ¶
- Constants
- Variables
- func CleanValue(v interface{}) interface{}
- func ExpandExpression(expr string, props Properties, propDefs TypeDefMap) ([]string, error)
- func IsBOS(item interface{}) bool
- func IsEOS(item interface{}) bool
- func IsMarker(item interface{}) bool
- type BOS
- type Binary
- type Blueprint
- func (d Blueprint) Copy(recursive bool) Blueprint
- func (d Blueprint) GenericsSpecified() error
- func (d *Blueprint) SpecifyGenericPorts(generics map[string]*TypeDef) error
- func (def *Blueprint) SpecifyOperator(gens Generics, props Properties) error
- func (d Blueprint) Valid() bool
- func (d *Blueprint) Validate() error
- type BlueprintMetaDef
- type CFunc
- type Delegate
- type DelegateDef
- type EOS
- type Generics
- type InstanceDef
- type InstanceDefList
- type MapStr
- type OFunc
- type Operator
- func (o *Operator) BasePort() *Port
- func (o *Operator) Builtin() bool
- func (o *Operator) CheckStop() bool
- func (o *Operator) Child(name string) *Operator
- func (o *Operator) Children() map[string]*Operator
- func (o *Operator) Compile() (compiled int, depth int)
- func (o *Operator) CorrectlyCompiled() error
- func (o *Operator) Define() (Blueprint, error)
- func (o *Operator) Delegate(del string) *Delegate
- func (o *Operator) Id() uuid.UUID
- func (o *Operator) Main() *Service
- func (o *Operator) Name() string
- func (o *Operator) Parent() *Operator
- func (o *Operator) Property(prop string) interface{}
- func (o *Operator) Service(srv string) *Service
- func (o *Operator) SetParent(par *Operator)
- func (o *Operator) SetProperties(properties Properties)
- func (o *Operator) Start()
- func (o *Operator) Stop()
- func (o *Operator) Stopped() bool
- func (o *Operator) WaitForStop()
- type PH
- type Port
- func (p *Port) Bufferize()
- func (p *Port) Close()
- func (p *Port) Closed() bool
- func (p *Port) Connect(q *Port) (err error)
- func (p *Port) Connected(q *Port) bool
- func (p *Port) Define() TypeDef
- func (p *Port) Delegate() *Delegate
- func (p *Port) Direction() int
- func (p *Port) DirectlyConnected() error
- func (p *Port) Disconnect(q *Port) error
- func (p *Port) Map(name string) *Port
- func (p *Port) MapEntryNames() []string
- func (p *Port) MapLength() int
- func (p *Port) MapType() bool
- func (p *Port) Merge() bool
- func (p *Port) Name() string
- func (p *Port) NewBOS() BOS
- func (p *Port) NewEOS() EOS
- func (p *Port) Open()
- func (p *Port) Operator() *Operator
- func (p *Port) OwnBOS(i interface{}) bool
- func (p *Port) OwnEOS(i interface{}) bool
- func (p *Port) ParentStream() *Port
- func (p *Port) Poll() interface{}
- func (p *Port) PrimitiveType() bool
- func (p *Port) Pull() interface{}
- func (p *Port) PullBOS() bool
- func (p *Port) PullBinary() (Binary, interface{})
- func (p *Port) PullBoolean() (bool, interface{})
- func (p *Port) PullEOS() bool
- func (p *Port) PullFloat64() (float64, interface{})
- func (p *Port) PullInt() (int, interface{})
- func (p *Port) PullString() (string, interface{})
- func (p *Port) Push(item interface{})
- func (p *Port) PushBOS()
- func (p *Port) PushEOS()
- func (p *Port) PushNoTriggerBOS()
- func (p *Port) SetStreamSource(srcStr *Port)
- func (p *Port) Stream() *Port
- func (p *Port) StreamSource() *Port
- func (p *Port) String() string
- func (p *Port) TriggerType() bool
- func (p *Port) Type() int
- func (p *Port) WalkPrimitivePorts(handle func(p *Port))
- type PortGeometryDef
- type Properties
- type Service
- type ServiceDef
- type SlangBundle
- type Synchronizer
- type TestCaseDef
- type TypeDef
- func (d *TypeDef) ApplyProperties(props Properties, propDefs map[string]*TypeDef) error
- func (d TypeDef) Copy() TypeDef
- func (d TypeDef) Equals(p TypeDef) bool
- func (d TypeDef) GenericsSpecified() error
- func (d *TypeDef) SpecifyGenerics(generics map[string]*TypeDef) error
- func (d *TypeDef) Valid() bool
- func (d *TypeDef) Validate() error
- func (d TypeDef) VerifyData(data interface{}) error
- type TypeDefMap
Constants ¶
const ( TYPE_GENERIC = iota TYPE_PRIMITIVE = iota TYPE_TRIGGER = iota TYPE_NUMBER = iota TYPE_STRING = iota TYPE_BINARY = iota TYPE_BOOLEAN = iota TYPE_STREAM = iota TYPE_MAP = iota )
const ( DIRECTION_IN = iota DIRECTION_OUT = iota )
Variables ¶
var CHANNEL_DYNAMIC = false
var CHANNEL_SIZE = 1 << 15
var MAIN_SERVICE = "main"
var PHMultiple = &PH{"[...]"}
var PHSingle = &PH{"..."}
Functions ¶
func CleanValue ¶ added in v0.1.17
func CleanValue(v interface{}) interface{}
func ExpandExpression ¶
func ExpandExpression(expr string, props Properties, propDefs TypeDefMap) ([]string, error)
Types ¶
type Binary ¶ added in v0.1.17
type Binary []byte
func (Binary) MarshalJSON ¶ added in v0.1.17
func (*Binary) MarshalYAML ¶ added in v0.1.17
func (*Binary) UnmarshalJSON ¶ added in v0.1.17
type Blueprint ¶ added in v0.1.17
type Blueprint struct { Id uuid.UUID `json:"id" yaml:"id"` ServiceDefs map[string]*ServiceDef `json:"services,omitempty" yaml:"services,omitempty"` DelegateDefs map[string]*DelegateDef `json:"delegates,omitempty" yaml:"delegates,omitempty"` InstanceDefs InstanceDefList `json:"operators,omitempty" yaml:"operators,omitempty"` PropertyDefs TypeDefMap `json:"properties,omitempty" yaml:"properties,omitempty"` Connections map[string][]string `json:"connections,omitempty" yaml:"connections,omitempty"` Elementary uuid.UUID `json:"-" yaml:"-"` Meta BlueprintMetaDef `json:"meta" yaml:"meta"` TestCases []TestCaseDef `json:"tests,omitempty" yaml:"tests,omitempty"` Geometry *struct { Size struct { Width float32 `json:"width" yaml:"width"` Height float32 `json:"height" yaml:"height"` } `json:"size" yaml:"size"` } `json:"geometry,omitempty" yaml:"geometry,omitempty"` // contains filtered or unexported fields }
func ParseJSONOperatorDef ¶ added in v0.1.17
func ParseYAMLOperatorDef ¶ added in v0.1.17
func (Blueprint) GenericsSpecified ¶ added in v0.1.17
func (*Blueprint) SpecifyGenericPorts ¶ added in v0.1.17
SpecifyGenerics replaces generic types in the operator definition with the types given in the generics map. The values of the map are the according identifiers. It does not touch referenced values such as *TypeDef but replaces them with a reference on a copy.
func (*Blueprint) SpecifyOperator ¶ added in v0.1.17
func (def *Blueprint) SpecifyOperator(gens Generics, props Properties) error
type BlueprintMetaDef ¶ added in v0.1.17
type BlueprintMetaDef struct { Name string `json:"name" yaml:"name"` Icon string `json:"icon" yaml:"icon"` ShortDescription string `json:"shortDescription" yaml:"shortDescription"` Description string `json:"description" yaml:"description"` DocURL string `json:"docUrl" yaml:"docUrl"` Tags []string `json:"tags" yaml:"tags"` // contains filtered or unexported fields }
func (*BlueprintMetaDef) Valid ¶ added in v0.1.17
func (d *BlueprintMetaDef) Valid() bool
func (*BlueprintMetaDef) Validate ¶ added in v0.1.17
func (d *BlueprintMetaDef) Validate() error
type Delegate ¶
type Delegate struct {
// contains filtered or unexported fields
}
func NewDelegate ¶
func NewDelegate(name string, op *Operator, def DelegateDef) (*Delegate, error)
func (*Delegate) Define ¶
func (d *Delegate) Define() DelegateDef
type DelegateDef ¶
type DelegateDef struct { In TypeDef `json:"in" yaml:"in"` Out TypeDef `json:"out" yaml:"out"` Geometry *PortGeometryDef `json:"geometry,omitempty" yaml:"geometry,omitempty"` // contains filtered or unexported fields }
func (DelegateDef) Copy ¶
func (d DelegateDef) Copy() DelegateDef
func (*DelegateDef) Valid ¶
func (d *DelegateDef) Valid() bool
func (*DelegateDef) Validate ¶
func (d *DelegateDef) Validate() error
type InstanceDef ¶
type InstanceDef struct { Name string `json:"-" yaml:"-"` Operator uuid.UUID `json:"operator" yaml:"operator"` Properties Properties `json:"properties,omitempty" yaml:"properties,omitempty"` Generics Generics `json:"generics,omitempty" yaml:"generics,omitempty"` Geometry *struct { Position struct { X float32 `json:"x" yaml:"x"` Y float32 `json:"y" yaml:"y"` } `json:"position" yaml:"position"` } `json:"geometry,omitempty" yaml:"geometry,omitempty"` Blueprint Blueprint `json:"-" yaml:"definition,omitempty"` // contains filtered or unexported fields }
func (InstanceDef) Copy ¶ added in v0.1.17
func (d InstanceDef) Copy(recursive bool) InstanceDef
func (InstanceDef) Valid ¶
func (d InstanceDef) Valid() bool
func (*InstanceDef) Validate ¶
func (d *InstanceDef) Validate() error
type InstanceDefList ¶
type InstanceDefList []*InstanceDef
func (InstanceDefList) MarshalJSON ¶
func (ol InstanceDefList) MarshalJSON() ([]byte, error)
func (InstanceDefList) MarshalYAML ¶
func (ol InstanceDefList) MarshalYAML() (interface{}, error)
func (*InstanceDefList) UnmarshalJSON ¶
func (ol *InstanceDefList) UnmarshalJSON(data []byte) error
func (*InstanceDefList) UnmarshalYAML ¶
func (ol *InstanceDefList) UnmarshalYAML(unmarshal func(v interface{}) error) error
type MapStr ¶ added in v0.1.17
type MapStr map[string]interface{}
func (*MapStr) UnmarshalYAML ¶ added in v0.1.17
type Operator ¶
type Operator struct {
// contains filtered or unexported fields
}
func NewOperator ¶
func (*Operator) CorrectlyCompiled ¶
func (*Operator) SetProperties ¶
func (o *Operator) SetProperties(properties Properties)
func (*Operator) WaitForStop ¶
func (o *Operator) WaitForStop()
type PH ¶ added in v0.1.8
type PH struct {
// contains filtered or unexported fields
}
func (*PH) MarshalJSON ¶ added in v0.1.8
type Port ¶
type Port struct {
// contains filtered or unexported fields
}
func ParsePortReference ¶ added in v0.1.17
func (*Port) DirectlyConnected ¶
Checks if this in port is connected completely
func (*Port) Disconnect ¶
Disconnects this port from port q.
func (*Port) Map ¶
Returns the subport with the according name of this port. Port must be of type map.
func (*Port) MapEntryNames ¶ added in v0.1.17
Returns all map entry names of this port
func (*Port) ParentStream ¶
Returns the parent stream port. Port must be of type stream.
func (*Port) Poll ¶
func (p *Port) Poll() interface{}
Similar to Port.Pull but will return nil when there is no item after timeout
func (*Port) PrimitiveType ¶ added in v0.1.17
func (*Port) PushNoTriggerBOS ¶
func (p *Port) PushNoTriggerBOS()
func (*Port) SetStreamSource ¶
func (*Port) StreamSource ¶
func (*Port) TriggerType ¶ added in v0.1.17
func (*Port) WalkPrimitivePorts ¶ added in v0.1.17
type PortGeometryDef ¶ added in v0.1.15
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(name string, op *Operator, def ServiceDef) (*Service, error)
func (*Service) Define ¶
func (s *Service) Define() ServiceDef
type ServiceDef ¶
type ServiceDef struct { In TypeDef `json:"in" yaml:"in"` Out TypeDef `json:"out" yaml:"out"` Geometry *PortGeometryDef `json:"geometry,omitempty" yaml:"geometry,omitempty"` // contains filtered or unexported fields }
func (ServiceDef) Copy ¶
func (d ServiceDef) Copy() ServiceDef
func (*ServiceDef) Valid ¶
func (d *ServiceDef) Valid() bool
func (*ServiceDef) Validate ¶
func (d *ServiceDef) Validate() error
type SlangBundle ¶ added in v0.1.17
type SlangBundle struct { Main uuid.UUID `json:"main" yaml:"main"` Args struct { Properties Properties `json:"properties,omitempty" yaml:"properties,omitempty"` Generics Generics `json:"generics,omitempty" yaml:"generics,omitempty"` } `json:"args,omitempty"` Blueprints map[uuid.UUID]Blueprint `json:"blueprints"` // contains filtered or unexported fields }
func (SlangBundle) Valid ¶ added in v0.1.17
func (sb SlangBundle) Valid() bool
func (*SlangBundle) Validate ¶ added in v0.1.17
func (sb *SlangBundle) Validate() error
type Synchronizer ¶
type Synchronizer struct {
// contains filtered or unexported fields
}
func (*Synchronizer) Init ¶
func (s *Synchronizer) Init(in, out *Port)
func (*Synchronizer) Pull ¶
func (s *Synchronizer) Pull(token int64, pull pullFunc)
func (*Synchronizer) Push ¶
func (s *Synchronizer) Push(push pushFunc) int64
func (*Synchronizer) Worker ¶
func (s *Synchronizer) Worker()
type TestCaseDef ¶ added in v0.1.17
type TestCaseDef struct { Name string `json:"name" yaml:"name"` Description string `json:"description" yaml:"description"` Generics Generics `json:"generics" yaml:"generics"` Properties Properties `json:"properties" yaml:"properties"` Data struct { In []interface{} `json:"in" yaml:"in"` Out []interface{} `json:"out" yaml:"out"` } // contains filtered or unexported fields }
func (TestCaseDef) Valid ¶ added in v0.1.17
func (tc TestCaseDef) Valid() bool
func (*TestCaseDef) Validate ¶ added in v0.1.17
func (tc *TestCaseDef) Validate() error
type TypeDef ¶
type TypeDef struct { // Type is one of "primitive", "number", "string", "boolean", "stream", "map", "generic" Type string `json:"type" yaml:"type"` Stream *TypeDef `json:"stream,omitempty" yaml:"stream,omitempty"` Map TypeDefMap `json:"map,omitempty" yaml:"map,omitempty"` Generic string `json:"generic,omitempty" yaml:"generic,omitempty"` Optional bool `json:"optional,omitempty" yaml:"optional,omitempty"` // contains filtered or unexported fields }
func ParseTypeDef ¶ added in v0.1.17
func (*TypeDef) ApplyProperties ¶
func (d *TypeDef) ApplyProperties(props Properties, propDefs map[string]*TypeDef) error
func (TypeDef) GenericsSpecified ¶
func (*TypeDef) SpecifyGenerics ¶
SpecifyGenerics replaces generic types in the port definition with the types given in the generics map. The values of the map are the according identifiers. It does not touch referenced values such as *TypeDef but replaces them with a reference on a copy, which is very important to prevent unintended side effects.
func (TypeDef) VerifyData ¶
type TypeDefMap ¶
func (TypeDefMap) GenericsSpecified ¶
func (t TypeDefMap) GenericsSpecified() error
func (TypeDefMap) SpecifyGenerics ¶
func (t TypeDefMap) SpecifyGenerics(generics map[string]*TypeDef) error
func (TypeDefMap) VerifyData ¶
func (t TypeDefMap) VerifyData(data map[string]interface{}) error