diff --git a/filter_exclude.go b/filter_exclude.go index 3aa1ae3..765ef7a 100644 --- a/filter_exclude.go +++ b/filter_exclude.go @@ -6,10 +6,12 @@ import ( log "github.com/sirupsen/logrus" ) +// ExcludeFilter struct to store the compiled regex used for the exclusion type ExcludeFilter struct { regex *regexp.Regexp } +// NewExcludeFilter to create an ExcludeFilter func NewExcludeFilter(regex string) (*ExcludeFilter, error) { var err error var compiledRegex *regexp.Regexp @@ -25,7 +27,7 @@ func NewExcludeFilter(regex string) (*ExcludeFilter, error) { return &ExcludeFilter{regex: compiledRegex}, nil } -// Filter excludes product with name matching the regex +// Include returns false when the product name matches the regex // implements the Filter interface func (f *ExcludeFilter) Include(product *Product) bool { if f.regex == nil { diff --git a/filter_include.go b/filter_include.go index 1d45aa1..520d6e3 100644 --- a/filter_include.go +++ b/filter_include.go @@ -6,10 +6,12 @@ import ( log "github.com/sirupsen/logrus" ) +// IncludeFilter struct to store the compiled regex used for the inclusion type IncludeFilter struct { regex *regexp.Regexp } +// NewIncludeFilter to create an IncludeFilter func NewIncludeFilter(regex string) (*IncludeFilter, error) { var err error var compiledRegex *regexp.Regexp @@ -25,7 +27,7 @@ func NewIncludeFilter(regex string) (*IncludeFilter, error) { return &IncludeFilter{regex: compiledRegex}, nil } -// Filter includes product with name matching the regex +// Include returns treue when the product name matches the regex // implements the Filter interface func (f *IncludeFilter) Include(product *Product) bool { if f.regex == nil {