Documentation ¶
Index ¶
- Variables
- func CheckRequirement(key, value string, enabledModules ...set.Set) (bool, error)
- func DumpValues() map[string]interface{}
- func GetValue(key string) (interface{}, bool)
- func HasDisruption(key string) (bool, string)
- func RegisterCheck(key string, f CheckFunc)
- func RegisterDisruption(key string, f DisruptionFunc)
- func RemoveValue(key string)
- func SaveValue(key string, value interface{})
- type CheckFunc
- type DisruptionFunc
- type MemoryValuesStore
- type ValueGetter
Constants ¶
This section is empty.
Variables ¶
var (
ErrNotRegistered = errors.New("Not registered")
)
Functions ¶
func CheckRequirement ¶
CheckRequirement run check functions for `key` requirement. Returns true if all checks is passed, false otherwise enabledModules is optional and will filter check-functions if module is disabled
func DumpValues ¶ added in v1.60.0
func DumpValues() map[string]interface{}
DumpValues return all stored requirement values
func GetValue ¶ added in v1.38.1
GetValue returns saved value. !Attention: Please don't use it in hooks, only for tests
func HasDisruption ¶ added in v0.0.6
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
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
func RemoveValue ¶ added in v1.38.1
func RemoveValue(key string)
RemoveValue remove previously stored value
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(getter ValueGetter) (bool, string)
DisruptionFunc implements inner logic to warn users about potentially dangerous changes
type MemoryValuesStore ¶ added in v1.38.1
type MemoryValuesStore struct {
// contains filtered or unexported fields
}
func (*MemoryValuesStore) Get ¶ added in v1.38.1
func (m *MemoryValuesStore) Get(key string) (interface{}, bool)
func (*MemoryValuesStore) GetAll ¶ added in v1.60.0
func (m *MemoryValuesStore) GetAll() map[string]interface{}
func (*MemoryValuesStore) Remove ¶ added in v1.38.1
func (m *MemoryValuesStore) Remove(key string)
func (*MemoryValuesStore) Set ¶ added in v1.38.1
func (m *MemoryValuesStore) Set(key string, value interface{})