The mega cruft proxy PR (#974)
* 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:
33
server/rpc_event.go
Normal file
33
server/rpc_event.go
Normal file
@@ -0,0 +1,33 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"github.com/micro/go-micro/broker"
|
||||
"github.com/micro/go-micro/transport"
|
||||
)
|
||||
|
||||
// event is a broker event we handle on the server transport
|
||||
type event struct {
|
||||
message *broker.Message
|
||||
}
|
||||
|
||||
func (e *event) Ack() error {
|
||||
// there is no ack support
|
||||
return nil
|
||||
}
|
||||
|
||||
func (e *event) Message() *broker.Message {
|
||||
return e.message
|
||||
}
|
||||
|
||||
func (e *event) Topic() string {
|
||||
return e.message.Header["Micro-Topic"]
|
||||
}
|
||||
|
||||
func newEvent(msg transport.Message) *event {
|
||||
return &event{
|
||||
message: &broker.Message{
|
||||
Header: msg.Header,
|
||||
Body: msg.Body,
|
||||
},
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user