Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CtxWithPhaseSteps ¶ added in v0.15.0
CtxWithPhaseSteps returns a context carrying the total step count for a phase.
func PhaseStepsFromCtx ¶ added in v0.15.0
PhaseStepsFromCtx extracts the total step count from a context, or 0.
func SetDefault ¶
func SetDefault(h *Handler)
SetDefault sets the default callback handler for step events It only updates non-nil handlers to preserve existing defaults Caller may pass a custom handler to pass message to a channel or different logging mechanism etc.
Types ¶
type Handler ¶
type Handler struct {
StepStart func(ctx context.Context, stp automa.Step, msg string, args ...interface{})
StepCompletion func(ctx context.Context, stp automa.Step, report *automa.Report, msg string, args ...interface{})
StepFailure func(ctx context.Context, stp automa.Step, report *automa.Report, msg string, args ...interface{})
StepDetail func(ctx context.Context, stp automa.Step, msg string, args ...interface{})
PhaseStart func(ctx context.Context, stp automa.Step, msg string, args ...interface{})
PhaseCompletion func(ctx context.Context, stp automa.Step, report *automa.Report, msg string, args ...interface{})
PhaseFailure func(ctx context.Context, stp automa.Step, report *automa.Report, msg string, args ...interface{})
}
Handler defines callbacks for step events Caller may pass a custom handler to pass message to a channel or different logging mechanism or webhook (e.g. Slack).
Click to show internal directories.
Click to hide internal directories.