requirements

package
v1.37.1 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotRegistered = errors.New("Not registered")
)

Functions

func CheckRequirement

func CheckRequirement(key, value string, getter ValueGetter) (bool, error)

CheckRequirement run check function for `key` requirement. Returns true if check is passed, false otherwise

func HasDisruption added in v0.0.6

func HasDisruption(key string) (bool, string)

HasDisruption run check function for `key` disruption. Returns true if disruption condition is met, false otherwise. Returns reason for true response.

func RegisterCheck added in v0.0.6

func RegisterCheck(key string, f CheckFunc)

RegisterCheck add CheckFunc for some component

func RegisterDisruption added in v0.0.6

func RegisterDisruption(key string, f DisruptionFunc)

RegisterDisruption add DisruptionFunc for some component

Types

type CheckFunc

type CheckFunc func(requirementValue string, getter ValueGetter) (bool, error)

CheckFunc check come precondition, comparing desired value (requirementValue) with current value (getter)

type DisruptionFunc added in v0.0.6

type DisruptionFunc func() (bool, string)

DisruptionFunc implements inner logic to warn users about potentially dangerous changes

type ValueGetter

type ValueGetter interface {
	Get(path string) gjson.Result
}

Jump to

Keyboard shortcuts

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