workflows

package
v0.16.14 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TagActionAdd = TagAction(iota)
	TagActionRemove
	TagActionToggle
)

Variables

This section is empty.

Functions

func AddWorkflowVersionNodeLog

func AddWorkflowVersionNodeLog(db *sqlx.DB, nodeId int, reference string, workflowVersionNodeId int,
	triggeringWorkflowVersionNodeId int, inputs map[string]string, outputs map[string]string, workflowError error)

func GetTriggerGoupChildNodes added in v0.16.9

func GetTriggerGoupChildNodes(db *sqlx.DB, workflowVersionNodeId int) (map[int]*WorkflowNode, map[int]WorkflowVersionNodeLink, error)

func ProcessWorkflowNode

func ProcessWorkflowNode(ctx context.Context, db *sqlx.DB,
	nodeSettings commons.ManagedNodeSettings, workflowNode WorkflowNode, triggeringWorkflowVersionNodeId int,
	workflowNodeCache map[int]WorkflowNode, workflowNodeStatus map[int]commons.Status, workflowNodeStagingParametersCache map[int]map[string]string,
	reference string, inputs map[string]string, iteration int) (map[string]string, commons.Status, error)

ProcessWorkflowNode workflowNodeStagingParametersCache[WorkflowVersionNodeId][inputLabel] (i.e. inputLabel = sourceChannelIds)

func RegisterWorkflowRoutes

func RegisterWorkflowRoutes(r *gin.RouterGroup, db *sqlx.DB)

Types

type ChannelPolicyConfigurationParameters

type ChannelPolicyConfigurationParameters struct {
	FeeRate       int64 `json:"feeRate"`
	BaseFee       int64 `json:"baseFee"`
	MaxHtlcAmount int64 `json:"maxHtlcAmount"`
	MinHtlcAmount int64 `json:"minHtlcAmount"`
}

type CreateNodeRequest

type CreateNodeRequest struct {
	WorkflowVersionId  int                            `json:"workflowVersionId" db:"workflow_version_id"`
	Name               string                         `json:"name" db:"name"`
	Type               commons.WorkflowNodeType       `json:"type" db:"type"`
	Stage              int                            `json:"stage" db:"stage"`
	VisibilitySettings WorkflowNodeVisibilitySettings `json:"visibilitySettings" db:"visibility_settings"`
	Parameters         interface{}                    `json:"parameters" db:"parameters"`
}

type CreateWorkflowVersionNodeLinkRequest

type CreateWorkflowVersionNodeLinkRequest struct {
	WorkflowVersionId           int `json:"workflowVersionId" db:"workflow_version_id"`
	ParentOutputIndex           int `json:"parentOutputIndex" db:"parent_output_index"`
	ParentWorkflowVersionNodeId int `json:"parentWorkflowVersionNodeId" db:"parent_workflow_version_node_id"`
	ChildInputIndex             int `json:"childInputIndex" db:"child_input_index"`
	ChildWorkflowVersionNodeId  int `json:"childWorkflowVersionNodeId" db:"child_workflow_version_node_id"`
}

type DeleteStageRequest

type DeleteStageRequest struct {
	WorkflowVersionId int `json:"workflowVersionId"`
	Stage             int `json:"stage"`
}

type LinkVisibilitySettings

type LinkVisibilitySettings struct {
	XPosition int `json:"xPosition"`
	YPosition int `json:"yPosition"`
}

type ModifyTagsParameters

type ModifyTagsParameters struct {
	TagNames  []string  `json:"tagNames"`
	TagAction TagAction `json:"tagAction"`
}

type ReBalanceParameters

type ReBalanceParameters struct {
	OutgoingChannelId  *int   `json:"outgoingChannelId"`
	IncomingChannelId  *int   `json:"incomingChannelId"`
	ChannelIds         []int  `json:"channelIds"`
	AmountMsat         uint64 `json:"amountMsat"`
	MaximumCostMsat    uint64 `json:"maximumCostMsat"`
	MaximumConcurrency *int   `json:"maximumConcurrency"`
}

type TagAction

type TagAction int

type TagInfo added in v0.16.9

type TagInfo struct {
	Label string `json:"label"`
	Value int    `json:"value"`
}

type TagParameters added in v0.16.9

type TagParameters struct {
	AddedTags   []TagInfo `json:"addedTags"`
	RemovedTags []TagInfo `json:"removedTags"`
}

type TimeTriggerParameters

type TimeTriggerParameters struct {
	Seconds  int32 `json:"seconds" db:"seconds"`
	TimeUnit int   `json:"timeUnit" db:"time_unit"` // Time Unit is just used in the frontend
}

type UpdateNodeRequest

type UpdateNodeRequest struct {
	WorkflowVersionNodeId int                             `json:"workflowVersionNodeId" db:"workflow_version_node_id"`
	Name                  *string                         `json:"name" db:"name"`
	Status                *commons.Status                 `json:"status" db:"status"`
	Parameters            *interface{}                    `json:"parameters" db:"parameters"`
	VisibilitySettings    *WorkflowNodeVisibilitySettings `json:"visibilitySettings" db:"visibility_settings"`
}

type UpdateWorkflow

type UpdateWorkflow struct {
	WorkflowId int             `json:"workflowId" db:"workflow_id"`
	Name       *string         `json:"name" db:"name"`
	Status     *commons.Status `json:"status" db:"status"`
}

type Workflow

type Workflow struct {
	WorkflowId int            `json:"workflowId" db:"workflow_id"`
	Name       string         `json:"name" db:"name"`
	Status     commons.Status `json:"status" db:"status"`
	CreatedOn  time.Time      `json:"createdOn" db:"created_on"`
	UpdateOn   time.Time      `json:"updatedOn" db:"updated_on"`
}

func GetWorkflow

func GetWorkflow(db *sqlx.DB, workflowId int) (Workflow, error)

type WorkflowForest

type WorkflowForest struct {
	SortedStageTrees map[int][]*WorkflowNode `json:"sortedStageTrees"`
}

func GetWorkflowForest

func GetWorkflowForest(db *sqlx.DB, workflowVersionId int) (WorkflowForest, error)

type WorkflowNode

type WorkflowNode struct {
	WorkflowVersionNodeId int                             `json:"workflowVersionNodeId"`
	Name                  string                          `json:"name"`
	Status                commons.Status                  `json:"status"`
	Type                  commons.WorkflowNodeType        `json:"type"`
	Parameters            interface{}                     `json:"parameters"`
	VisibilitySettings    WorkflowNodeVisibilitySettings  `json:"visibilitySettings"`
	UpdateOn              time.Time                       `json:"updatedOn"`
	ParentNodes           map[int]*WorkflowNode           `json:"parentNodes"`
	ChildNodes            map[int]*WorkflowNode           `json:"childNodes"`
	LinkDetails           map[int]WorkflowVersionNodeLink `json:"LinkDetails"`
	WorkflowVersionId     int                             `json:"workflowVersionId"`
}

func GetActiveEventTriggerNodes

func GetActiveEventTriggerNodes(db *sqlx.DB, nodeType commons.WorkflowNodeType) ([]WorkflowNode, error)

func GetActiveSortedStageTriggerNodeForWorkflowVersionId

func GetActiveSortedStageTriggerNodeForWorkflowVersionId(db *sqlx.DB, workflowVersionId int) ([]WorkflowNode, error)

func GetWorkflowNode

func GetWorkflowNode(db *sqlx.DB, workflowVersionNodeId int) (WorkflowNode, error)

GetWorkflowNode is not recursive and only returns direct parent/child relations without further nesting.

type WorkflowNodeParameter

type WorkflowNodeParameter struct {
	Type        commons.WorkflowParameterType `json:"type"`
	ValueNumber int                           `json:"valueNumber"`
	ValueString string                        `json:"valueString"`
}

func (*WorkflowNodeParameter) Scan

func (wp *WorkflowNodeParameter) Scan(val interface{}) (err error)

type WorkflowNodeParameters

type WorkflowNodeParameters struct {
	Parameters []WorkflowNodeParameter `json:"parameters"`
}

func (*WorkflowNodeParameters) Scan

func (nvp *WorkflowNodeParameters) Scan(val interface{}) (err error)

type WorkflowNodeVisibilitySettings

type WorkflowNodeVisibilitySettings struct {
	YPosition *int  `json:"yPosition" db:"yPosition"`
	XPosition *int  `json:"xPosition" db:"xPosition"`
	Collapsed *bool `json:"collapsed" db:"collapsed"`
}

func (*WorkflowNodeVisibilitySettings) Scan

func (nvs *WorkflowNodeVisibilitySettings) Scan(val interface{}) (err error)

type WorkflowPage

type WorkflowPage struct {
	Workflow Workflow                  `json:"workflow"`
	Version  WorkflowVersion           `json:"version"`
	Nodes    []WorkflowVersionNode     `json:"nodes"`
	Links    []WorkflowVersionNodeLink `json:"links"`
}

type WorkflowTableRow

type WorkflowTableRow struct {
	WorkflowId              int     `json:"workflowId" db:"workflow_id"`
	WorkflowName            string  `json:"workflowName" db:"workflow_name"`
	WorkflowStatus          int     `json:"workflowStatus" db:"workflow_status"`
	LatestVersionName       *string `json:"latestVersionName" db:"latest_version_name"`
	LatestVersion           *int    `json:"latestVersion" db:"latest_version"`
	LatestWorkflowVersionId *int    `json:"latestWorkflowVersionId" db:"latest_workflow_version_id"`
	LatestVersionStatus     *int    `json:"latestVersionStatus" db:"latest_version_status"`
	ActiveVersionName       *string `json:"activeVersionName" db:"active_version_name"`
	ActiveVersion           *int    `json:"activeVersion" db:"active_version"`
	ActiveWorkflowVersionId *int    `json:"activeWorkflowVersionId" db:"active_workflow_version_id"`
	ActiveVersionStatus     *int    `json:"activeVersionStatus" db:"active_version_status"`
}

func GetWorkflows

func GetWorkflows(db *sqlx.DB) ([]WorkflowTableRow, error)

type WorkflowVersion

type WorkflowVersion struct {
	WorkflowVersionId int            `json:"workflowVersionId" db:"workflow_version_id"`
	Name              string         `json:"name" db:"name"`
	Version           int            `json:"version" db:"version"`
	Status            commons.Status `json:"status" db:"status"`
	WorkflowId        int            `json:"workflowId" db:"workflow_id"`
	CreatedOn         time.Time      `json:"createdOn" db:"created_on"`
	UpdateOn          time.Time      `json:"updatedOn" db:"updated_on"`
}

func GetWorkflowVersion

func GetWorkflowVersion(db *sqlx.DB, workflowId int, versionId int) (WorkflowVersion, error)

func GetWorkflowVersions

func GetWorkflowVersions(db *sqlx.DB, workflowId int) ([]WorkflowVersion, error)

type WorkflowVersionNode

type WorkflowVersionNode struct {
	WorkflowId            int                            `json:"workflowId" db:"workflow_id"`
	Version               int                            `json:"version" db:"version"`
	WorkflowVersionId     int                            `json:"workflowVersionId" db:"workflow_version_id"`
	WorkflowVersionNodeId int                            `json:"workflowVersionNodeId" db:"workflow_version_node_id"`
	Name                  string                         `json:"name" db:"name"`
	Stage                 int                            `json:"stage" db:"stage"`
	Status                commons.Status                 `json:"status" db:"status"`
	Type                  commons.WorkflowNodeType       `json:"type" db:"type"`
	Parameters            interface{}                    `json:"parameters" db:"parameters"`
	VisibilitySettings    WorkflowNodeVisibilitySettings `json:"visibilitySettings" db:"visibility_settings"`
	CreatedOn             time.Time                      `json:"createdOn" db:"created_on"`
	UpdateOn              time.Time                      `json:"updatedOn" db:"updated_on"`
}

func GetWorkflowNodes

func GetWorkflowNodes(db *sqlx.DB, workflowVersionId int, workflowId int, version int) ([]WorkflowVersionNode, error)

func GetWorkflowVersionNode

func GetWorkflowVersionNode(db *sqlx.DB, workflowVersionNodeId int) (WorkflowVersionNode, error)

func (WorkflowVersionNode) GetWorkflowNodeStructured

func (wfn WorkflowVersionNode) GetWorkflowNodeStructured() WorkflowNode
type WorkflowVersionNodeLink struct {
	WorkflowVersionNodeLinkId   int                                       `json:"workflowVersionNodeLinkId" db:"workflow_version_node_link_id"`
	Name                        string                                    `json:"name" db:"name"`
	VisibilitySettings          WorkflowVersionNodeLinkVisibilitySettings `json:"visibilitySettings" db:"visibility_settings"`
	ParentOutputIndex           int                                       `json:"parentOutputIndex" db:"parent_output_index"`
	ParentWorkflowVersionNodeId int                                       `json:"parentWorkflowVersionNodeId" db:"parent_workflow_version_node_id"`
	ChildInputIndex             int                                       `json:"childInputIndex" db:"child_input_index"`
	ChildWorkflowVersionNodeId  int                                       `json:"childWorkflowVersionNodeId" db:"child_workflow_version_node_id"`
	WorkflowVersionId           int                                       `json:"workflowVersionId" db:"workflow_version_id"`
	CreatedOn                   time.Time                                 `json:"createdOn" db:"created_on"`
	UpdateOn                    time.Time                                 `json:"updatedOn" db:"updated_on"`
	Stage                       int                                       `json:"stage" db:"stage"`
}
func GetWorkflowVersionNodeLinks(db *sqlx.DB, workflowVersionId int) ([]WorkflowVersionNodeLink, error)

type WorkflowVersionNodeLinkVisibilitySettings

type WorkflowVersionNodeLinkVisibilitySettings struct {
	Child  LinkVisibilitySettings `json:"child"`
	Parent LinkVisibilitySettings `json:"parent"`
}

func (*WorkflowVersionNodeLinkVisibilitySettings) Scan

func (nvls *WorkflowVersionNodeLinkVisibilitySettings) Scan(val interface{}) (err error)

type WorkflowVersionNodeLog

type WorkflowVersionNodeLog struct {
	NodeId                          int       `json:"nodeId" db:"node_id"`
	TriggerReference                string    `json:"triggerReference" db:"trigger_reference"`
	InputData                       string    `json:"input_data" db:"input_data"`
	OutputData                      string    `json:"output_data" db:"output_data"`
	DebugData                       string    `json:"debug_data" db:"debug_data"`
	ErrorData                       string    `json:"error_data" db:"error_data"`
	WorkflowVersionNodeId           int       `json:"workflowVersionNodeId" db:"workflow_version_node_id"`
	TriggeringWorkflowVersionNodeId *int      `json:"triggeringWorkflowVersionNodeId" db:"triggering_workflow_version_node_id"`
	CreatedOn                       time.Time `json:"createdOn" db:"created_on"`
}

func GetNodeLogs

func GetNodeLogs(db *sqlx.DB, workflowVersionNodeId int, maximumResultCount int) ([]WorkflowVersionNodeLog, error)

func GetWorkflowLogs

func GetWorkflowLogs(db *sqlx.DB, workflowId int, maximumResultCount int) ([]WorkflowVersionNodeLog, error)

type WorkflowVersionNodeResponse

type WorkflowVersionNodeResponse struct {
	WorkflowVersionNode
	Parameters []byte
}

Jump to

Keyboard shortcuts

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