workflow

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2024 License: MIT Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	Workflows map[string]Workflow // the key is the filename for the workflow
	// contains filtered or unexported fields
}

func New

func New(path string, opts *file.Options) (*Cache, error)

New returns a Cache used to manage auto updating a workflow

func (*Cache) Children

func (c *Cache) Children(t task.Task) []Phase

Children of the given task t, a child phase is one that dependsOn another task Empty slice will be returned if no children are found. A task without a type or meta data containing the workflow info will result in an error

func (*Cache) Close

func (c *Cache) Close() error

Close the cache

func (*Cache) Get

func (c *Cache) Get(t task.Task) Phase

Get the Phase associated with the task looks for matching phases within a workflow defined in meta that matches the task Type and job.

func (*Cache) Refresh

func (c *Cache) Refresh() (changedFiles []string, err error)

Refresh checks the cache and reloads any files if the checksum has changed.

func (*Cache) Search added in v0.11.1

func (c *Cache) Search(task, job string) (path string, ph Phase)

Search the all workflows within the cache anc return the first matching phase with the specific task and job (optional)

type Phase

type Phase struct {
	Task      string // Should use Topic() and Job() for access
	Rule      string
	DependsOn string // Task that the previous workflow depends on
	Retry     int
	Template  string // template used to create the task
}

func (Phase) IsEmpty added in v0.7.3

func (p Phase) IsEmpty() bool

func (Phase) Job added in v0.11.1

func (p Phase) Job() string

Job portion of the Task

func (Phase) Topic added in v0.11.1

func (p Phase) Topic() string

Topic portion of the Task

type Workflow

type Workflow struct {
	Checksum string  // md5 hash for the file to check for changes
	Phases   []Phase `toml:"phase"`
}

Jump to

Keyboard shortcuts

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