Documentation
¶
Index ¶
- type Config
- type ExecutionGraph
- func (g *ExecutionGraph) Duration() time.Duration
- func (g *ExecutionGraph) Finish()
- func (g *ExecutionGraph) FinishAt() time.Time
- func (g *ExecutionGraph) IsFinished() bool
- func (g *ExecutionGraph) IsRunning() bool
- func (g *ExecutionGraph) IsStarted() bool
- func (g *ExecutionGraph) Nodes() []*Node
- func (g *ExecutionGraph) Start()
- func (g *ExecutionGraph) StartAt() time.Time
- type Node
- type NodeState
- type NodeStatus
- type Scheduler
- func (sc *Scheduler) Cancel(g *ExecutionGraph)
- func (sc *Scheduler) HandlerNode(name string) *Node
- func (sc *Scheduler) Schedule(ctx context.Context, g *ExecutionGraph, done chan *Node) error
- func (sc *Scheduler) Signal(g *ExecutionGraph, sig os.Signal, done chan bool, allowOverride bool)
- func (sc *Scheduler) Status(g *ExecutionGraph) Status
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExecutionGraph ¶
type ExecutionGraph struct {
// contains filtered or unexported fields
}
ExecutionGraph represents a graph of steps.
func NewExecutionGraph ¶
func NewExecutionGraph(steps ...dag.Step) (*ExecutionGraph, error)
NewExecutionGraph creates a new execution graph with the given steps.
func NewExecutionGraphForRetry ¶
func NewExecutionGraphForRetry(nodes ...*Node) (*ExecutionGraph, error)
NewExecutionGraphForRetry creates a new execution graph for retry with given nodes.
func (*ExecutionGraph) Duration ¶
func (g *ExecutionGraph) Duration() time.Duration
Duration returns the duration of the execution.
func (*ExecutionGraph) Finish ¶ added in v1.13.0
func (g *ExecutionGraph) Finish()
func (*ExecutionGraph) FinishAt ¶ added in v1.13.0
func (g *ExecutionGraph) FinishAt() time.Time
func (*ExecutionGraph) IsFinished ¶ added in v1.13.0
func (g *ExecutionGraph) IsFinished() bool
func (*ExecutionGraph) IsRunning ¶ added in v1.13.0
func (g *ExecutionGraph) IsRunning() bool
func (*ExecutionGraph) IsStarted ¶ added in v1.13.0
func (g *ExecutionGraph) IsStarted() bool
func (*ExecutionGraph) Nodes ¶
func (g *ExecutionGraph) Nodes() []*Node
Nodes returns the nodes of the execution graph.
func (*ExecutionGraph) Start ¶ added in v1.13.0
func (g *ExecutionGraph) Start()
func (*ExecutionGraph) StartAt ¶ added in v1.13.0
func (g *ExecutionGraph) StartAt() time.Time
type Node ¶
type Node struct {
NodeState
// contains filtered or unexported fields
}
Node is a node in a DAG. It executes a command.
type NodeState ¶
type NodeState struct {
Status NodeStatus
Log string
StartedAt time.Time
FinishedAt time.Time
RetryCount int
RetriedAt time.Time
DoneCount int
Error error
}
NodeState is the state of a node.
type NodeStatus ¶
type NodeStatus int
const ( NodeStatusNone NodeStatus = iota NodeStatusRunning NodeStatusError NodeStatusCancel NodeStatusSuccess NodeStatusSkipped )
func (NodeStatus) String ¶
func (s NodeStatus) String() string
type Scheduler ¶
type Scheduler struct {
*Config
// contains filtered or unexported fields
}
Scheduler is a scheduler that runs a graph of steps.
func (*Scheduler) Cancel ¶
func (sc *Scheduler) Cancel(g *ExecutionGraph)
Cancel sends -1 signal to all nodes.
func (*Scheduler) HandlerNode ¶
HandlerNode returns the handler node with the given name.
func (*Scheduler) Signal ¶
Signal sends a signal to the scheduler. for a node with repeat policy, it does not stop the node and wait to finish current run.
func (*Scheduler) Status ¶
func (sc *Scheduler) Status(g *ExecutionGraph) Status
Status returns the status of the scheduler.