workflow

package
v0.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ChildNodeError = errors.New("child node error")

Functions

This section is empty.

Types

type Bus

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

func NewBus

func NewBus(start node.Node, sc chan<- Update) *Bus
func (b *Bus) AddLink(l node.Link) error

func (*Bus) AddNode

func (b *Bus) AddNode(n node.Node) error

func (*Bus) Run

func (b *Bus) Run(ctx context.Context, output chan<- node.Output) error

type LinkDirectionM

type LinkDirectionM struct {
	Node      string `json:"node"`
	Connector string `json:"connector"`
}

type LinkM

type LinkM struct {
	From       LinkDirectionM `json:"from"`
	To         LinkDirectionM `json:"to"`
	Annotation string         `json:"annotation"`
}

type NodeM

type NodeM struct {
	Id       string            `json:"id"`
	Name     string            `json:"name"`
	Type     int               `json:"type"`
	Vars     *node.VarStorageM `json:"vars"`
	ReadOnly bool              `json:"readonly"`
}

func ToNodeM

func ToNodeM(n node.Node) (*NodeM, error)

func (*NodeM) ToNode

func (n *NodeM) ToNode() (node.Node, error)

type NodeStatus

type NodeStatus string
const (
	NodeStatusPending NodeStatus = "pending"
	NodeStatusRunning NodeStatus = "running"
	NodeStatusSuccess NodeStatus = "success"
	NodeStatusError   NodeStatus = "error"
	NodeStatusAborted NodeStatus = "aborted"
)

type Position

type Position struct {
	X int `json:"x"`
	Y int `json:"y"`
}

type Route

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

type Update

type Update struct {
	Node    uuid.UUID
	Name    string
	Status  NodeStatus
	Message string
}

func (Update) Pack

func (u Update) Pack() UpdateM

type UpdateM

type UpdateM struct {
	Node    string `json:"node"`
	Status  string `json:"status"`
	Message string `json:"message"`
}

type VarsM

type VarsM struct {
	Values map[string]interface{} `json:"static"`
}

type Workflow

type Workflow struct {
	ID          uuid.UUID
	Name        string
	Nodes       []node.Node
	Links       []node.Link
	Positioning map[uuid.UUID]Position
}

func NewWorkflow

func NewWorkflow() *Workflow

func (*Workflow) FindNode

func (w *Workflow) FindNode(id uuid.UUID) (node.Node, error)

func (*Workflow) MarshalJSON

func (w *Workflow) MarshalJSON() ([]byte, error)

func (*Workflow) Pack

func (w *Workflow) Pack() (*WorkflowM, error)

func (*Workflow) Run

func (w *Workflow) Run(ctx context.Context, updateChan chan<- Update, output chan<- node.Output) error

func (*Workflow) UnmarshalJSON

func (w *Workflow) UnmarshalJSON(data []byte) error

func (*Workflow) Validate

func (w *Workflow) Validate() error

type WorkflowM

type WorkflowM struct {
	ID          string              `json:"id"`
	Name        string              `json:"name"`
	Nodes       []NodeM             `json:"nodes"`
	Links       []LinkM             `json:"links"`
	Positioning map[string]Position `json:"positioning"`
}

func (*WorkflowM) Unpack

func (m *WorkflowM) Unpack() (*Workflow, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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