From 6b38075276132f133d71e4c8da3b713cb2da59ac Mon Sep 17 00:00:00 2001 From: telanflow Date: Wed, 12 Aug 2020 14:32:04 +0800 Subject: [PATCH] fix --- filter.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/filter.go b/filter.go index aeaa3cb..34a2e33 100644 --- a/filter.go +++ b/filter.go @@ -6,12 +6,15 @@ import ( "strings" ) +// Filter is an request interceptor type Filter interface { Match(req *http.Request) bool } +// A wrapper that would convert a function to a Filter interface type type FilterFunc func(req *http.Request) bool +// Filter.Match(req) <=> FilterFunc(req) func (f FilterFunc) Match(req *http.Request) bool { return f(req) }