operation

package
v0.194.3 Latest Latest
Warning

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

Go to latest
Published: May 26, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Edge

type Edge struct {
	Parent NodeID `json:"parent"`
	Child  NodeID `json:"child"`
}

Edge is a data flow relationship between a parent and a child

type Node

type Node struct {
	ID     NodeID             `json:"id"`
	Spec   flux.OperationSpec `json:"spec"`
	Source NodeSource         `json:"source"`
}

Node denotes a single operation in a query.

type NodeID

type NodeID string

NodeID is a unique ID within a query for the operation.

type NodeSource

type NodeSource struct {
	Stack []interpreter.StackEntry `json:"stack"`
}

NodeSource specifies the source location that created an operation.

type Spec

type Spec struct {
	Operations []*Node                 `json:"operations"`
	Edges      []Edge                  `json:"edges"`
	Resources  flux.ResourceManagement `json:"resources"`
	Now        time.Time               `json:"now"`

	// HasConflict is true if one of the operations in this spec
	// was previously used in another spec. This indicates
	// that two nodes from distinct specs relate to the same
	// operation.
	HasConflict bool
	// contains filtered or unexported fields
}

Spec specifies a query.

func (*Spec) Children

func (q *Spec) Children(id NodeID) []*Node

Children returns a list of children for a given operation. If the query is invalid no children will be returned.

func (*Spec) Functions

func (q *Spec) Functions() ([]string, error)

Functions return the names of all functions used in the plan

func (*Spec) Parents

func (q *Spec) Parents(id NodeID) []*Node

Parents returns a list of parents for a given operation. If the query is invalid no parents will be returned.

func (*Spec) Validate

func (q *Spec) Validate() error

Validate ensures the query is a valid DAG.

func (*Spec) Walk

func (q *Spec) Walk(f func(o *Node) error) error

Walk calls f on each operation exactly once. The function f will be called on an operation only after all of its parents have already been passed to f.

Jump to

Keyboard shortcuts

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