chore: import upstream snapshot with attribution
govulncheck / govulncheck (push) Has been cancelled
Lint / golangci-lint (push) Has been cancelled
Run Tests / Unit Tests (push) Has been cancelled
Run Tests / Etcd Integration Tests (push) Has been cancelled
Harness (E2E) / Harnesses (mock LLM) (push) Has been cancelled
Harness (E2E) / Provider harnesses (live LLM conformance) (push) Has been cancelled
govulncheck / govulncheck (push) Has been cancelled
Lint / golangci-lint (push) Has been cancelled
Run Tests / Unit Tests (push) Has been cancelled
Run Tests / Etcd Integration Tests (push) Has been cancelled
Harness (E2E) / Harnesses (mock LLM) (push) Has been cancelled
Harness (E2E) / Provider harnesses (live LLM conformance) (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"go-micro.dev/v6/broker"
|
||||
"go-micro.dev/v6/transport"
|
||||
"go-micro.dev/v6/transport/headers"
|
||||
)
|
||||
|
||||
// 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[headers.Message]
|
||||
}
|
||||
|
||||
func newEvent(msg transport.Message) *event {
|
||||
return &event{
|
||||
message: &broker.Message{
|
||||
Header: msg.Header,
|
||||
Body: msg.Body,
|
||||
},
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user