mirror of https://github.com/status-im/consul.git
Merge pull request #8893 from hashicorp/dnephin/add-steps-to-subscribe-tests
subscribe: add steps to long test cases, and add new cases for converting Events
This commit is contained in:
commit
0d653b184b
|
@ -83,7 +83,7 @@ func (h *Server) Subscribe(req *pbsubscribe.SubscribeRequest, serverStream pbsub
|
|||
}
|
||||
|
||||
elog.Trace(event)
|
||||
e := newEventFromStreamEvent(req, event)
|
||||
e := newEventFromStreamEvent(req.Topic, event)
|
||||
if err := serverStream.Send(e); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -139,10 +139,10 @@ func filterByAuth(authz acl.Authorizer, event stream.Event) (stream.Event, bool)
|
|||
return event.Filter(fn)
|
||||
}
|
||||
|
||||
func newEventFromStreamEvent(req *pbsubscribe.SubscribeRequest, event stream.Event) *pbsubscribe.Event {
|
||||
func newEventFromStreamEvent(topic pbsubscribe.Topic, event stream.Event) *pbsubscribe.Event {
|
||||
e := &pbsubscribe.Event{
|
||||
Topic: req.Topic,
|
||||
Key: req.Key,
|
||||
Topic: topic,
|
||||
Key: event.Key,
|
||||
Index: event.Index,
|
||||
}
|
||||
switch {
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -5,9 +5,10 @@ import (
|
|||
"fmt"
|
||||
"regexp"
|
||||
|
||||
"github.com/hashicorp/consul/agent/structs"
|
||||
"github.com/hashicorp/go-msgpack/codec"
|
||||
"github.com/hashicorp/go-uuid"
|
||||
|
||||
"github.com/hashicorp/consul/agent/structs"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
Loading…
Reference in New Issue