notify

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CtxWithPhaseSteps added in v0.15.0

func CtxWithPhaseSteps(ctx context.Context, totalSteps int) context.Context

CtxWithPhaseSteps returns a context carrying the total step count for a phase.

func PhaseStepsFromCtx added in v0.15.0

func PhaseStepsFromCtx(ctx context.Context) int

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).

func As

func As() *Handler

As returns the current notification handler

Jump to

Keyboard shortcuts

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