Archived
1
0
Fork 0
This repository has been archived on 2024-12-18. You can view files and clone it, but cannot push or open issues or pull requests.
restockbot/filter.go
Julien Riou 244c9f68e7
refactor: move filters out of parser
Filters are now separate structures to include a product or not based
on their own set of properties. For now, include and exclude filters
are supported. They take a regex as an argument and include a product
if the regex matches (or doesn't match) the product name. This commit
will allow us to create new filters on product like on a price range.

Signed-off-by: Julien Riou <julien@riou.xyz>
2021-05-19 17:43:31 +02:00

6 lines
122 B
Go

package main
// Filter interface to include a product based on filters
type Filter interface {
Include(*Product) bool
}