diff --git a/internal/gateway/proxy/proxy.go b/internal/gateway/proxy/proxy.go index fffdf18c5..a9f2b87c3 100644 --- a/internal/gateway/proxy/proxy.go +++ b/internal/gateway/proxy/proxy.go @@ -18,22 +18,26 @@ import ( "context" "encoding/base64" "encoding/binary" - "errors" "fmt" "net" "runtime/debug" "sync" + v2 "github.com/cloudevents/sdk-go/v2" recovery "github.com/grpc-ecosystem/go-grpc-middleware/recovery" eb "github.com/linkall-labs/vanus/client" "github.com/linkall-labs/vanus/client/pkg/api" "github.com/linkall-labs/vanus/client/pkg/option" "github.com/linkall-labs/vanus/client/pkg/policy" + "github.com/linkall-labs/vanus/internal/convert" "github.com/linkall-labs/vanus/internal/primitive/interceptor/errinterceptor" "github.com/linkall-labs/vanus/internal/primitive/vanus" + "github.com/linkall-labs/vanus/internal/trigger/filter" + "github.com/linkall-labs/vanus/internal/trigger/transform" "github.com/linkall-labs/vanus/observability/log" "github.com/linkall-labs/vanus/observability/tracing" "github.com/linkall-labs/vanus/pkg/cluster" + "github.com/linkall-labs/vanus/pkg/errors" ctrlpb "github.com/linkall-labs/vanus/proto/pkg/controller" proxypb "github.com/linkall-labs/vanus/proto/pkg/proxy" "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" @@ -231,6 +235,57 @@ func (cp *ControllerProxy) GetEvent(ctx context.Context, }, nil } +func (cp *ControllerProxy) ValidateSubscription(ctx context.Context, + req *proxypb.ValidateSubscriptionRequest) (*proxypb.ValidateSubscriptionResponse, error) { + if req.GetEvent() == nil { + res, err := cp.GetEvent(ctx, &proxypb.GetEventRequest{ + Eventbus: req.Eventbus, + EventlogId: req.Eventlog, + Offset: req.Offset, + Number: 1, + }) + if err != nil { + return nil, err + } + req.Event = res.GetEvents()[0].Value + } + + e := v2.NewEvent() + if err := e.UnmarshalJSON(req.GetEvent()); err != nil { + return nil, errors.ErrInvalidRequest.WithMessage("failed to unmarshall event to CloudEvent").Wrap(err) + } + + if req.GetSubscription() == nil { + sub, err := cp.GetSubscription(ctx, &ctrlpb.GetSubscriptionRequest{Id: req.SubscriptionId}) + if err != nil { + return nil, err + } + req.Subscription = &ctrlpb.SubscriptionRequest{ + Filters: sub.Filters, + Transformer: sub.Transformer, + } + } + + sub := convert.FromPbSubscriptionRequest(req.Subscription) + res := &proxypb.ValidateSubscriptionResponse{} + f := filter.GetFilter(sub.Filters) + r := f.Filter(e) + if !r { + return res, nil + } + + res.FilterResult = true + t := transform.NewTransformer(sub.Transformer) + if t != nil { + if err := t.Execute(&e); err != nil { + return nil, errors.ErrTransformInputParse.Wrap(err) + } + } + data, _ := e.MarshalJSON() + res.TransformerResult = data + return res, nil +} + // getByEventID why added this? can it be deleted? func (cp *ControllerProxy) getByEventID(ctx context.Context, req *proxypb.GetEventRequest) (*proxypb.GetEventResponse, error) { diff --git a/internal/gateway/proxy/proxy_test.go b/internal/gateway/proxy/proxy_test.go index 72ad0b400..1d2a983c8 100644 --- a/internal/gateway/proxy/proxy_test.go +++ b/internal/gateway/proxy/proxy_test.go @@ -18,6 +18,7 @@ import ( stdCtx "context" "encoding/base64" "encoding/binary" + stdJson "encoding/json" "fmt" "testing" @@ -26,9 +27,14 @@ import ( "github.com/linkall-labs/vanus/client" "github.com/linkall-labs/vanus/client/pkg/api" "github.com/linkall-labs/vanus/client/pkg/policy" + "github.com/linkall-labs/vanus/internal/convert" + "github.com/linkall-labs/vanus/internal/primitive" "github.com/linkall-labs/vanus/internal/primitive/vanus" + ctrlpb "github.com/linkall-labs/vanus/proto/pkg/controller" + metapb "github.com/linkall-labs/vanus/proto/pkg/meta" proxypb "github.com/linkall-labs/vanus/proto/pkg/proxy" . "github.com/smartystreets/goconvey/convey" + "github.com/tidwall/gjson" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" "google.golang.org/protobuf/types/known/emptypb" @@ -250,3 +256,129 @@ func TestControllerProxy_LookLookupOffset(t *testing.T) { }) } + +func TestControllerProxy_ValidateSubscription(t *testing.T) { + Convey("test ValidateSubscription", t, func() { + cp := NewControllerProxy(Config{ + Endpoints: []string{"127.0.0.1:20001", + "127.0.0.1:20002", "127.0.0.1:20003"}, + CloudEventReceiverPort: 18080, + ProxyPort: 18082, + Credentials: insecure.NewCredentials(), + }) + + data := `{ + "id":"13b719a4-ada9-436a-9fb1-fc2bc82dc647", + "source":"prometheus", + "specversion":"1.0", + "type":"naive-http-request", + "datacontenttype":"application/json", + "subject":"operator", + "time":"2022-12-12T08:31:54.936803649Z", + "data":{"body":{"alerts":[{"annotations":{"feishuUrls":[{"URL":"https://open.feishu.cn/open-apis/bot/v2/hook/xxxxx", +"signature":"yyyy"},{"URL":"https://open.feishu.cn/open-apis/bot/v2/hook/yyyyy","signature":""}, +{"URL":"https://open.feishu.cn/open-apis/bot/v2/hook/zzzzz","signature":"zzzz"}]}, +"labels":{"forward":"test-server","severity":"P1"},"startsAt":"2022-12-12T07:55:24.893471163Z","status":"resolved"}], +"commonLabels":{"cluster":"test","forward":"test-server","groups":"test-bot","severity":"P1"}}, +"headers":{"Content-Type":"application/json","Host":"webhook-source.vanus:80","User-Agent":"Alertmanager/0.24.0"}, +"method":"POST","query_args":{"source":"prometheus","subject":"operator"}} +}` + e := v2.NewEvent() + _ = e.UnmarshalJSON([]byte(data)) + + trans := `{"pipeline":[{"command":["create","$.xvfeishuservice","bot"]},{"command":["create", + "$.xvfeishumsgtype","interactive"]},{"command":["join","$.xvfeishuboturls",",", + "$.data.body.alerts[0].annotations.feishuUrls[:].URL"]},{"command":["join", + "$.xvfeishubotsigns",",","$.data.body.alerts[0].annotations.feishuUrls[:].signature"]}]}` + var _transformer *primitive.Transformer + _ = stdJson.Unmarshal([]byte(trans), &_transformer) + transPb := convert.ToPbTransformer(_transformer) + s := &ctrlpb.SubscriptionRequest{ + Filters: []*metapb.Filter{ + { + Exact: map[string]string{ + "source": "test", + }, + }, + }, + Transformer: transPb, + } + Convey("test with event and subscription", func() { + ctx := stdCtx.Background() + res, err := cp.ValidateSubscription(ctx, &proxypb.ValidateSubscriptionRequest{ + Event: []byte(data), + Subscription: s, + }) + So(err, ShouldBeNil) + So(res.FilterResult, ShouldBeFalse) + + s.Filters = []*metapb.Filter{ + { + Exact: map[string]string{ + "source": "prometheus", + }, + }, + } + res, err = cp.ValidateSubscription(ctx, &proxypb.ValidateSubscriptionRequest{ + Event: []byte(data), + Subscription: s, + }) + So(err, ShouldBeNil) + So(res.FilterResult, ShouldBeTrue) + result := gjson.ParseBytes(res.TransformerResult) + urls := "https://open.feishu.cn/open-apis/bot/v2/hook/xxxxx,https://open" + + ".feishu.cn/open-apis/bot/v2/hook/yyyyy,https://open.feishu.cn/open-apis/bot/v2/hook/zzzzz" + So(result.Get("xvfeishumsgtype").String(), ShouldEqual, "interactive") + So(result.Get("xvfeishuboturls").String(), ShouldEqual, urls) + So(result.Get("xvfeishubotsigns").String(), ShouldEqual, "yyyy,,zzzz") + So(result.Get("xvfeishuservice").String(), ShouldEqual, "bot") + }) + + ctrl := gomock.NewController(t) + cli := client.NewMockClient(ctrl) + cp.client = cli + eb := api.NewMockEventbus(ctrl) + mockTriggerCtrl := ctrlpb.NewMockTriggerControllerClient(ctrl) + cp.triggerCtrl = mockTriggerCtrl + Convey("test with eventlog, offset and subscriptionID", func() { + ctx := stdCtx.Background() + + // mock eventbus + cli.EXPECT().Eventbus(gomock.Any(), gomock.Any()).Times(2).Return(eb) + eb.EXPECT().ListLog(gomock.Any()).Times(1).Return([]api.Eventlog{nil}, nil) + rd := api.NewMockBusReader(ctrl) + eb.EXPECT().Reader(gomock.Any(), gomock.Any(), gomock.Any()).Times(1).Return(rd) + rd.EXPECT().Read(gomock.Any()).Times(1).Return([]*v2.Event{&e}, int64(0), uint64(0), nil) + + // mock subscription + pb := &metapb.Subscription{ + Filters: []*metapb.Filter{ + { + Exact: map[string]string{ + "source": "prometheus", + }, + }, + }, + Transformer: s.Transformer, + } + mockTriggerCtrl.EXPECT().GetSubscription(ctx, gomock.Any()).Times(1).Return(pb, nil) + + res, err := cp.ValidateSubscription(ctx, &proxypb.ValidateSubscriptionRequest{ + SubscriptionId: vanus.NewTestID().Uint64(), + Eventbus: "test", + Eventlog: vanus.NewTestID().Uint64(), + Offset: 123, + }) + + So(err, ShouldBeNil) + So(res.FilterResult, ShouldBeTrue) + result := gjson.ParseBytes(res.TransformerResult) + urls := "https://open.feishu.cn/open-apis/bot/v2/hook/xxxxx,https://open" + + ".feishu.cn/open-apis/bot/v2/hook/yyyyy,https://open.feishu.cn/open-apis/bot/v2/hook/zzzzz" + So(result.Get("xvfeishumsgtype").String(), ShouldEqual, "interactive") + So(result.Get("xvfeishuboturls").String(), ShouldEqual, urls) + So(result.Get("xvfeishubotsigns").String(), ShouldEqual, "yyyy,,zzzz") + So(result.Get("xvfeishuservice").String(), ShouldEqual, "bot") + }) + }) +} diff --git a/proto/pkg/proxy/proxy.pb.go b/proto/pkg/proxy/proxy.pb.go index 020f05548..051d394b4 100644 --- a/proto/pkg/proxy/proxy.pb.go +++ b/proto/pkg/proxy/proxy.pb.go @@ -333,6 +333,148 @@ func (x *ClusterInfoResponse) GetProxyPort() int64 { return 0 } +type ValidateSubscriptionRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Eventbus string `protobuf:"bytes,1,opt,name=eventbus,proto3" json:"eventbus,omitempty"` + Eventlog uint64 `protobuf:"varint,2,opt,name=eventlog,proto3" json:"eventlog,omitempty"` + Offset int64 `protobuf:"varint,3,opt,name=offset,proto3" json:"offset,omitempty"` + SubscriptionId uint64 `protobuf:"varint,4,opt,name=subscription_id,json=subscriptionId,proto3" json:"subscription_id,omitempty"` + Event []byte `protobuf:"bytes,100,opt,name=event,proto3" json:"event,omitempty"` + Subscription *controller.SubscriptionRequest `protobuf:"bytes,101,opt,name=subscription,proto3" json:"subscription,omitempty"` +} + +func (x *ValidateSubscriptionRequest) Reset() { + *x = ValidateSubscriptionRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_proxy_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ValidateSubscriptionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateSubscriptionRequest) ProtoMessage() {} + +func (x *ValidateSubscriptionRequest) ProtoReflect() protoreflect.Message { + mi := &file_proxy_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidateSubscriptionRequest.ProtoReflect.Descriptor instead. +func (*ValidateSubscriptionRequest) Descriptor() ([]byte, []int) { + return file_proxy_proto_rawDescGZIP(), []int{5} +} + +func (x *ValidateSubscriptionRequest) GetEventbus() string { + if x != nil { + return x.Eventbus + } + return "" +} + +func (x *ValidateSubscriptionRequest) GetEventlog() uint64 { + if x != nil { + return x.Eventlog + } + return 0 +} + +func (x *ValidateSubscriptionRequest) GetOffset() int64 { + if x != nil { + return x.Offset + } + return 0 +} + +func (x *ValidateSubscriptionRequest) GetSubscriptionId() uint64 { + if x != nil { + return x.SubscriptionId + } + return 0 +} + +func (x *ValidateSubscriptionRequest) GetEvent() []byte { + if x != nil { + return x.Event + } + return nil +} + +func (x *ValidateSubscriptionRequest) GetSubscription() *controller.SubscriptionRequest { + if x != nil { + return x.Subscription + } + return nil +} + +type ValidateSubscriptionResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + FilterResult bool `protobuf:"varint,1,opt,name=filter_result,json=filterResult,proto3" json:"filter_result,omitempty"` + TransformerResult []byte `protobuf:"bytes,2,opt,name=transformer_result,json=transformerResult,proto3" json:"transformer_result,omitempty"` +} + +func (x *ValidateSubscriptionResponse) Reset() { + *x = ValidateSubscriptionResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_proxy_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ValidateSubscriptionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateSubscriptionResponse) ProtoMessage() {} + +func (x *ValidateSubscriptionResponse) ProtoReflect() protoreflect.Message { + mi := &file_proxy_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidateSubscriptionResponse.ProtoReflect.Descriptor instead. +func (*ValidateSubscriptionResponse) Descriptor() ([]byte, []int) { + return file_proxy_proto_rawDescGZIP(), []int{6} +} + +func (x *ValidateSubscriptionResponse) GetFilterResult() bool { + if x != nil { + return x.FilterResult + } + return false +} + +func (x *ValidateSubscriptionResponse) GetTransformerResult() []byte { + if x != nil { + return x.TransformerResult + } + return nil +} + var File_proxy_proto protoreflect.FileDescriptor var file_proxy_proto_rawDesc = []byte{ @@ -381,95 +523,126 @@ var file_proxy_proto_rawDesc = []byte{ 0x73, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x50, 0x6f, 0x72, 0x74, 0x32, 0xbd, 0x0a, 0x0a, - 0x0f, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x78, 0x79, - 0x12, 0x5f, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, - 0x75, 0x73, 0x12, 0x2f, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, - 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, - 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, - 0x73, 0x12, 0x46, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x42, 0x75, 0x73, 0x12, 0x1c, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, - 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, - 0x73, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x49, 0x0a, 0x0b, 0x47, 0x65, 0x74, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x73, 0x12, 0x1c, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, - 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x45, 0x76, - 0x65, 0x6e, 0x74, 0x42, 0x75, 0x73, 0x1a, 0x1c, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, - 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x65, 0x6e, - 0x74, 0x42, 0x75, 0x73, 0x12, 0x56, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, - 0x74, 0x42, 0x75, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x2e, 0x2e, 0x6c, - 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, - 0x74, 0x62, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x0e, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x73, 0x12, 0x2f, - 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, - 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1c, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, - 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x73, 0x12, 0x6a, 0x0a, - 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2c, 0x2e, 0x6c, - 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x67, 0x6d, - 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x6c, 0x69, 0x6e, - 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6b, 0x0a, 0x12, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x03, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x50, 0x6f, 0x72, 0x74, 0x22, 0xff, 0x01, 0x0a, + 0x1b, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x62, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x62, 0x75, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x76, 0x65, 0x6e, + 0x74, 0x6c, 0x6f, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x65, 0x76, 0x65, 0x6e, + 0x74, 0x6c, 0x6f, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x27, 0x0a, 0x0f, + 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x64, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x51, 0x0a, 0x0c, 0x73, + 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x65, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x2d, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, + 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x53, 0x75, 0x62, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x52, 0x0c, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x72, + 0x0a, 0x1c, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, + 0x0a, 0x0d, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x12, 0x2d, 0x0a, 0x12, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, + 0x65, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x52, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x32, 0xba, 0x0b, 0x0a, 0x0f, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, + 0x72, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x12, 0x5f, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x73, 0x12, 0x2f, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, + 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, + 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, + 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x73, 0x12, 0x46, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x73, 0x12, 0x1c, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, + 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x73, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, + 0x49, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x73, 0x12, 0x1c, + 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, + 0x65, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x73, 0x1a, 0x1c, 0x2e, 0x6c, + 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, + 0x61, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x73, 0x12, 0x56, 0x0a, 0x0c, 0x4c, 0x69, + 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x1a, 0x2e, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, + 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x62, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x42, 0x75, 0x73, 0x12, 0x2f, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, + 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x75, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, + 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x42, 0x75, 0x73, 0x12, 0x6a, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x67, 0x6d, 0x65, + 0x6e, 0x74, 0x12, 0x2c, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, + 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x2d, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, + 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x6b, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, + 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, + 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6c, 0x69, 0x6e, + 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, + 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x6b, 0x0a, 0x12, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x33, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, + 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, + 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x53, 0x75, 0x62, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x61, 0x0a, 0x12, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, - 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x6b, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x2e, 0x6c, - 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x75, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x65, 0x0a, 0x0f, + 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x30, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, + 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x61, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x75, 0x62, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, - 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x65, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x30, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, - 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6c, 0x69, - 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x6d, 0x65, 0x74, 0x61, - 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x5e, 0x0a, - 0x10, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x32, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, - 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4f, 0x0a, - 0x0b, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, - 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x28, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, - 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x63, - 0x0a, 0x0c, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x28, + 0x69, 0x6f, 0x6e, 0x12, 0x5e, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x75, 0x62, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, + 0x32, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, + 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, + 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x4f, 0x0a, 0x0b, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x28, 0x2e, 0x6c, 0x69, 0x6e, + 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, + 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x63, 0x0a, 0x0c, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x4f, 0x66, + 0x66, 0x73, 0x65, 0x74, 0x12, 0x28, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, + 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, + 0x70, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x4f, 0x66, 0x66, 0x73, 0x65, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, - 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x4c, - 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x57, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, - 0x24, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, - 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x57, 0x0a, 0x08, 0x47, 0x65, 0x74, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x24, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x2f, 0x5a, 0x2d, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x69, 0x6e, 0x6b, 0x61, - 0x6c, 0x6c, 0x2d, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x6c, 0x69, + 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x78, + 0x79, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x7b, 0x0a, 0x14, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x53, 0x75, + 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x30, 0x2e, 0x6c, 0x69, 0x6e, + 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, + 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x6c, + 0x69, 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2e, 0x76, 0x61, 0x6e, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x78, 0x79, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, + 0x2f, 0x5a, 0x2d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x69, + 0x6e, 0x6b, 0x61, 0x6c, 0x6c, 0x2d, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x76, 0x61, 0x6e, 0x75, 0x73, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -484,65 +657,71 @@ func file_proxy_proto_rawDescGZIP() []byte { return file_proxy_proto_rawDescData } -var file_proxy_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_proxy_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_proxy_proto_goTypes = []interface{}{ (*LookupOffsetRequest)(nil), // 0: linkall.vanus.proxy.LookupOffsetRequest (*LookupOffsetResponse)(nil), // 1: linkall.vanus.proxy.LookupOffsetResponse (*GetEventRequest)(nil), // 2: linkall.vanus.proxy.GetEventRequest (*GetEventResponse)(nil), // 3: linkall.vanus.proxy.GetEventResponse (*ClusterInfoResponse)(nil), // 4: linkall.vanus.proxy.ClusterInfoResponse - nil, // 5: linkall.vanus.proxy.LookupOffsetResponse.OffsetsEntry - (*wrapperspb.BytesValue)(nil), // 6: google.protobuf.BytesValue - (*controller.CreateEventBusRequest)(nil), // 7: linkall.vanus.controller.CreateEventBusRequest - (*meta.EventBus)(nil), // 8: linkall.vanus.meta.EventBus - (*emptypb.Empty)(nil), // 9: google.protobuf.Empty - (*controller.UpdateEventBusRequest)(nil), // 10: linkall.vanus.controller.UpdateEventBusRequest - (*controller.ListSegmentRequest)(nil), // 11: linkall.vanus.controller.ListSegmentRequest - (*controller.CreateSubscriptionRequest)(nil), // 12: linkall.vanus.controller.CreateSubscriptionRequest - (*controller.UpdateSubscriptionRequest)(nil), // 13: linkall.vanus.controller.UpdateSubscriptionRequest - (*controller.DeleteSubscriptionRequest)(nil), // 14: linkall.vanus.controller.DeleteSubscriptionRequest - (*controller.GetSubscriptionRequest)(nil), // 15: linkall.vanus.controller.GetSubscriptionRequest - (*controller.ListEventbusResponse)(nil), // 16: linkall.vanus.controller.ListEventbusResponse - (*controller.ListSegmentResponse)(nil), // 17: linkall.vanus.controller.ListSegmentResponse - (*meta.Subscription)(nil), // 18: linkall.vanus.meta.Subscription - (*controller.ListSubscriptionResponse)(nil), // 19: linkall.vanus.controller.ListSubscriptionResponse + (*ValidateSubscriptionRequest)(nil), // 5: linkall.vanus.proxy.ValidateSubscriptionRequest + (*ValidateSubscriptionResponse)(nil), // 6: linkall.vanus.proxy.ValidateSubscriptionResponse + nil, // 7: linkall.vanus.proxy.LookupOffsetResponse.OffsetsEntry + (*wrapperspb.BytesValue)(nil), // 8: google.protobuf.BytesValue + (*controller.SubscriptionRequest)(nil), // 9: linkall.vanus.controller.SubscriptionRequest + (*controller.CreateEventBusRequest)(nil), // 10: linkall.vanus.controller.CreateEventBusRequest + (*meta.EventBus)(nil), // 11: linkall.vanus.meta.EventBus + (*emptypb.Empty)(nil), // 12: google.protobuf.Empty + (*controller.UpdateEventBusRequest)(nil), // 13: linkall.vanus.controller.UpdateEventBusRequest + (*controller.ListSegmentRequest)(nil), // 14: linkall.vanus.controller.ListSegmentRequest + (*controller.CreateSubscriptionRequest)(nil), // 15: linkall.vanus.controller.CreateSubscriptionRequest + (*controller.UpdateSubscriptionRequest)(nil), // 16: linkall.vanus.controller.UpdateSubscriptionRequest + (*controller.DeleteSubscriptionRequest)(nil), // 17: linkall.vanus.controller.DeleteSubscriptionRequest + (*controller.GetSubscriptionRequest)(nil), // 18: linkall.vanus.controller.GetSubscriptionRequest + (*controller.ListEventbusResponse)(nil), // 19: linkall.vanus.controller.ListEventbusResponse + (*controller.ListSegmentResponse)(nil), // 20: linkall.vanus.controller.ListSegmentResponse + (*meta.Subscription)(nil), // 21: linkall.vanus.meta.Subscription + (*controller.ListSubscriptionResponse)(nil), // 22: linkall.vanus.controller.ListSubscriptionResponse } var file_proxy_proto_depIdxs = []int32{ - 5, // 0: linkall.vanus.proxy.LookupOffsetResponse.offsets:type_name -> linkall.vanus.proxy.LookupOffsetResponse.OffsetsEntry - 6, // 1: linkall.vanus.proxy.GetEventResponse.events:type_name -> google.protobuf.BytesValue - 7, // 2: linkall.vanus.proxy.ControllerProxy.CreateEventBus:input_type -> linkall.vanus.controller.CreateEventBusRequest - 8, // 3: linkall.vanus.proxy.ControllerProxy.DeleteEventBus:input_type -> linkall.vanus.meta.EventBus - 8, // 4: linkall.vanus.proxy.ControllerProxy.GetEventBus:input_type -> linkall.vanus.meta.EventBus - 9, // 5: linkall.vanus.proxy.ControllerProxy.ListEventBus:input_type -> google.protobuf.Empty - 10, // 6: linkall.vanus.proxy.ControllerProxy.UpdateEventBus:input_type -> linkall.vanus.controller.UpdateEventBusRequest - 11, // 7: linkall.vanus.proxy.ControllerProxy.ListSegment:input_type -> linkall.vanus.controller.ListSegmentRequest - 12, // 8: linkall.vanus.proxy.ControllerProxy.CreateSubscription:input_type -> linkall.vanus.controller.CreateSubscriptionRequest - 13, // 9: linkall.vanus.proxy.ControllerProxy.UpdateSubscription:input_type -> linkall.vanus.controller.UpdateSubscriptionRequest - 14, // 10: linkall.vanus.proxy.ControllerProxy.DeleteSubscription:input_type -> linkall.vanus.controller.DeleteSubscriptionRequest - 15, // 11: linkall.vanus.proxy.ControllerProxy.GetSubscription:input_type -> linkall.vanus.controller.GetSubscriptionRequest - 9, // 12: linkall.vanus.proxy.ControllerProxy.ListSubscription:input_type -> google.protobuf.Empty - 9, // 13: linkall.vanus.proxy.ControllerProxy.ClusterInfo:input_type -> google.protobuf.Empty - 0, // 14: linkall.vanus.proxy.ControllerProxy.LookupOffset:input_type -> linkall.vanus.proxy.LookupOffsetRequest - 2, // 15: linkall.vanus.proxy.ControllerProxy.GetEvent:input_type -> linkall.vanus.proxy.GetEventRequest - 8, // 16: linkall.vanus.proxy.ControllerProxy.CreateEventBus:output_type -> linkall.vanus.meta.EventBus - 9, // 17: linkall.vanus.proxy.ControllerProxy.DeleteEventBus:output_type -> google.protobuf.Empty - 8, // 18: linkall.vanus.proxy.ControllerProxy.GetEventBus:output_type -> linkall.vanus.meta.EventBus - 16, // 19: linkall.vanus.proxy.ControllerProxy.ListEventBus:output_type -> linkall.vanus.controller.ListEventbusResponse - 8, // 20: linkall.vanus.proxy.ControllerProxy.UpdateEventBus:output_type -> linkall.vanus.meta.EventBus - 17, // 21: linkall.vanus.proxy.ControllerProxy.ListSegment:output_type -> linkall.vanus.controller.ListSegmentResponse - 18, // 22: linkall.vanus.proxy.ControllerProxy.CreateSubscription:output_type -> linkall.vanus.meta.Subscription - 18, // 23: linkall.vanus.proxy.ControllerProxy.UpdateSubscription:output_type -> linkall.vanus.meta.Subscription - 9, // 24: linkall.vanus.proxy.ControllerProxy.DeleteSubscription:output_type -> google.protobuf.Empty - 18, // 25: linkall.vanus.proxy.ControllerProxy.GetSubscription:output_type -> linkall.vanus.meta.Subscription - 19, // 26: linkall.vanus.proxy.ControllerProxy.ListSubscription:output_type -> linkall.vanus.controller.ListSubscriptionResponse - 4, // 27: linkall.vanus.proxy.ControllerProxy.ClusterInfo:output_type -> linkall.vanus.proxy.ClusterInfoResponse - 1, // 28: linkall.vanus.proxy.ControllerProxy.LookupOffset:output_type -> linkall.vanus.proxy.LookupOffsetResponse - 3, // 29: linkall.vanus.proxy.ControllerProxy.GetEvent:output_type -> linkall.vanus.proxy.GetEventResponse - 16, // [16:30] is the sub-list for method output_type - 2, // [2:16] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 7, // 0: linkall.vanus.proxy.LookupOffsetResponse.offsets:type_name -> linkall.vanus.proxy.LookupOffsetResponse.OffsetsEntry + 8, // 1: linkall.vanus.proxy.GetEventResponse.events:type_name -> google.protobuf.BytesValue + 9, // 2: linkall.vanus.proxy.ValidateSubscriptionRequest.subscription:type_name -> linkall.vanus.controller.SubscriptionRequest + 10, // 3: linkall.vanus.proxy.ControllerProxy.CreateEventBus:input_type -> linkall.vanus.controller.CreateEventBusRequest + 11, // 4: linkall.vanus.proxy.ControllerProxy.DeleteEventBus:input_type -> linkall.vanus.meta.EventBus + 11, // 5: linkall.vanus.proxy.ControllerProxy.GetEventBus:input_type -> linkall.vanus.meta.EventBus + 12, // 6: linkall.vanus.proxy.ControllerProxy.ListEventBus:input_type -> google.protobuf.Empty + 13, // 7: linkall.vanus.proxy.ControllerProxy.UpdateEventBus:input_type -> linkall.vanus.controller.UpdateEventBusRequest + 14, // 8: linkall.vanus.proxy.ControllerProxy.ListSegment:input_type -> linkall.vanus.controller.ListSegmentRequest + 15, // 9: linkall.vanus.proxy.ControllerProxy.CreateSubscription:input_type -> linkall.vanus.controller.CreateSubscriptionRequest + 16, // 10: linkall.vanus.proxy.ControllerProxy.UpdateSubscription:input_type -> linkall.vanus.controller.UpdateSubscriptionRequest + 17, // 11: linkall.vanus.proxy.ControllerProxy.DeleteSubscription:input_type -> linkall.vanus.controller.DeleteSubscriptionRequest + 18, // 12: linkall.vanus.proxy.ControllerProxy.GetSubscription:input_type -> linkall.vanus.controller.GetSubscriptionRequest + 12, // 13: linkall.vanus.proxy.ControllerProxy.ListSubscription:input_type -> google.protobuf.Empty + 12, // 14: linkall.vanus.proxy.ControllerProxy.ClusterInfo:input_type -> google.protobuf.Empty + 0, // 15: linkall.vanus.proxy.ControllerProxy.LookupOffset:input_type -> linkall.vanus.proxy.LookupOffsetRequest + 2, // 16: linkall.vanus.proxy.ControllerProxy.GetEvent:input_type -> linkall.vanus.proxy.GetEventRequest + 5, // 17: linkall.vanus.proxy.ControllerProxy.ValidateSubscription:input_type -> linkall.vanus.proxy.ValidateSubscriptionRequest + 11, // 18: linkall.vanus.proxy.ControllerProxy.CreateEventBus:output_type -> linkall.vanus.meta.EventBus + 12, // 19: linkall.vanus.proxy.ControllerProxy.DeleteEventBus:output_type -> google.protobuf.Empty + 11, // 20: linkall.vanus.proxy.ControllerProxy.GetEventBus:output_type -> linkall.vanus.meta.EventBus + 19, // 21: linkall.vanus.proxy.ControllerProxy.ListEventBus:output_type -> linkall.vanus.controller.ListEventbusResponse + 11, // 22: linkall.vanus.proxy.ControllerProxy.UpdateEventBus:output_type -> linkall.vanus.meta.EventBus + 20, // 23: linkall.vanus.proxy.ControllerProxy.ListSegment:output_type -> linkall.vanus.controller.ListSegmentResponse + 21, // 24: linkall.vanus.proxy.ControllerProxy.CreateSubscription:output_type -> linkall.vanus.meta.Subscription + 21, // 25: linkall.vanus.proxy.ControllerProxy.UpdateSubscription:output_type -> linkall.vanus.meta.Subscription + 12, // 26: linkall.vanus.proxy.ControllerProxy.DeleteSubscription:output_type -> google.protobuf.Empty + 21, // 27: linkall.vanus.proxy.ControllerProxy.GetSubscription:output_type -> linkall.vanus.meta.Subscription + 22, // 28: linkall.vanus.proxy.ControllerProxy.ListSubscription:output_type -> linkall.vanus.controller.ListSubscriptionResponse + 4, // 29: linkall.vanus.proxy.ControllerProxy.ClusterInfo:output_type -> linkall.vanus.proxy.ClusterInfoResponse + 1, // 30: linkall.vanus.proxy.ControllerProxy.LookupOffset:output_type -> linkall.vanus.proxy.LookupOffsetResponse + 3, // 31: linkall.vanus.proxy.ControllerProxy.GetEvent:output_type -> linkall.vanus.proxy.GetEventResponse + 6, // 32: linkall.vanus.proxy.ControllerProxy.ValidateSubscription:output_type -> linkall.vanus.proxy.ValidateSubscriptionResponse + 18, // [18:33] is the sub-list for method output_type + 3, // [3:18] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_proxy_proto_init() } @@ -611,6 +790,30 @@ func file_proxy_proto_init() { return nil } } + file_proxy_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ValidateSubscriptionRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proxy_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ValidateSubscriptionResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -618,7 +821,7 @@ func file_proxy_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_proxy_proto_rawDesc, NumEnums: 0, - NumMessages: 6, + NumMessages: 8, NumExtensions: 0, NumServices: 1, }, @@ -661,6 +864,7 @@ type ControllerProxyClient interface { ClusterInfo(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ClusterInfoResponse, error) LookupOffset(ctx context.Context, in *LookupOffsetRequest, opts ...grpc.CallOption) (*LookupOffsetResponse, error) GetEvent(ctx context.Context, in *GetEventRequest, opts ...grpc.CallOption) (*GetEventResponse, error) + ValidateSubscription(ctx context.Context, in *ValidateSubscriptionRequest, opts ...grpc.CallOption) (*ValidateSubscriptionResponse, error) } type controllerProxyClient struct { @@ -797,6 +1001,15 @@ func (c *controllerProxyClient) GetEvent(ctx context.Context, in *GetEventReques return out, nil } +func (c *controllerProxyClient) ValidateSubscription(ctx context.Context, in *ValidateSubscriptionRequest, opts ...grpc.CallOption) (*ValidateSubscriptionResponse, error) { + out := new(ValidateSubscriptionResponse) + err := c.cc.Invoke(ctx, "/linkall.vanus.proxy.ControllerProxy/ValidateSubscription", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // ControllerProxyServer is the server API for ControllerProxy service. type ControllerProxyServer interface { // EventbusService @@ -816,6 +1029,7 @@ type ControllerProxyServer interface { ClusterInfo(context.Context, *emptypb.Empty) (*ClusterInfoResponse, error) LookupOffset(context.Context, *LookupOffsetRequest) (*LookupOffsetResponse, error) GetEvent(context.Context, *GetEventRequest) (*GetEventResponse, error) + ValidateSubscription(context.Context, *ValidateSubscriptionRequest) (*ValidateSubscriptionResponse, error) } // UnimplementedControllerProxyServer can be embedded to have forward compatible implementations. @@ -864,6 +1078,9 @@ func (*UnimplementedControllerProxyServer) LookupOffset(context.Context, *Lookup func (*UnimplementedControllerProxyServer) GetEvent(context.Context, *GetEventRequest) (*GetEventResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetEvent not implemented") } +func (*UnimplementedControllerProxyServer) ValidateSubscription(context.Context, *ValidateSubscriptionRequest) (*ValidateSubscriptionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ValidateSubscription not implemented") +} func RegisterControllerProxyServer(s *grpc.Server, srv ControllerProxyServer) { s.RegisterService(&_ControllerProxy_serviceDesc, srv) @@ -1121,6 +1338,24 @@ func _ControllerProxy_GetEvent_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _ControllerProxy_ValidateSubscription_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ValidateSubscriptionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ControllerProxyServer).ValidateSubscription(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/linkall.vanus.proxy.ControllerProxy/ValidateSubscription", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ControllerProxyServer).ValidateSubscription(ctx, req.(*ValidateSubscriptionRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _ControllerProxy_serviceDesc = grpc.ServiceDesc{ ServiceName: "linkall.vanus.proxy.ControllerProxy", HandlerType: (*ControllerProxyServer)(nil), @@ -1181,6 +1416,10 @@ var _ControllerProxy_serviceDesc = grpc.ServiceDesc{ MethodName: "GetEvent", Handler: _ControllerProxy_GetEvent_Handler, }, + { + MethodName: "ValidateSubscription", + Handler: _ControllerProxy_ValidateSubscription_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "proxy.proto", diff --git a/proto/proto/proxy.proto b/proto/proto/proxy.proto index 90efaa335..623091f2e 100644 --- a/proto/proto/proxy.proto +++ b/proto/proto/proxy.proto @@ -50,6 +50,7 @@ service ControllerProxy { rpc ClusterInfo(google.protobuf.Empty) returns (ClusterInfoResponse); rpc LookupOffset(LookupOffsetRequest) returns (LookupOffsetResponse); rpc GetEvent(GetEventRequest) returns (GetEventResponse); + rpc ValidateSubscription(ValidateSubscriptionRequest) returns (ValidateSubscriptionResponse); } message LookupOffsetRequest { @@ -77,4 +78,19 @@ message GetEventResponse { message ClusterInfoResponse { int64 cloudevents_port = 1; int64 proxy_port = 2; +} + +message ValidateSubscriptionRequest { + string eventbus = 1; + uint64 eventlog = 2; + int64 offset=3; + uint64 subscription_id = 4; + + bytes event = 100; + controller.SubscriptionRequest subscription = 101; +} + +message ValidateSubscriptionResponse { + bool filter_result = 1; + bytes transformer_result = 2; } \ No newline at end of file