Documentation
¶
Index ¶
- Constants
- Variables
- func ExpandExpression(expr string, props Properties, propDefs map[string]*TypeDef) ([]string, error)
- func IsMarker(item interface{}) bool
- type BOS
- type CFunc
- type Delegate
- type DelegateDef
- type EOS
- type Generics
- type InstanceDef
- type InstanceDefList
- 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() (OperatorDef, error)
- func (o *Operator) Delegate(del string) *Delegate
- 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) WaitForStop()
- type OperatorDef
- func (d OperatorDef) Copy() OperatorDef
- func (d OperatorDef) GenericsSpecified() error
- func (d *OperatorDef) SpecifyGenericPorts(generics map[string]*TypeDef) error
- func (def *OperatorDef) SpecifyOperator(gens Generics, props Properties) error
- func (d OperatorDef) Valid() bool
- func (d *OperatorDef) Validate() error
- type Port
- func (p *Port) Bufferize()
- func (p *Port) Close()
- 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) MapSize() interface{}
- 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) Pull() interface{}
- func (p *Port) PullBOS() bool
- func (p *Port) PullBinary() (utils.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) StringifyComplete() string
- func (p *Port) Type() int
- type Properties
- type Service
- type ServiceDef
- type Synchronizer
- 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"
Functions ¶
func ExpandExpression ¶
Types ¶
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"` // 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 string `json:"operator" yaml:"operator"` Properties Properties `json:"properties,omitempty" yaml:"properties,omitempty"` Generics Generics `json:"generics,omitempty" yaml:"generics,omitempty"` OperatorDef OperatorDef `json:"-" yaml:"definition,omitempty"` // contains filtered or unexported fields }
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 Operator ¶
type Operator struct {
// contains filtered or unexported fields
}
func NewOperator ¶
func NewOperator(name string, f OFunc, c CFunc, gens Generics, props Properties, def OperatorDef) (*Operator, error)
func (*Operator) CorrectlyCompiled ¶
func (*Operator) Define ¶
func (o *Operator) Define() (OperatorDef, error)
func (*Operator) SetProperties ¶
func (o *Operator) SetProperties(properties Properties)
func (*Operator) WaitForStop ¶
func (o *Operator) WaitForStop()
type OperatorDef ¶
type OperatorDef struct { 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 string `json:"-" yaml:"-"` // contains filtered or unexported fields }
func (OperatorDef) Copy ¶
func (d OperatorDef) Copy() OperatorDef
func (OperatorDef) GenericsSpecified ¶
func (d OperatorDef) GenericsSpecified() error
func (*OperatorDef) SpecifyGenericPorts ¶
func (d *OperatorDef) SpecifyGenericPorts(generics map[string]*TypeDef) error
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 (*OperatorDef) SpecifyOperator ¶
func (def *OperatorDef) SpecifyOperator(gens Generics, props Properties) error
func (OperatorDef) Valid ¶
func (d OperatorDef) Valid() bool
func (*OperatorDef) Validate ¶
func (d *OperatorDef) Validate() error
type Port ¶
type Port struct {
// contains filtered or unexported fields
}
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) 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) PullBinary ¶
Pull a binary object
func (*Port) PushNoTriggerBOS ¶
func (p *Port) PushNoTriggerBOS()
func (*Port) SetStreamSource ¶
func (*Port) StreamSource ¶
func (*Port) StringifyComplete ¶
type Properties ¶
func (Properties) Clean ¶
func (p Properties) Clean()
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"` // 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 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 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 map[string]*TypeDef `json:"map,omitempty" yaml:"map,omitempty"` Generic string `json:"generic,omitempty" yaml:"generic,omitempty"` // contains filtered or unexported fields }
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