Documentation
¶
Index ¶
- func Basic(fn func(context.Context, interface{}) error, opts ...basicopts) basic
- func Count(count int) basic
- func CountComparator(fn func(int) bool, failMessage string) basic
- func GreaterThan(count int) basic
- func WithBasicDescription(desc string) basicopts
- func WithBasicFailureMessage(msg func(interface{}, error) string) basicopts
- type AllCondition
- type AnyCondition
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Count ¶
func Count(count int) basic
Count returns a condition that checks the count of a countable.
func CountComparator ¶
CountComparator returns a condition that checks the count of a countable based on the given comparator function.
func GreaterThan ¶
func GreaterThan(count int) basic
GreaterThan returns a condition that checks the count of a countable.
func WithBasicDescription ¶
func WithBasicDescription(desc string) basicopts
WithBasicDescription sets the description of the condition.
func WithBasicFailureMessage ¶
WithBasicFailureMessage sets the failure message of the condition.
Types ¶
type AllCondition ¶
type AllCondition struct {
// contains filtered or unexported fields
}
func (*AllCondition) And ¶
func (a *AllCondition) And(conditions ...types.Condition) types.Condition
For internal use only.
func (*AllCondition) Description ¶
func (a *AllCondition) Description() string
Description implements types.Condition.
func (*AllCondition) IsSatisfiedBy ¶
func (c *AllCondition) IsSatisfiedBy(oc context.Context, resource interface{}) error
IsSatisfiedBy implements types.Condition.
func (*AllCondition) WithCaching ¶
func (a *AllCondition) WithCaching() *AllCondition
WithCaching returns a new AllCondition with caching enabled. This means that if a condition is satisfied, it will not be checked again.
type AnyCondition ¶
type AnyCondition struct {
// contains filtered or unexported fields
}
func Any ¶
func Any(conditions ...types.Condition) *AnyCondition
Any returns a condition that is satisfied if any of the given conditions are satisfied.
func (*AnyCondition) Description ¶
func (a *AnyCondition) Description() string
Description implements types.Condition.
func (*AnyCondition) IsSatisfiedBy ¶
func (c *AnyCondition) IsSatisfiedBy(oc context.Context, resource interface{}) error
IsSatisfiedBy implements types.Condition.