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