svcutil

package
v1.24.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2023 License: MPL-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const ServiceTimeout = 10 * time.Second

Variables

This section is empty.

Functions

func CallWithContext added in v1.24.0

func CallWithContext(ctx context.Context, fn func() error) error

func IsFatal added in v1.15.0

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