mirror of
https://github.com/go-micro/go-micro.git
synced 2024-12-06 08:16:03 +02:00
d94936f6c9
* v3 * revert plugins * fixup some issues
39 lines
638 B
Go
39 lines
638 B
Go
package server
|
|
|
|
import (
|
|
"github.com/asim/go-micro/v3/broker"
|
|
"github.com/asim/go-micro/v3/transport"
|
|
)
|
|
|
|
// event is a broker event we handle on the server transport
|
|
type event struct {
|
|
err error
|
|
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) Error() error {
|
|
return e.err
|
|
}
|
|
|
|
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,
|
|
},
|
|
}
|
|
}
|