workflow

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrWorkflowTyp = errors.New("work type error")

Functions

This section is empty.

Types

type DefaultWorkflow

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

func NewDefaultWorkflow

func NewDefaultWorkflow() *DefaultWorkflow

func (*DefaultWorkflow) CheckTaskFlow

func (w *DefaultWorkflow) CheckTaskFlow() bool

func (*DefaultWorkflow) DeleteWork

func (w *DefaultWorkflow) DeleteWork(key int) error

func (*DefaultWorkflow) DeleteWorkFlow

func (w *DefaultWorkflow) DeleteWorkFlow(tasklist []int)

todo

func (*DefaultWorkflow) InsertWork

func (w *DefaultWorkflow) InsertWork(tasklist []int, weight int)

func (*DefaultWorkflow) InsertWorkes

func (w *DefaultWorkflow) InsertWorkes(tasklists [][]int, weights []int)

func (*DefaultWorkflow) Marshal

func (w *DefaultWorkflow) Marshal() ([]byte, error)

func (*DefaultWorkflow) Sort

func (w *DefaultWorkflow) Sort() ([]int, bool)

func (*DefaultWorkflow) Unmarshal

func (w *DefaultWorkflow) Unmarshal([]byte) error

type WorkFlow

type WorkFlow interface {
	// 添加任务依赖关系
	InsertWork(tasklist []int, weights int)

	// 添加多个任务依赖关系
	InsertWorkes(tasklists [][]int, weights []int)

	// 删除任务节点
	DeleteWork(key int) error

	// 删除工作流
	DeleteWorkFlow(tasklist []int)

	// 检测任务流是否可执行
	CheckTaskFlow() bool

	// 输出任务执行顺序
	Sort() ([]int, bool)

	// 序列化邻截表
	Marshal() ([]byte, error)

	// 反序列化邻截表
	Unmarshal([]byte) error
}

func NewWorkflow

func NewWorkflow(typ string) (WorkFlow, error)

Jump to

Keyboard shortcuts

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