added to docs

master
Charles Iliya Krempeaux 2015-10-10 13:39:59 -07:00
parent cb7d7586b8
commit fc02e09eb5
1 changed files with 20 additions and 2 deletions

View File

@ -20,8 +20,26 @@ package flog
// } // }
// } // }
// //
// This func will make it so only re-route messages whose context #1 has the key "error" // This func will cause the router it only re-route messages whose context #1 has the
// and #2 the value of the context at key "key" fits the builtin Go 'error' interface. // 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 // Also, a rather useless example, but a 'filterFn' that would reject all messages (and
// contexts) is: // contexts) is: