Documentation
¶
Index ¶
Constants ¶
View Source
const ( COMPARISON_EQUALITY = "equality" COMPARISON_BITAND = "bitand" COMPARISON_PATTERNMATCH = "patternmatch" )
Variables ¶
View Source
var (
ErrUnknownComparisonOperation = func(op string) error { return fmt.Errorf("unknown comparison operation: %s\n", op) }
)
Functions ¶
func CompareFields ¶
func CompareFields(lhs, rhs interface{}, mapping map[string]*MappedField) (bool, error)
CompareFields checks if ALL fields in lhs struct match the rhs struct. Generally, the lhs is the filter and the rhs is the event.
Types ¶
type ComparisonOperation ¶
type ComparisonOperation string
type Filter ¶
type Filter interface {
// FilterFunc takes an arbitrary event and returns a bool
// representing whether or not we should include this event
FilterFunc(interface{}) bool
// DoFunc performs some action or side effect per arbitrary event
DoFunc(interface{})
}
Filter exports an interface for filtering events
func NewContainerFilter ¶
func NewContainerFilter(ecf *api.ContainerFilter) Filter
NewContainerFilter creates a new ContainerEvent filter
func NewEventFilter ¶
func NewEventFilter(ef *api.EventFilter) Filter
type MappedField ¶
type MappedField struct {
Name string
Op ComparisonOperation
}
Click to show internal directories.
Click to hide internal directories.