Documentation
¶
Overview ¶
In many cases such as restoring backups, jobs can be quite complex and should/can be broken down into smaller steps
Step is an utility structure that allows breaking down jobs complete with persist support
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Step ¶
type Step[T any] struct { State string // By default, steps of a lower index are ignored // Steps may however have an equal index in which case the step that is first in the array is first executed Index int // Exec will either return the output and/which ends the job, the new progress for the job // or an error to quickly abort the stepping Exec func( self *T, l *zap.Logger, state jobstate.State, progstate jobstate.ProgressState, progress *jobstate.Progress, ) (*types.Output, *jobstate.Progress, error) }
type Stepper ¶
type Stepper[T any] struct { // contains filtered or unexported fields }
func NewStepper ¶
NewStepper creates a new stepper
func (*Stepper[T]) Exec ¶
func (s *Stepper[T]) Exec( self *T, l *zap.Logger, state jobstate.State, progstate jobstate.ProgressState, ) (*types.Output, error)
Exec executes all steps, skipping over steps with a lower index
Click to show internal directories.
Click to hide internal directories.