state

package
v1.0.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: May 7, 2020 License: BSD-3-Clause Imports: 1 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UpdateFlow

func UpdateFlow(s *SnapshotBase, change *change.Flow)
func UpdateLinks(snapshot *SnapshotBase, linkId int, change *change.Link)

func UpdateQueue

func UpdateQueue(fs *Snapshot, id int, queueChg *change.Queue, first *int) bool

func UpdateTasks

func UpdateTasks(snapshot *SnapshotBase, taskId string, change *change.Task)

Types

type FlowInfo

type FlowInfo struct {
	Id      string `json:"id"`
	FlowURI string `json:"flowURI"`
	Status  int    `json:"status"`
}
type Link struct {
	Id     int `json:"id"`
	Status int `json:"status"`
}

type Recorder

type Recorder interface {
	// RecordSnapshot records a Snapshot of the FlowInstance
	RecordSnapshot(snapshot *Snapshot) error

	// RecordStep records the changes for the current Step of the Flow Instance
	RecordStep(step *Step) error
}

Recorder is the interface that describes a service that can record snapshots and steps of a Flow Instance

type Snapshot

type Snapshot struct {
	*SnapshotBase
	Id        string      `json:"id"`
	WorkQueue []*WorkItem `json:"workQueue,omitempty"`
	Subflows  []*Subflow  `json:"subflows,omitempty"`
}

func StepsToSnapshot

func StepsToSnapshot(flowId string, steps []*Step) *Snapshot

type SnapshotBase

type SnapshotBase struct {
	FlowURI string                 `json:"flowURI"`
	Status  int                    `json:"status"`
	Attrs   map[string]interface{} `json:"attrs,omitempty"`
	Tasks   []*Task                `json:"tasks,omitempty"`
	Links   []*Link                `json:"links,omitempty"`
}

type Step

type Step struct {
	Id           int                   `json:"id"`
	FlowId       string                `json:"flowId"`
	FlowChanges  map[int]*change.Flow  `json:"flowChanges"`
	QueueChanges map[int]*change.Queue `json:"queueChanges,omitempty"`
}

type Subflow

type Subflow struct {
	*SnapshotBase
	Id     int    `json:"id"`
	TaskId string `json:"taskId"`
}

type Task

type Task struct {
	Id     string `json:"id"`
	Status int    `json:"status"`
}

type WorkItem

type WorkItem struct {
	ID        int    `json:"id"`
	SubflowId int    `json:"subflowId"`
	TaskId    string `json:"taskId"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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