func (c *CommandRegister) Add(command interface{}, handler CommandHandle) {
	c.Lock()
	defer c.Unlock()
	rawType := reflect.TypeOf(command)
	name := rawType.String()
	c.registry[name] = handler
}
Add a new command with its handler
package eventhus
import (
	"fmt"
	"reflect"
	"sync"
)
type CommandHandle interface {
	Handle(command Command) error
}
type CommandHandlerRegister interface {
	Add(command interface{}, handler CommandHandle)
	Get(command interface{}) (CommandHandle, error)
}
type CommandRegister struct {
	sync.RWMutex
	registry map[string]CommandHandle
}
func NewCommandRegister() *CommandRegister {
	return &CommandRegister{
		registry: make(map[string]CommandHandle),
	}
}