Documentation ¶
Index ¶
- Variables
- func MatchFirst(checks ...func() bool) bool
- func New() *eventbus
- func NewHandler(h HandlerFn, ops ...HandlerRegOp) *handler
- func Service() *eventbus
- func Set(eb *eventbus)
- type ConstraintMatcher
- func ConstraintMaker(name, op string, vv ...string) (ConstraintMatcher, error)
- func MustBeEqual(name string, vv ...string) (ConstraintMatcher, error)
- func MustBeLike(name string, vv ...string) (ConstraintMatcher, error)
- func MustMakeConstraint(name, op string, vv ...string) ConstraintMatcher
- func MustMatch(name string, vv ...string) (ConstraintMatcher, error)
- func MustNotBeEqual(name string, vv ...string) (ConstraintMatcher, error)
- func MustNotBeLike(name string, vv ...string) (ConstraintMatcher, error)
- func MustNotMatch(name string, vv ...string) (ConstraintMatcher, error)
- type Event
- type HandlerFn
- type HandlerRegOp
- type HandlerSet
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUnsupportedName = fmt.Errorf("constraint name not supported")
View Source
var ErrUnsupportedOp = fmt.Errorf("operator not supported")
Functions ¶
func MatchFirst ¶
func NewHandler ¶
func NewHandler(h HandlerFn, ops ...HandlerRegOp) *handler
Types ¶
type ConstraintMatcher ¶
func ConstraintMaker ¶
func ConstraintMaker(name, op string, vv ...string) (ConstraintMatcher, error)
Converts raw ConstraintMatcher into one of the ConstraintMatcher handlers
func MustBeEqual ¶
func MustBeEqual(name string, vv ...string) (ConstraintMatcher, error)
func MustBeLike ¶
func MustBeLike(name string, vv ...string) (ConstraintMatcher, error)
func MustMakeConstraint ¶
func MustMakeConstraint(name, op string, vv ...string) ConstraintMatcher
func MustNotBeEqual ¶
func MustNotBeEqual(name string, vv ...string) (ConstraintMatcher, error)
func MustNotBeLike ¶
func MustNotBeLike(name string, vv ...string) (ConstraintMatcher, error)
func MustNotMatch ¶
func MustNotMatch(name string, vv ...string) (ConstraintMatcher, error)
type Event ¶
type Event interface { // ResourceType from resource that fired the event ResourceType() string // EventType returns type of event fired EventType() string // Match tests if given constraints match // event's internal values Match(ConstraintMatcher) bool }
type HandlerRegOp ¶
type HandlerRegOp func(t *handler)
func Constraint ¶
func Constraint(c ConstraintMatcher) HandlerRegOp
func For ¶
func For(rr ...string) HandlerRegOp
func On ¶
func On(ee ...string) HandlerRegOp
func Weight ¶
func Weight(weight int) HandlerRegOp
type HandlerSet ¶
type HandlerSet []*handler
@todo add sorting interface
func (HandlerSet) Len ¶
func (set HandlerSet) Len() int
func (HandlerSet) Less ¶
func (set HandlerSet) Less(i, j int) bool
func (HandlerSet) Swap ¶
func (set HandlerSet) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.