model

package
v0.12.3 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SIGNAL_STOP = 1
)

Variables

This section is empty.

Functions

func GetValueByPath

func GetValueByPath(msg *Message, pathType string, path string, targetVariableType string) (interface{}, error)

func MsgValueToNumber

func MsgValueToNumber(msg *Message) (float64, error)

Types

type Context

type Context struct {
	// contains filtered or unexported fields
}

func NewContextDB

func NewContextDB(storageLocation string) (*Context, error)

func (*Context) Close

func (ctx *Context) Close()

func (*Context) DeleteRecord

func (ctx *Context) DeleteRecord(name string, flowId string, inMemory bool) error

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 (ctx *Context) GetVariable(name string, flowId string) (Variable, error)

func (*Context) GetVariableType

func (ctx *Context) GetVariableType(name string, flowId string) (string, error)

func (*Context) PutRecord

func (ctx *Context) PutRecord(rec *ContextRecord, flowId string, inMemory bool) error

func (*Context) RegisterFlow

func (ctx *Context) RegisterFlow(flowId string) error

func (*Context) SetVariable

func (ctx *Context) SetVariable(name string, valueType string, value interface{}, description string, flowId string, inMemory bool) error

func (*Context) UnregisterFlow

func (ctx *Context) UnregisterFlow(flowId string) error

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 ContextRecord struct {
	Name        string
	Description string
	UpdatedAt   time.Time
	Variable    Variable
	InMemory    bool
}

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
}

type FlowOperationalContext

type FlowOperationalContext struct {
	FlowId                   string
	IsFlowRunning            bool
	State                    string
	NodeControlSignalChannel chan int  // the channel should be used to stop all waiting nodes .
	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 FlowStatsReport struct {
	CurrentNodeId          NodeID
	CurrentNodeLabel       string
	NumberOfNodes          int
	NumberOfTriggers       int
	NumberOfActiveTriggers int
	NumberOfActiveSubflows int
	State                  string
	StartedAt              time.Time
	WaitingSince           time.Time
	LastExecutionTime      int64
}

type Message

type Message struct {
	AddressStr string
	Address    fimpgo.Address
	Payload    fimpgo.FimpMessage
	RawPayload []byte
	Header     map[string]string
	CancelOp   bool // if true , listening end should close all operations
}

type MetaNode

type MetaNode struct {
	Id                NodeID
	Type              string
	Label             string
	SuccessTransition NodeID
	TimeoutTransition NodeID
	ErrorTransition   NodeID
	Address           string
	Service           string
	ServiceInterface  string
	Config            interface{}
	Ui                interface{}
}

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 NodeID

type NodeID string

type ReactorEvent

type ReactorEvent struct {
	Msg              Message
	Err              error
	TransitionNodeId NodeID
}

type Variable

type Variable struct {
	Value     interface{}
	ValueType string
}

func (*Variable) IsEqual

func (vrbl *Variable) IsEqual(var2 *Variable) (bool, error)

func (*Variable) IsNumber

func (vrbl *Variable) IsNumber() bool

func (*Variable) ToNumber

func (vrbl *Variable) ToNumber() (float64, error)

Jump to

Keyboard shortcuts

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