From d5395a65dda152ffeb6e55ce1f1a202f1e45b449 Mon Sep 17 00:00:00 2001 From: Calum Murray Date: Wed, 27 Sep 2023 14:46:20 -0400 Subject: [PATCH] Implement Stringer interface for FilterResult Signed-off-by: Calum Murray --- pkg/eventfilter/filter.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkg/eventfilter/filter.go b/pkg/eventfilter/filter.go index af23a8cc155..da849a56b62 100644 --- a/pkg/eventfilter/filter.go +++ b/pkg/eventfilter/filter.go @@ -57,6 +57,17 @@ func (x FilterResult) Or(y FilterResult) FilterResult { return FailFilter } +func (x FilterResult) String() string { + switch x { + case PassFilter: + return "PassFilter" + case FailFilter: + return "FailFilter" + default: + return "NoFilter" + } +} + // Filter is an interface representing an event filter of the trigger filter type Filter interface { // Filter compute the predicate on the provided event and returns the result of the matching