Skip to content

Commit

Permalink
[#30]: fix: incorrect import for the proto parser
Browse files Browse the repository at this point in the history
  • Loading branch information
rustatian authored Apr 18, 2023
2 parents 4b65356 + e3368cd commit 1a791ab
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 20 deletions.
6 changes: 2 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ module github.com/roadrunner-server/centrifuge/v4
go 1.20

require (
github.com/cenkalti/backoff/v4 v4.2.0
github.com/cenkalti/backoff/v4 v4.2.1
github.com/goccy/go-json v0.10.2
github.com/prometheus/client_golang v1.15.0
github.com/roadrunner-server/errors v1.2.0
github.com/roadrunner-server/goridge/v3 v3.6.2
github.com/roadrunner-server/sdk/v4 v4.2.1
github.com/segmentio/encoding v0.3.6
github.com/stretchr/testify v1.8.2
go.buf.build/grpc/go/roadrunner-server/api v1.4.39
go.uber.org/zap v1.24.0
google.golang.org/grpc v1.54.0
google.golang.org/protobuf v1.30.0
)

require (
Expand All @@ -31,7 +31,6 @@ require (
github.com/prometheus/procfs v0.9.0 // indirect
github.com/roadrunner-server/tcplisten v1.3.0 // indirect
github.com/rogpeppe/go-internal v1.9.0 // indirect
github.com/segmentio/asm v1.2.0 // indirect
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
github.com/tklauser/go-sysconf v0.3.11 // indirect
github.com/tklauser/numcpus v0.6.0 // indirect
Expand All @@ -43,6 +42,5 @@ require (
golang.org/x/sys v0.7.0 // indirect
golang.org/x/text v0.9.0 // indirect
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
10 changes: 2 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03
github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/cenkalti/backoff/v4 v4.2.0 h1:HN5dHm3WBOgndBH6E8V0q2jIYIR3s9yglV8k/+MN3u4=
github.com/cenkalti/backoff/v4 v4.2.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=
github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
Expand Down Expand Up @@ -63,11 +63,6 @@ github.com/roadrunner-server/tcplisten v1.3.0 h1:VDd6IbP8oIjm5vKvMVozeZgeHgOcoP0
github.com/roadrunner-server/tcplisten v1.3.0/go.mod h1:VR6Ob5am0oEuLMOeLiVvQxG9ShykAEgrlvZddX8EfoU=
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/segmentio/asm v1.1.3/go.mod h1:Ld3L4ZXGNcSLRg4JBsZ3//1+f/TjYl0Mzen/DQy1EJg=
github.com/segmentio/asm v1.2.0 h1:9BQrFxC+YOHJlTlHGkTrFWf59nbL3XnCoFLTwDCI7ys=
github.com/segmentio/asm v1.2.0/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs=
github.com/segmentio/encoding v0.3.6 h1:E6lVLyDPseWEulBmCmAKPanDd3jiyGDo5gMcugCRwZQ=
github.com/segmentio/encoding v0.3.6/go.mod h1:n0JeuIqEQrQoPDGsjo8UNd1iA0U8d8+oHAA4E3G3OxM=
github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI=
github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
Expand Down Expand Up @@ -113,7 +108,6 @@ golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20211110154304-99a53858aa08/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU=
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
Expand Down
15 changes: 7 additions & 8 deletions proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
"github.com/goccy/go-json"
"github.com/roadrunner-server/goridge/v3/pkg/frame"
"github.com/roadrunner-server/sdk/v4/payload"
"github.com/segmentio/encoding/proto"
centrifugov1 "go.buf.build/grpc/go/roadrunner-server/api/centrifugo/proxy/v1"
"go.uber.org/zap"
"google.golang.org/grpc/metadata"
"google.golang.org/protobuf/proto"
)

type Proxy struct {
Expand All @@ -30,7 +30,6 @@ func (p *Proxy) Connect(ctx context.Context, request *centrifugov1.ConnectReques
if err != nil {
return nil, err
}

pld := &payload.Payload{
Context: meta,
Body: data,
Expand All @@ -46,7 +45,7 @@ func (p *Proxy) Connect(ctx context.Context, request *centrifugov1.ConnectReques

cr := &centrifugov1.ConnectResponse{}

err = proto.Unmarshal(resp.Body, &cr)
err = proto.Unmarshal(resp.Body, cr)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -84,7 +83,7 @@ func (p *Proxy) Refresh(ctx context.Context, request *centrifugov1.RefreshReques

rr := &centrifugov1.RefreshResponse{}

err = proto.Unmarshal(resp.Body, &rr)
err = proto.Unmarshal(resp.Body, rr)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -122,7 +121,7 @@ func (p *Proxy) Subscribe(ctx context.Context, request *centrifugov1.SubscribeRe

sr := &centrifugov1.SubscribeResponse{}

err = proto.Unmarshal(resp.Body, &sr)
err = proto.Unmarshal(resp.Body, sr)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -160,7 +159,7 @@ func (p *Proxy) Publish(ctx context.Context, request *centrifugov1.PublishReques

pr := &centrifugov1.PublishResponse{}

err = proto.Unmarshal(resp.Body, &pr)
err = proto.Unmarshal(resp.Body, pr)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -198,7 +197,7 @@ func (p *Proxy) RPC(ctx context.Context, request *centrifugov1.RPCRequest) (*cen

rresp := &centrifugov1.RPCResponse{}

err = proto.Unmarshal(resp.Body, &rresp)
err = proto.Unmarshal(resp.Body, rresp)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -237,7 +236,7 @@ func (p *Proxy) SubRefresh(ctx context.Context, request *centrifugov1.SubRefresh

rresp := &centrifugov1.SubRefreshResponse{}

err = proto.Unmarshal(resp.Body, &rresp)
err = proto.Unmarshal(resp.Body, rresp)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 1a791ab

Please sign in to comment.