@@ -35,7 +35,6 @@ import (
3535 cehttp "github.com/cloudevents/sdk-go/v2/protocol/http"
3636 "github.com/cloudevents/sdk-go/v2/types"
3737 recovery "github.com/grpc-ecosystem/go-grpc-middleware/recovery"
38- vanuspb "github.com/linkall-labs/sdk/proto/pkg/vanus"
3938 eb "github.com/linkall-labs/vanus/client"
4039 "github.com/linkall-labs/vanus/client/pkg/api"
4140 "github.com/linkall-labs/vanus/client/pkg/option"
@@ -95,7 +94,7 @@ type Config struct {
9594}
9695
9796var (
98- _ vanuspb. ClientServer = & ControllerProxy {}
97+ _ proxypb. StoreProxyServer = & ControllerProxy {}
9998)
10099
101100type ackCallback func (bool )
@@ -108,12 +107,12 @@ type message struct {
108107type subscribeCache struct {
109108 sequenceID uint64
110109 subscriptionID string
111- subscribeStream vanuspb. Client_SubscribeServer
110+ subscribeStream proxypb. StoreProxy_SubscribeServer
112111 acks sync.Map
113112 eventc chan message
114113}
115114
116- func newSubscribeCache (subscriptionID string , stream vanuspb. Client_SubscribeServer ) * subscribeCache {
115+ func newSubscribeCache (subscriptionID string , stream proxypb. StoreProxy_SubscribeServer ) * subscribeCache {
117116 return & subscribeCache {
118117 sequenceID : 0 ,
119118 subscriptionID : subscriptionID ,
@@ -127,7 +126,7 @@ func (s *subscribeCache) ch() chan message {
127126 return s .eventc
128127}
129128
130- func (s * subscribeCache ) stream () vanuspb. Client_SubscribeServer {
129+ func (s * subscribeCache ) stream () proxypb. StoreProxy_SubscribeServer {
131130 return s .subscribeStream
132131}
133132
@@ -144,7 +143,7 @@ type ControllerProxy struct {
144143 cache sync.Map
145144}
146145
147- func (cp * ControllerProxy ) Publish (ctx context.Context , req * vanuspb .PublishRequest ) (* emptypb.Empty , error ) {
146+ func (cp * ControllerProxy ) Publish (ctx context.Context , req * proxypb .PublishRequest ) (* emptypb.Empty , error ) {
148147 if req .EventbusName == "" {
149148 return nil , v2 .NewHTTPResult (http .StatusBadRequest , "invalid eventbus name" )
150149 }
@@ -213,7 +212,7 @@ func (cp *ControllerProxy) Publish(ctx context.Context, req *vanuspb.PublishRequ
213212 return & emptypb.Empty {}, nil
214213}
215214
216- func (cp * ControllerProxy ) Subscribe (req * vanuspb .SubscribeRequest , stream vanuspb. Client_SubscribeServer ) error {
215+ func (cp * ControllerProxy ) Subscribe (req * proxypb .SubscribeRequest , stream proxypb. StoreProxy_SubscribeServer ) error {
217216 _ctx , span := cp .tracer .Start (context .Background (), "Subscribe" )
218217 defer span .End ()
219218
@@ -291,7 +290,7 @@ func (cp *ControllerProxy) Subscribe(req *vanuspb.SubscribeRequest, stream vanus
291290 log .KeyError : err ,
292291 "eventpb" : eventpb .String (),
293292 })
294- err = subscribe .stream ().Send (& vanuspb .SubscribeResponse {
293+ err = subscribe .stream ().Send (& proxypb .SubscribeResponse {
295294 SequenceId : msg .sequenceID ,
296295 Events : & cloudevents.CloudEventBatch {
297296 Events : []* cloudevents.CloudEvent {eventpb },
@@ -311,7 +310,7 @@ func (cp *ControllerProxy) Subscribe(req *vanuspb.SubscribeRequest, stream vanus
311310 }
312311}
313312
314- func (cp * ControllerProxy ) Ack (stream vanuspb. Client_AckServer ) error {
313+ func (cp * ControllerProxy ) Ack (stream proxypb. StoreProxy_AckServer ) error {
315314 _ctx , span := cp .tracer .Start (context .Background (), "Ack" )
316315 defer span .End ()
317316 for {
@@ -484,7 +483,7 @@ func (cp *ControllerProxy) Start() error {
484483 }
485484
486485 proxypb .RegisterControllerProxyServer (cp .grpcSrv , cp )
487- vanuspb . RegisterClientServer (cp .grpcSrv , cp )
486+ proxypb . RegisterStoreProxyServer (cp .grpcSrv , cp )
488487
489488 proxyListen , err := net .Listen ("tcp" , fmt .Sprintf (":%d" , cp .cfg .ProxyPort ))
490489 if err != nil {
0 commit comments