Skip to content

Commit

Permalink
chore: bump to rc.4.
Browse files Browse the repository at this point in the history
Signed-off-by: mikeee <[email protected]>
  • Loading branch information
mikeee committed Jul 22, 2024
1 parent 9675705 commit 927b123
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 23 deletions.
34 changes: 17 additions & 17 deletions client/subscribe.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,23 +104,23 @@ func (s *Subscription) Receive() (*SubscriptionMessage, error) {
return nil, err
}

data := any(event.GetData())
if len(event.GetData()) > 0 {
mediaType, _, err := mime.ParseMediaType(event.GetDataContentType())
data := any(event.GetEventMessage().GetData())
if len(event.GetEventMessage().GetData()) > 0 {
mediaType, _, err := mime.ParseMediaType(event.GetEventMessage().GetDataContentType())

Check warning on line 109 in client/subscribe.go

View check run for this annotation

Codecov / codecov/patch

client/subscribe.go#L107-L109

Added lines #L107 - L109 were not covered by tests
if err == nil {
var v interface{}
switch mediaType {
case "application/json":
if err := json.Unmarshal(event.GetData(), &v); err == nil {
if err := json.Unmarshal(event.GetEventMessage().GetData(), &v); err == nil {

Check warning on line 114 in client/subscribe.go

View check run for this annotation

Codecov / codecov/patch

client/subscribe.go#L114

Added line #L114 was not covered by tests
data = v
}
case "text/plain":
// Assume UTF-8 encoded string.
data = string(event.GetData())
data = string(event.GetEventMessage().GetData())

Check warning on line 119 in client/subscribe.go

View check run for this annotation

Codecov / codecov/patch

client/subscribe.go#L119

Added line #L119 was not covered by tests
default:
if strings.HasPrefix(mediaType, "application/") &&
strings.HasSuffix(mediaType, "+json") {
if err := json.Unmarshal(event.GetData(), &v); err == nil {
if err := json.Unmarshal(event.GetEventMessage().GetData(), &v); err == nil {

Check warning on line 123 in client/subscribe.go

View check run for this annotation

Codecov / codecov/patch

client/subscribe.go#L123

Added line #L123 was not covered by tests
data = v
}
}
Expand All @@ -129,15 +129,15 @@ func (s *Subscription) Receive() (*SubscriptionMessage, error) {
}

topicEvent := &common.TopicEvent{
ID: event.GetId(),
Source: event.GetSource(),
Type: event.GetType(),
SpecVersion: event.GetSpecVersion(),
DataContentType: event.GetDataContentType(),
ID: event.GetEventMessage().GetId(),
Source: event.GetEventMessage().GetSource(),
Type: event.GetEventMessage().GetType(),
SpecVersion: event.GetEventMessage().GetSpecVersion(),
DataContentType: event.GetEventMessage().GetDataContentType(),

Check warning on line 136 in client/subscribe.go

View check run for this annotation

Codecov / codecov/patch

client/subscribe.go#L132-L136

Added lines #L132 - L136 were not covered by tests
Data: data,
RawData: event.GetData(),
Topic: event.GetTopic(),
PubsubName: event.GetPubsubName(),
RawData: event.GetEventMessage().GetData(),
Topic: event.GetEventMessage().GetTopic(),
PubsubName: event.GetEventMessage().GetPubsubName(),

Check warning on line 140 in client/subscribe.go

View check run for this annotation

Codecov / codecov/patch

client/subscribe.go#L138-L140

Added lines #L138 - L140 were not covered by tests
}

return &SubscriptionMessage{
Expand Down Expand Up @@ -181,8 +181,8 @@ func (s *SubscriptionMessage) respond(status pb.TopicEventResponse_TopicEventRes
defer s.sub.lock.Unlock()

return s.sub.stream.Send(&pb.SubscribeTopicEventsRequestAlpha1{
SubscribeTopicEventsRequestType: &pb.SubscribeTopicEventsRequestAlpha1_EventResponse{
EventResponse: &pb.SubscribeTopicEventsResponseAlpha1{
SubscribeTopicEventsRequestType: &pb.SubscribeTopicEventsRequestAlpha1_EventProcessed{
EventProcessed: &pb.SubscribeTopicEventsRequestProcessedAlpha1{

Check warning on line 185 in client/subscribe.go

View check run for this annotation

Codecov / codecov/patch

client/subscribe.go#L184-L185

Added lines #L184 - L185 were not covered by tests
Id: s.ID,
Status: &pb.TopicEventResponse{Status: status},
},
Expand All @@ -206,7 +206,7 @@ func (c *GRPCClient) subscribeInitialRequest(ctx context.Context, opts Subscript

err = stream.Send(&pb.SubscribeTopicEventsRequestAlpha1{
SubscribeTopicEventsRequestType: &pb.SubscribeTopicEventsRequestAlpha1_InitialRequest{
InitialRequest: &pb.SubscribeTopicEventsInitialRequestAlpha1{
InitialRequest: &pb.SubscribeTopicEventsRequestInitialAlpha1{

Check warning on line 209 in client/subscribe.go

View check run for this annotation

Codecov / codecov/patch

client/subscribe.go#L209

Added line #L209 was not covered by tests
PubsubName: opts.PubsubName, Topic: opts.Topic,
Metadata: opts.Metadata, DeadLetterTopic: opts.DeadLetterTopic,
},
Expand Down
2 changes: 1 addition & 1 deletion examples/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ require (
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/dapr/dapr v1.14.0-rc.2 // indirect
github.com/dapr/dapr v1.14.0-rc.4 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/go-chi/chi/v5 v5.1.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
Expand Down
4 changes: 2 additions & 2 deletions examples/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyY
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/dapr/dapr v1.14.0-rc.2 h1:wuXninZLTyokeztCinVIVAc9mpVYJS8QyxecPCLdlY8=
github.com/dapr/dapr v1.14.0-rc.2/go.mod h1:uZMuD9K7y+LKSsQUoSAvv1Yn8Cim9X/9ZQ9XuTobyP8=
github.com/dapr/dapr v1.14.0-rc.4 h1:yyP3tzojgFgfwnJvEt4AQMWyJh9V0xzs4Cm0JXFE8dc=
github.com/dapr/dapr v1.14.0-rc.4/go.mod h1:ahF4VpMDVCPQ7sWQYztE6JlOaBrAhRn/99Uh5JyTWX4=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/dapr/go-sdk
go 1.22.5

require (
github.com/dapr/dapr v1.14.0-rc.2
github.com/dapr/dapr v1.14.0-rc.4
github.com/go-chi/chi/v5 v5.1.0
github.com/golang/mock v1.6.0
github.com/google/uuid v1.6.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/dapr/dapr v1.14.0-rc.2 h1:wuXninZLTyokeztCinVIVAc9mpVYJS8QyxecPCLdlY8=
github.com/dapr/dapr v1.14.0-rc.2/go.mod h1:uZMuD9K7y+LKSsQUoSAvv1Yn8Cim9X/9ZQ9XuTobyP8=
github.com/dapr/dapr v1.14.0-rc.4 h1:yyP3tzojgFgfwnJvEt4AQMWyJh9V0xzs4Cm0JXFE8dc=
github.com/dapr/dapr v1.14.0-rc.4/go.mod h1:ahF4VpMDVCPQ7sWQYztE6JlOaBrAhRn/99Uh5JyTWX4=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/go-chi/chi/v5 v5.1.0 h1:acVI1TYaD+hhedDJ3r54HyA6sExp3HfXq7QWEEY/xMw=
Expand Down

0 comments on commit 927b123

Please sign in to comment.