Documentation
¶
Index ¶
- Variables
- func GoAndRun(ctx context.Context, wg *sync.WaitGroup, reg *NodesReg, firstValue []byte)
- func PrepareOutputs(outputs NodeConnection) [][]Connection
- func VisitAndFetch(ctx context.Context, reg *NodesReg) error
- type Connection
- type Connections
- type CountStucker
- type Inputs
- type NodeConnection
- type NodeData
- type NodeRet
- type NodeRetDatas
- type NodeRetRespond
- type NodeRetRespondData
- type NodeRetSelection
- type NodeRetValues
- type Noder
- type NoderEndpoint
- type NodesData
- type NodesReg
- func DataToNode(ctx context.Context, controlName, startName, method string, datas NodesData, ...) (*NodesReg, error)
- func NewNodesReg(ctx context.Context, controlName, startName, method string, ...) *NodesReg
- func StartFlow(ctx context.Context, wg *sync.WaitGroup, controlName, endPoint, method string, ...) (*NodesReg, error)
- func (r *NodesReg) AddError(err error)
- func (r *NodesReg) Get(number string) (Noder, bool)
- func (r *NodesReg) GetChan() <-chan Respond
- func (r *NodesReg) GetStarts() []Connection
- func (r *NodesReg) GetStuckCtx() context.Context
- func (r *NodesReg) Set(number string, node Noder)
- func (r *NodesReg) SetChanInactive()
- func (r *NodesReg) UpdateStuck(typeCount CountStucker, trigger bool)
- type Respond
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrStopGoroutine = errors.New("stop goroutine") ErrEndpointNotFound = errors.New("endpoint not found") )
View Source
var Input1 = "input_1"
View Source
var NodeTypes = make(map[string]func(context.Context, *NodesReg, NodeData, string) (Noder, error))
NodeTypes hold new function of releated node.
Functions ¶
func PrepareOutputs ¶
func PrepareOutputs(outputs NodeConnection) [][]Connection
Types ¶
type Connection ¶
type Connections ¶
type Connections = struct {
Connections []Connection `json:"connections"`
}
type CountStucker ¶ added in v0.3.1
type CountStucker uint
const ( CountTotalIncrease CountStucker = iota + 1 CountTotalDecrease CountStuckIncrease CountStuckDecrease )
type Inputs ¶
func PrepareInputs ¶
func PrepareInputs(inputs NodeConnection) []Inputs
type NodeConnection ¶
type NodeConnection = map[string]Connections
type NodeData ¶
type NodeData struct {
Data map[string]interface{} `json:"data"`
Inputs NodeConnection `json:"inputs"`
Outputs NodeConnection `json:"outputs"`
Name string
}
type NodeRetDatas ¶
type NodeRetDatas interface {
GetBinaryDatas() [][]byte
}
NodeRetDatas usuful for-loop operation.
type NodeRetRespond ¶
type NodeRetRespond interface {
GetRespond() Respond
}
NodeRetRespond using for responding request.
type NodeRetRespondData ¶
type NodeRetRespondData interface {
GetRespondData() Respond
}
NodeRetRespondData using if next node wants to respond data.
type NodeRetSelection ¶
type NodeRetSelection interface {
GetSelection() []int
}
NodeRetSelection usable if more than one output and want to choice between of them. Write to output numbers 0-4-5.
type NodeRetValues ¶ added in v0.3.1
type NodeRetValues interface {
GetBinaryValues() []byte
}
type Noder ¶
type Noder interface {
GetType() string
Run(context.Context, *sync.WaitGroup, *registry.AppStore, NodeRet, string) (NodeRet, error)
Fetch(context.Context, *gorm.DB) error
IsFetched() bool
Validate() error
ActiveInput(string)
Next(int) []Connection
NextCount() int
IsRespond() bool
Check()
IsChecked() bool
NodeID() string
}
Noder for nodes like script, endpoint.
type NoderEndpoint ¶
type NodesReg ¶
type NodesReg struct {
// contains filtered or unexported fields
}
NodesReg hold concreate information of nodes and start points.
func DataToNode ¶
func NewNodesReg ¶
func (*NodesReg) GetStarts ¶
func (r *NodesReg) GetStarts() []Connection
func (*NodesReg) GetStuckCtx ¶ added in v0.3.1
GetStuckChan return nil if not started.
func (*NodesReg) SetChanInactive ¶ added in v0.3.1
func (r *NodesReg) SetChanInactive()
func (*NodesReg) UpdateStuck ¶ added in v0.3.1
func (r *NodesReg) UpdateStuck(typeCount CountStucker, trigger bool)
Click to show internal directories.
Click to hide internal directories.