Documentation ¶
Index ¶
- Variables
- func GoAndRun(ctx context.Context, wg *sync.WaitGroup, reg *NodesReg, firstValue []byte)
- func PrepareAllInputs(inputs NodeConnection) []string
- func PrepareOutputs(outputs NodeConnection) [][]Connection
- func VisitAndFetch(ctx context.Context, reg *NodesReg) error
- type Connection
- type Connections
- type ContextTagsValue
- type ContextType
- type CountStucker
- type Inputs
- type NodeAttachments
- type NodeConnection
- type NodeData
- type NodeDirectGo
- 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(controlName, startName, method string, appStore *registry.Registry) *NodesReg
- func StartFlow(ctx context.Context, wg *sync.WaitGroup, controlName, endPoint, method string, ...) (*NodesReg, error)
- func (r *NodesReg) AddCleanup(v func())
- func (r *NodesReg) AddError(err error)
- func (r *NodesReg) AddStuctCancel(v context.CancelFunc)
- func (r *NodesReg) CancelStucks()
- func (r *NodesReg) Clear()
- func (r *NodesReg) Get(number string) (Noder, bool)
- func (r *NodesReg) GetChan() <-chan Respond
- func (r *NodesReg) GetStarts() []Starts
- func (r *NodesReg) GetStuctCancel(ctx context.Context) context.Context
- func (r *NodesReg) Set(number string, node Noder)
- func (r *NodesReg) SetChanInactive()
- func (r *NodesReg) UpdateStuck(typeCount CountStucker, trigger bool)
- type Respond
- type Starts
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Input1 = "input_1" Input2 = "input_2" )
View Source
var ( ErrStopGoroutine = errors.New("stop goroutine") ErrEndpointNotFound = errors.New("endpoint not found") )
View Source
var NodeTypes = make(map[string]func(context.Context, *NodesReg, NodeData, string) (Noder, error))
NodeTypes hold new function of releated node.
Functions ¶
func PrepareAllInputs ¶
func PrepareAllInputs(inputs NodeConnection) []string
func PrepareOutputs ¶
func PrepareOutputs(outputs NodeConnection) [][]Connection
Types ¶
type Connection ¶
type Connections ¶
type Connections = struct {
Connections []Connection `json:"connections"`
}
type ContextTagsValue ¶
type ContextTagsValue = map[string]struct{}
type CountStucker ¶
type CountStucker uint
const ( CountTotalIncrease CountStucker = iota + 1 CountTotalDecrease CountStuckIncrease CountStuckDecrease )
type Inputs ¶
func PrepareInputs ¶
func PrepareInputs(inputs NodeConnection) []Inputs
type NodeAttachments ¶
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 NodeDirectGo ¶
type NodeDirectGo interface {
IsDirectGo() NodeRet
}
NodeDirectGo for direct go.
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 ¶
type NodeRetValues interface {
GetBinaryValues() []byte
}
type Noder ¶
type Noder interface { GetType() string Run(context.Context, *sync.WaitGroup, *registry.Registry, NodeRet, string) (NodeRet, error) Fetch(context.Context, *gorm.DB) error IsFetched() bool Validate(context.Context) error ActiveInput(string, map[string]struct{}) Next(int) []Connection NextCount() int IsRespond() bool Check() IsChecked() bool IsDisabled() bool NodeID() string Tags() []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) AddCleanup ¶
func (r *NodesReg) AddCleanup(v func())
func (*NodesReg) AddStuctCancel ¶
func (r *NodesReg) AddStuctCancel(v context.CancelFunc)
func (*NodesReg) CancelStucks ¶
func (r *NodesReg) CancelStucks()
CancelStucks cancel all stuck context of nodes and clear stuck context list.
func (*NodesReg) GetStuctCancel ¶
func (*NodesReg) SetChanInactive ¶
func (r *NodesReg) SetChanInactive()
func (*NodesReg) UpdateStuck ¶
func (r *NodesReg) UpdateStuck(typeCount CountStucker, trigger bool)
type Starts ¶
type Starts = struct { Connection Tags map[string]struct{} }
Click to show internal directories.
Click to hide internal directories.