probefx

package
v0.0.0-...-3b96a7a Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = fx.Module(
	"winterfx_core_probefx",
	fx.Provide(
		flagfx.AsDecoderFunc(DecodeParams),
		New,
	),
)

Functions

func AsCheckerProvider

func AsCheckerProvider[T any](fn func(v T) (name string, cfn CheckerFunc)) any

Types

type CheckerFunc

type CheckerFunc func(ctx context.Context) error

type Options

type Options struct {
	fx.In

	*Params

	Checkers []checker `group:"winterfx_core_probefx_checkers"`
}

type Params

type Params struct {
	Cascade int64
}

func DecodeParams

func DecodeParams(fset *flag.FlagSet) *Params

DecodeParams decode probe params

type Probe

type Probe interface {
	// CheckLiveness check liveness
	CheckLiveness() bool

	// CheckReadiness check readiness
	CheckReadiness(ctx context.Context) (s string, failed bool)
}

Probe is a check probe

func New

func New(opts Options) Probe

type Result

type Result interface {
	Collect(name string, err error)

	Result() (s string, failed bool)
}

func NewResult

func NewResult() Result

Jump to

Keyboard shortcuts

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