Make ListFilter an interface
authorMaciej Wereski <m.wereski@partner.samsung.com>
Wed, 20 Sep 2017 14:55:47 +0000 (16:55 +0200)
committerMaciej Wereski <m.wereski@partner.samsung.com>
Thu, 5 Oct 2017 10:39:09 +0000 (12:39 +0200)
Currently ListFilter is defined as a structure. We don't know
how such structure should look like. Moreover it will be probably
changed to match new uses. We're not interested in the data provided,
but what functionality it provides. Thus change it to simple interface.

Change-Id: Ib297345d2f188fc941cf04794f03ec5250501474
Signed-off-by: Maciej Wereski <m.wereski@partner.samsung.com>
Reviewed-on: https://mcdsrvbld02.digital.local/review/49471

boruta.go

index 726c9bc..4e48581 100644 (file)
--- a/boruta.go
+++ b/boruta.go
@@ -119,7 +119,10 @@ type WorkerInfo struct {
 }
 
 // ListFilter is used to filter Requests in the Queue.
-type ListFilter struct{}
+type ListFilter interface {
+       // Match tells if request matches the filter.
+       Match(req *ReqInfo) bool
+}
 
 // Requests defines an interaction of a user with Requests Queue.
 type Requests interface {