Documentation ¶
Index ¶
- Constants
- func GetValueByPath(msg *Message, pathType string, path string, targetVariableType string) (interface{}, error)
- func MsgValueToNumber(msg *Message) (float64, error)
- type Context
- func (ctx *Context) Close()
- func (ctx *Context) DeleteRecord(name string, flowId string, inMemory bool) error
- func (ctx *Context) FactoryReset()
- func (ctx *Context) GetRecord(name string, flowId string) (*ContextRecord, error)
- func (ctx *Context) GetRecords(flowId string) []ContextRecord
- func (ctx *Context) GetVariable(name string, flowId string) (Variable, error)
- func (ctx *Context) GetVariableType(name string, flowId string) (string, error)
- func (ctx *Context) PutRecord(rec *ContextRecord, flowId string, inMemory bool) error
- func (ctx *Context) RegisterFlow(flowId string) error
- func (ctx *Context) SetVariable(name string, valueType string, value interface{}, description string, ...) error
- func (ctx *Context) UnregisterFlow(flowId string) error
- type ContextInMemoryStore
- func (ctx *ContextInMemoryStore) DeleteFlow(flowId string)
- func (ctx *ContextInMemoryStore) Get(flowId string, varName string) *ContextRecord
- func (ctx *ContextInMemoryStore) GetRecordsForFlow(flowId string) ([]ContextRecord, error)
- func (ctx *ContextInMemoryStore) Store(rec ContextRecord, flowId string)
- type ContextRecord
- type FlowMeta
- type FlowOperationalContext
- type FlowRunner
- type FlowStatsReport
- type Message
- type MetaNode
- type MsgPipeline
- type Node
- type NodeID
- type ReactorEvent
- type Setting
- type Variable
Constants ¶
View Source
const ( SIGNAL_STOP = 1 SIGNAL_TERMINATE_WAITING = 2 // Signal to terminate all waiting nodes but not trigger nodes ParallelExecutionKeepFirst = "keep_first" ParallelExecutionKeepLast = "keep_last" ParallelExecutionParallel = "parallel" )
Variables ¶
This section is empty.
Functions ¶
func GetValueByPath ¶
func MsgValueToNumber ¶
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func NewContextDB ¶
func (*Context) DeleteRecord ¶
func (*Context) FactoryReset ¶ added in v1.0.1
func (ctx *Context) FactoryReset()
func (*Context) GetRecord ¶
func (ctx *Context) GetRecord(name string, flowId string) (*ContextRecord, error)
func (*Context) GetRecords ¶
func (ctx *Context) GetRecords(flowId string) []ContextRecord
func (*Context) GetVariable ¶
func (*Context) GetVariableType ¶
func (*Context) PutRecord ¶
func (ctx *Context) PutRecord(rec *ContextRecord, flowId string, inMemory bool) error
func (*Context) RegisterFlow ¶
func (*Context) SetVariable ¶
func (*Context) UnregisterFlow ¶
type ContextInMemoryStore ¶
type ContextInMemoryStore struct {
// contains filtered or unexported fields
}
func (*ContextInMemoryStore) DeleteFlow ¶
func (ctx *ContextInMemoryStore) DeleteFlow(flowId string)
func (*ContextInMemoryStore) Get ¶
func (ctx *ContextInMemoryStore) Get(flowId string, varName string) *ContextRecord
func (*ContextInMemoryStore) GetRecordsForFlow ¶
func (ctx *ContextInMemoryStore) GetRecordsForFlow(flowId string) ([]ContextRecord, error)
func (*ContextInMemoryStore) Store ¶
func (ctx *ContextInMemoryStore) Store(rec ContextRecord, flowId string)
type ContextRecord ¶
type FlowMeta ¶
type FlowMeta struct { Id string // Instance id . Is different for every instance ClassId string // Class id , all instances share the same ClassId Author string Version int CreatedAt time.Time UpdatedAt time.Time Name string Group string Description string Nodes []MetaNode Settings map[string]Setting IsDisabled bool IsDefault bool // default flows are read only and can't be deleted ParallelExecution string // keep_first , keep_last , parallel }
type FlowOperationalContext ¶
type FlowOperationalContext struct { FlowMeta *FlowMeta FlowId string IsFlowRunning bool State string TriggerControlSignalChannel chan int // the channel should be used to stop all waiting nodes . NodeControlSignalChannel chan int NodeIsReady chan bool // Flow should notify message router when next node is ready to process new message . StoragePath string ExtLibsDir string }
type FlowRunner ¶
type FlowRunner func(ReactorEvent)
type FlowStatsReport ¶
type MsgPipeline ¶
type MsgPipeline chan Message
type Node ¶
type Node interface { OnInput(msg *Message) ([]NodeID, error) // reactor nodes should publish events into the channel WaitForEvent(responseChannel chan ReactorEvent) GetMetaNode() *MetaNode GetNextSuccessNodes() []NodeID GetNextErrorNode() NodeID GetNextTimeoutNode() NodeID LoadNodeConfig() error IsStartNode() bool IsMsgReactorNode() bool IsReactorRunning() bool //ConfigureInStream(activeSubscriptions *[]string,msgInStream MsgPipeline) // Invoked when node is started Init() error // Invoked when node is stopped Cleanup() error SetConnectorRegistry(connectorRegistry *connector.Registry) SetFlowRunner(runner FlowRunner) }
type ReactorEvent ¶
type Setting ¶ added in v1.0.1
type Setting struct { Value interface{} ValueType string // only simple types supported - int,string,float,bool Description string `json:"omitempty"` // Human readable description InitVar bool `json:"omitempty"` // If set , flow will init variable during startup TVarSType string `json:"omitempty"` // Target variable storage type - mem_local, disk_local,disk_global TVarPType string `json:"omitempty"` // Target variable payload type - int , string , float , bool }
Click to show internal directories.
Click to hide internal directories.