Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateIsRegex ¶
func ValidateIsRegex(fl validator.FieldLevel) bool
ValidateIsRegex implements validator.Func
Types ¶
type Configuration ¶
type Configuration struct {
Rules []*Rule `yaml:"rules" validate:"required,dive"`
}
Configuration configuration containing our rules which are used to filter events
func Load ¶
func Load(rawCfg string) (*Configuration, error)
Load load the configuration from the provided string
func LoadFromSSMAndValidate ¶
func LoadFromSSMAndValidate(ctx context.Context, ssm ssmcache.Cache, path string) (*Configuration, error)
LoadFromSSMAndValidate load the configuration from ssmcache and validate it
func (*Configuration) EvalRules ¶
func (cr *Configuration) EvalRules(evt map[string]interface{}) (bool, error)
EvalRules iterate over all rules and return a match if one evaluates to true
func (*Configuration) Validate ¶
func (cr *Configuration) Validate() error
Validate validate the configuration rules
type Match ¶
type Match struct {
FieldName string `yaml:"field_name" validate:"required,oneof=eventName eventSource awsRegion recipientAccountId"`
Regex string `yaml:"regex" validate:"is-regex"`
}
Match match containing the field to be checked and the REGEX used to match
Click to show internal directories.
Click to hide internal directories.