use typeurl funcs for marshalling anypb.Any

Signed-off-by: Akhil Mohan <akhilerm@gmail.com>
This commit is contained in:
Akhil Mohan
2024-07-08 21:48:31 +05:30
parent cbb2fc78e9
commit 300fd770a0
36 changed files with 109 additions and 164 deletions

View File

@@ -70,7 +70,7 @@ func (p *grpcEventsProxy) Publish(ctx context.Context, topic string, event event
}
req := &api.PublishRequest{
Topic: topic,
Event: protobuf.FromAny(evt),
Event: typeurl.MarshalProto(evt),
}
if _, err := p.client.Publish(ctx, req); err != nil {
return errdefs.FromGRPC(err)
@@ -84,7 +84,7 @@ func (p *grpcEventsProxy) Forward(ctx context.Context, envelope *events.Envelope
Timestamp: protobuf.ToTimestamp(envelope.Timestamp),
Namespace: envelope.Namespace,
Topic: envelope.Topic,
Event: protobuf.FromAny(envelope.Event),
Event: typeurl.MarshalProto(envelope.Event),
},
}
if _, err := p.client.Forward(ctx, req); err != nil {
@@ -151,7 +151,7 @@ func (p *ttrpcEventsProxy) Publish(ctx context.Context, topic string, event even
}
req := &api.PublishRequest{
Topic: topic,
Event: protobuf.FromAny(evt),
Event: typeurl.MarshalProto(evt),
}
if _, err := p.client.Publish(ctx, req); err != nil {
return errdefs.FromGRPC(err)
@@ -165,7 +165,7 @@ func (p *ttrpcEventsProxy) Forward(ctx context.Context, envelope *events.Envelop
Timestamp: protobuf.ToTimestamp(envelope.Timestamp),
Namespace: envelope.Namespace,
Topic: envelope.Topic,
Event: protobuf.FromAny(envelope.Event),
Event: typeurl.MarshalProto(envelope.Event),
},
}
if _, err := p.client.Forward(ctx, req); err != nil {