svcutil

package
v0.0.0-...-b152a5f Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceTimeout = 10 * time.Second

Variables

This section is empty.

Functions

func IsFatal

func IsFatal(err error) bool

func NoRestartErr

func NoRestartErr(err error) error

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 SpecWithDebugLogger(l logger.Logger) suture.Spec

func SpecWithInfoLogger

func SpecWithInfoLogger(l logger.Logger) suture.Spec

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.

func (*FatalErr) Error

func (e *FatalErr) Error() string

func (*FatalErr) Is

func (*FatalErr) Is(target error) bool

func (*FatalErr) Unwrap

func (e *FatalErr) Unwrap() error

type ServiceWithError

type ServiceWithError interface {
	suture.Service
	fmt.Stringer
	Error() error
}

func AsService

func AsService(fn func(ctx context.Context) error, creator string) ServiceWithError

AsService wraps the given function to implement suture.Service. In addition it keeps track of the returned error and allows querying that error.

Jump to

Keyboard shortcuts

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