Documentation ¶
Index ¶
- func NetworkContains(ip net.IP, networks ...string) (bool, error)
- type And
- type ClusterAvailable
- type Condition
- type Config
- type ConsumerHasLag
- type Context
- type Equals
- type Exists
- type Fields
- type InArray
- type Matcher
- type MutableValueMap
- type Network
- type Not
- type Or
- type Prefix
- type QueueHasLag
- type Range
- type RemovableValueMap
- type Suffix
- type ValuesMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NetworkContains ¶
NetworkContains returns true if the given IP is contained by any of the networks. networks can be a CIDR or any of these named networks:
- loopback
- global_unicast
- unicast
- link_local_unicast
- interface_local_multicast
- link_local_multicast
- multicast
- unspecified
- private
- public
Types ¶
type And ¶
type And []Condition
And is a compound condition that combines multiple conditions with logical AND.
func NewAndCondition ¶
NewAndCondition builds this condition from a slice of Condition objects.
type ClusterAvailable ¶
type ClusterAvailable []string
func NewClusterAvailableCondition ¶
func NewClusterAvailableCondition(names []string) ClusterAvailable
func (ClusterAvailable) Check ¶
func (c ClusterAvailable) Check(event ValuesMap) bool
func (ClusterAvailable) String ¶
func (c ClusterAvailable) String() string
type Condition ¶
Condition is the interface for all defined conditions
func NewCondition ¶
NewCondition takes a Config and turns it into a real Condition
func NewConditionList ¶
NewConditionList takes a slice of Config objects and turns them into real Condition objects.
type Config ¶
type Config struct { Equals *Fields `config:"equals"` Contains *Fields `config:"contains"` Prefix map[string]interface{} `config:"prefix"` Suffix map[string]interface{} `config:"suffix"` Regexp *Fields `config:"regexp"` Range *Fields `config:"range"` QueueHasLag []string `config:"queue_has_lag"` ConsumerHasLag *Fields `config:"consumer_has_lag"` ClusterAvailable []string `config:"cluster_available"` Exists []string `config:"exists"` Network map[string]interface{} `config:"network"` OR []Config `config:"or"` AND []Config `config:"and"` NOT *Config `config:"not"` IN map[string]interface{} `config:"in"` }
Config represents a configuration for a condition, as you would find it in the config files.
type ConsumerHasLag ¶
func NewConsumerHasLagCondition ¶
func NewConsumerHasLagCondition(fields map[string]interface{}) (c ConsumerHasLag)
func (ConsumerHasLag) Check ¶
func (c ConsumerHasLag) Check(event ValuesMap) bool
func (ConsumerHasLag) Name ¶
func (c ConsumerHasLag) Name() string
func (ConsumerHasLag) String ¶
func (c ConsumerHasLag) String() string
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func (*Context) AddContext ¶
type Equals ¶
type Equals map[string]equalsValue
Equals is a Condition for testing string equality.
func NewEqualsCondition ¶
NewEqualsCondition builds a new Equals using the given configuration of string equality checks.
type Exists ¶
type Exists []string
Exists is a Condition for checking field existence.
func NewExistsCondition ¶
NewExistsCondition builds a new Exists checking the given list of fields.
type Fields ¶
type Fields struct {
// contains filtered or unexported fields
}
Fields represents an arbitrary map in a config file.
type Matcher ¶
type Matcher struct {
// contains filtered or unexported fields
}
Matcher is a Condition that works with beat's internal notion of a string matcher.
func NewMatcherCondition ¶
func NewMatcherCondition( name string, fields map[string]interface{}, compile func(string) (match.Matcher, error), ) (condition Matcher, err error)
NewMatcherCondition builds a new Matcher with the given human name using the provided config fields. The compiler function will take those fields and compile them.
type MutableValueMap ¶
type Network ¶
type Network struct {
// contains filtered or unexported fields
}
Network is a condition that tests if an IP address is in a network range.
func NewNetworkCondition ¶
NewNetworkCondition builds a new Network using the given configuration.
type Not ¶
type Not struct {
// contains filtered or unexported fields
}
Not is a condition that negates its inner condition.
func NewNotCondition ¶
NewNotCondition builds a new Not condition that negates the provided Condition.
type Or ¶
type Or []Condition
Or is a compound condition that combines multiple conditions with logical OR.
func NewOrCondition ¶
NewOrCondition builds this condition from a slice of Condition objects.
type Prefix ¶
Prefix is a Condition for checking field is prefix with some specify string.
func NewPrefixCondition ¶
type QueueHasLag ¶
type QueueHasLag []string
func NewQueueHasLagCondition ¶
func NewQueueHasLagCondition(queueName []string) QueueHasLag
func (QueueHasLag) Check ¶
func (c QueueHasLag) Check(event ValuesMap) bool
func (QueueHasLag) String ¶
func (c QueueHasLag) String() string
type Range ¶
type Range map[string]rangeValue
Range is a Condition type for checking against ranges.
func NewRangeCondition ¶
NewRangeCondition builds a new Range from a map of ranges.