From fc02e09eb516f3db0e851fcf7f705c40828d35ad Mon Sep 17 00:00:00 2001 From: Charles Iliya Krempeaux Date: Sat, 10 Oct 2015 13:39:59 -0700 Subject: [PATCH] added to docs --- filtered_router.go | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/filtered_router.go b/filtered_router.go index 92b6969..0e3af8a 100644 --- a/filtered_router.go +++ b/filtered_router.go @@ -20,8 +20,26 @@ package flog // } // } // -// This func will make it so only re-route messages whose context #1 has the key "error" -// and #2 the value of the context at key "key" fits the builtin Go 'error' interface. +// This func will cause the router it only re-route messages whose context #1 has the +// key "error" and #2 where the value of the context at key "key" fits the builtin Go +// 'error' interface. +// +// So, for example, for 'filterError' this would pass: +// +// context := map[string]interface{}{ +// "apple":1, +// "banana":2, +// "cherry":3, +// "error": errors.New("Something bad happened :-("), +// } +// +// But, again for 'filterError', this would NOT pass: +// +// context := map[string]interface{}{ +// "apple":1, +// "banana":2, +// "cherry":3, +// } // // Also, a rather useless example, but a 'filterFn' that would reject all messages (and // contexts) is: