Documentation ¶
Index ¶
- Constants
- func CallWithContext(ctx context.Context, fn func() error) error
- func IsFatal(err error) bool
- func NoRestartErr(err error) error
- func OnSupervisorDone(sup *suture.Supervisor, fn func())
- func SpecWithDebugLogger(l logger.Logger) suture.Spec
- func SpecWithInfoLogger(l logger.Logger) suture.Spec
- type ExitStatus
- type FatalErr
- type ServiceWithError
Constants ¶
View Source
const ServiceTimeout = 10 * time.Second
Variables ¶
This section is empty.
Functions ¶
func CallWithContext ¶ added in v1.24.0
func NoRestartErr ¶
NoRestartErr wraps the given error err (which may be nil) to make sure that `errors.Is(err, suture.ErrDoNotRestart) == true`.
func OnSupervisorDone ¶
func OnSupervisorDone(sup *suture.Supervisor, fn func())
OnSupervisorDone calls fn when sup is done.
func SpecWithDebugLogger ¶
func SpecWithInfoLogger ¶
Types ¶
type ExitStatus ¶
type ExitStatus int
const ( ExitSuccess ExitStatus = 0 ExitError ExitStatus = 1 ExitNoUpgradeAvailable ExitStatus = 2 ExitRestart ExitStatus = 3 ExitUpgrade ExitStatus = 4 )
func (ExitStatus) AsInt ¶
func (s ExitStatus) AsInt() int
type FatalErr ¶
type FatalErr struct { Err error Status ExitStatus }
func AsFatalErr ¶
func AsFatalErr(err error, status ExitStatus) *FatalErr
AsFatalErr wraps the given error creating a FatalErr. If the given error already is of type FatalErr, it is not wrapped again.
type ServiceWithError ¶
Click to show internal directories.
Click to hide internal directories.