func (hr *HandlerRegister) Get(key int) (error, []*HandlerWrapper) {
	hr.mu.RLock()
	defer hr.mu.RUnlock()
	if v, ok := hr.hmap[key]; ok {
		return nil, v
	}
	return fmt.Errorf("no handlers for key [%d]", key), nil
}
Get: get message handler
package wxweb
import (
	"fmt"
	"sync"
)
type Handler func(*Session, *ReceivedMessage)
type HandlerWrapper struct {
	handle  Handler
	enabled bool
	name    string
}
func (s *HandlerWrapper) Run(session *Session, msg *ReceivedMessage) {
	if s.enabled {
		s.handle(session, msg)
	}
}
func (s *HandlerWrapper) getName() string {
	return s.name
}
func (s *HandlerWrapper) GetName() string {
	return s.name
}
func (s *HandlerWrapper) GetEnabled() bool {
	return s.enabled
}
func (s *HandlerWrapper) enableHandle() {
	s.enabled = true
	return
}
func (s *HandlerWrapper) disableHandle() {
	s.enabled = false
	return
}
type HandlerRegister struct {
	mu   sync.RWMutex
	hmap map[int][]*HandlerWrapper
}
func CreateHandlerRegister() *HandlerRegister {
	return &HandlerRegister{
		hmap: make(map[int][]*HandlerWrapper),
	}
}
func (hr *HandlerRegister) Add(key int, h Handler, name string) error {
	hr.mu.Lock()
	defer hr.mu.Unlock()
	for _, v := range hr.hmap {
		for _, handle := range v {
			if handle.getName() == name {
				return fmt.Errorf("handler name %s has been registered", name)
			}
		}
	}
	hr.hmap[key] = append(hr.hmap[key], &HandlerWrapper{handle: h, enabled: false, name: name})
	return nil
}