func ByType(e eventtypes.Message) string {
	return e.Type
}
ByType is a qualify function based on message type.
package events
import (
	"sync"
	eventtypes "github.com/docker/engine-api/types/events"
)
func NewHandler(fun func(eventtypes.Message) string) *Handler {
	return &Handler{
		keyFunc:  fun,
		handlers: make(map[string]func(eventtypes.Message)),
	}
}