2015-10-10 07:29:18 +00:00
|
|
|
package flog
|
|
|
|
|
|
|
|
|
2015-10-10 09:11:19 +00:00
|
|
|
var (
|
|
|
|
singltonDiscardRouter = DiscardRouter{}
|
|
|
|
)
|
2015-10-10 07:29:18 +00:00
|
|
|
|
2015-10-10 09:17:00 +00:00
|
|
|
|
|
|
|
// NewDiscardRouter returns an initialized DiscardRouter.
|
2015-10-10 09:11:19 +00:00
|
|
|
func NewDiscardRouter() *DiscardRouter {
|
|
|
|
return &singltonDiscardRouter
|
2015-10-10 07:29:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-10-10 09:17:00 +00:00
|
|
|
// DiscardRouter is a Router that discards any message (and its context)
|
|
|
|
// it is asked to route.
|
|
|
|
//
|
|
|
|
// Conceptually it is similar to /dev/null
|
2015-10-10 07:29:18 +00:00
|
|
|
type DiscardRouter struct{}
|
|
|
|
|
|
|
|
|
|
|
|
func (router *DiscardRouter) Route(message string, context map[string]interface{}) error {
|
|
|
|
return nil
|
|
|
|
}
|