type httpBroker struct { id string //微服务ID address string //主机地址 opts Options //一些配置 mux *http.ServeMux //通过这个监听其他端发送的http请求 c *http.Client //通过这个发送请求到其他端 r registry.Registry sync.RWMutex subscribers map[string][]*httpSubscriber //订阅 running bool exit chan chan error // offline message inbox mtx sync.RWMutex inbox map[string][][]byte //数据缓存 }