1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-06-18 22:17:44 +02:00

The mega cruft proxy PR ()

* the mega cruft proxy PR

* Rename broker id

* add protocol=grpc

* fix compilation breaks

* Add the tunnel broker to the network

* fix broker id

* continue to be backwards compatible in the protocol
This commit is contained in:
Asim Aslam
2019-11-25 16:31:43 +00:00
committed by GitHub
parent 252667398e
commit 080363e8c4
23 changed files with 595 additions and 196 deletions

@ -1,8 +1,11 @@
package server
import (
"bytes"
"github.com/micro/go-micro/codec"
"github.com/micro/go-micro/transport"
"github.com/micro/go-micro/util/buf"
)
type rpcRequest struct {
@ -23,6 +26,9 @@ type rpcMessage struct {
topic string
contentType string
payload interface{}
header map[string]string
body []byte
codec codec.NewCodec
}
func (r *rpcRequest) Codec() codec.Reader {
@ -86,3 +92,16 @@ func (r *rpcMessage) Topic() string {
func (r *rpcMessage) Payload() interface{} {
return r.payload
}
func (r *rpcMessage) Header() map[string]string {
return r.header
}
func (r *rpcMessage) Body() []byte {
return r.body
}
func (r *rpcMessage) Codec() codec.Reader {
b := buf.New(bytes.NewBuffer(r.body))
return r.codec(b)
}