Documentation ¶
Overview ¶
Copyright 2017, RadiantBlue Technologies, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2017, RadiantBlue Technologies, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- Variables
- func NewViaReflection(any interface{}) interface{}
- func ReadFromJSON(jsn string, obj interface{}) error
- func SetStructFromMap(input map[string]interface{}, result interface{}, weakly bool) (interface{}, error)
- func WriteToJSON(obj interface{}) (string, error)
- type ArgMap
- func (m ArgMap) GetBool(field string) (bool, error)
- func (m ArgMap) GetBoolOrDefault(field string, defalt bool) (bool, error)
- func (m ArgMap) GetFloat(field string) (float64, error)
- func (m ArgMap) GetFloatOrDefault(field string, defalt float64) (float64, error)
- func (m ArgMap) GetInterfaceOrDefault(field string, defalt interface{}) (interface{}, error)
- func (m ArgMap) GetString(field string) (string, error)
- func (m ArgMap) GetStringOrDefault(field string, defalt string) (string, error)
- func (m ArgMap) String() string
- func (m ArgMap) ToJSON() (string, error)
- func (m ArgMap) ToStruct(result interface{}) error
- type Component
- type ComponentCore
- type ComponentModel
- type ConnectionModel
- type Expression
- type Function
- type Functions
- type GraphModel
- type Network
- type Parser
- type Serializer
- type Starter
- type Stopper
- type Token
- type Tokenizer
- type TypeFactory
- type Variables
Constants ¶
const ( ColonMarker = 58 PeriodMarker = 46 HyphenMarker = 45 GreaterMarker = 62 WigglyMarker = 126 )
Variables ¶
var Factory = &TypeFactory{ types: map[string]Component{}, }
Functions ¶
func NewViaReflection ¶
func NewViaReflection(any interface{}) interface{}
func ReadFromJSON ¶
func SetStructFromMap ¶
func WriteToJSON ¶
Types ¶
type ArgMap ¶
type ArgMap map[string]interface{}
func (ArgMap) GetBoolOrDefault ¶
func (ArgMap) GetFloatOrDefault ¶
func (ArgMap) GetInterfaceOrDefault ¶
func (ArgMap) GetStringOrDefault ¶
type Component ¶
type Component interface { // the system calls this to do init work specific to your component type // you must implement this Configure() error // contains filtered or unexported methods }
type ComponentCore ¶
type ComponentCore struct { Config ArgMap flow.Component // contains filtered or unexported fields }
type ComponentModel ¶
type ComponentModel struct { Name string `json:"name"` Type string `json:"type"` Precondition string `json:"precondition,omitempty"` Postcondition string `json:"postcondition,omitempty"` Config ArgMap }
func (*ComponentModel) ReadFromJSON ¶
func (m *ComponentModel) ReadFromJSON(jsn string) error
func (*ComponentModel) String ¶
func (c *ComponentModel) String() string
func (*ComponentModel) Validate ¶
func (m *ComponentModel) Validate() error
func (*ComponentModel) WriteToJSON ¶
func (m *ComponentModel) WriteToJSON() (string, error)
type ConnectionModel ¶
type ConnectionModel struct { Source string `json:"source"` // component.port Destination string `json:"destination"` // component.port }
func (*ConnectionModel) ReadFromJSON ¶
func (m *ConnectionModel) ReadFromJSON(jsn string) error
func (*ConnectionModel) String ¶
func (c *ConnectionModel) String() string
func (*ConnectionModel) Validate ¶
func (m *ConnectionModel) Validate() error
func (*ConnectionModel) WriteToJSON ¶
func (m *ConnectionModel) WriteToJSON() (string, error)
type Expression ¶
type Expression struct {
// contains filtered or unexported fields
}
func NewExpression ¶
func NewExpression(text string, funcs Functions) (e *Expression, err error)
func (*Expression) Eval ¶
func (e *Expression) Eval(vars Variables) (result interface{}, err error)
func (*Expression) String ¶
func (e *Expression) String() string
type Function ¶
type Function govaluate.ExpressionFunction
type Functions ¶
type Functions map[string]govaluate.ExpressionFunction
type GraphModel ¶
type GraphModel struct { Name string `json:"name"` Components []*ComponentModel `json:"components"` Connections []*ConnectionModel `json:"connections"` }
func ParseDSL ¶
func ParseDSL(lines string) (*GraphModel, error)
func (*GraphModel) ReadFromJSON ¶
func (m *GraphModel) ReadFromJSON(jsn string) error
func (*GraphModel) String ¶
func (g *GraphModel) String() string
func (*GraphModel) Validate ¶
func (m *GraphModel) Validate() error
func (*GraphModel) WriteToJSON ¶
func (m *GraphModel) WriteToJSON() (string, error)
type Network ¶
Network represents a running instance of a Graph We can have several Networks running at the same time.
func NewNetwork ¶
func NewNetwork(graphModel *GraphModel) (net *Network, err error)
type Serializer ¶
type Starter ¶
type Starter struct { ComponentCore Input <-chan string Output chan<- string }
type Stopper ¶
type Stopper struct { ComponentCore Input <-chan string Output chan<- string }
type TypeFactory ¶
type TypeFactory struct {
// contains filtered or unexported fields
}
func (*TypeFactory) Create ¶
func (f *TypeFactory) Create(typ string, config ArgMap) (Component, error)
func (*TypeFactory) Register ¶
func (f *TypeFactory) Register(name string, typ Component)