diff --git a/internal/api/events/v1alpha1/events.go b/internal/api/events/v1alpha1/events.go index 30cc4a5..d965e9e 100644 --- a/internal/api/events/v1alpha1/events.go +++ b/internal/api/events/v1alpha1/events.go @@ -108,10 +108,11 @@ func (e *EventsServiceServer) Events(server eventsv1alpha1.EventsService_EventsS err = server.Send(&eventsv1alpha1.EventsResponse{ Response: &eventsv1alpha1.EventsResponse_Event{ Event: &eventsv1alpha1.Event{ - Id: event.StreamSeq, - Data: event.Data, - Subject: event.Subject, - Headers: headers, + Id: event.StreamSeq, + Data: event.Data, + Subject: event.Subject, + Headers: headers, + DeliveryAttempt: event.DeliveryAttempt, }, }, }) diff --git a/internal/api/events/v1alpha1/events_test.go b/internal/api/events/v1alpha1/events_test.go index aa56b27..a115e68 100644 --- a/internal/api/events/v1alpha1/events_test.go +++ b/internal/api/events/v1alpha1/events_test.go @@ -4,6 +4,7 @@ import ( "context" "time" eventsv1alpha1 "windshift/service/internal/proto/windshift/events/v1alpha1" + testv1 "windshift/service/internal/proto/windshift/test/v1" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" @@ -94,7 +95,7 @@ var _ = Describe("Events", func() { // Send an event _, err = service.PublishEvent(ctx, &eventsv1alpha1.PublishEventRequest{ Subject: "events.test", - Data: Data(&emptypb.Empty{}), + Data: Data(&testv1.StringValue{Value: "test"}), }) Expect(err).ToNot(HaveOccurred()) @@ -104,6 +105,11 @@ var _ = Describe("Events", func() { if _, ok := in.Response.(*eventsv1alpha1.EventsResponse_Event); !ok { Fail("expected Event message") } + + e := in.GetEvent() + Expect(e.Subject).To(Equal("events.test")) + Expect(e.DeliveryAttempt).To(BeNumerically("==", 1)) + Expect(e.Data).To(Equal(Data(&testv1.StringValue{Value: "test"}))) }) }) @@ -141,7 +147,7 @@ var _ = Describe("Events", func() { // Send an event _, err = service.PublishEvent(ctx, &eventsv1alpha1.PublishEventRequest{ Subject: "events.test", - Data: Data(&emptypb.Empty{}), + Data: Data(&testv1.StringValue{Value: "test"}), }) Expect(err).ToNot(HaveOccurred()) @@ -152,7 +158,12 @@ var _ = Describe("Events", func() { Fail("expected Event message") } - eventID := in.GetEvent().GetId() + e := in.GetEvent() + Expect(e.Subject).To(Equal("events.test")) + Expect(e.DeliveryAttempt).To(BeNumerically("==", 1)) + Expect(e.Data).To(Equal(Data(&testv1.StringValue{Value: "test"}))) + + eventID := e.GetId() // Acknowledge the event err = client.Send(&eventsv1alpha1.EventsRequest{ @@ -170,8 +181,7 @@ var _ = Describe("Events", func() { if r, ok := in.Response.(*eventsv1alpha1.EventsResponse_AckConfirmation_); ok { Expect(r.AckConfirmation.Ids).To(Equal([]uint64{eventID})) } else { - - Fail("expected AckConfiramtion message") + Fail("expected AckConfirmation message") } }) @@ -221,8 +231,7 @@ var _ = Describe("Events", func() { if r, ok := in.Response.(*eventsv1alpha1.EventsResponse_AckConfirmation_); ok { Expect(r.AckConfirmation.InvalidIds).To(Equal([]uint64{1})) } else { - - Fail("expected AckConfiramtion message") + Fail("expected AckConfirmation message") } }) @@ -337,7 +346,7 @@ var _ = Describe("Events", func() { // Send an event _, err = service.PublishEvent(ctx, &eventsv1alpha1.PublishEventRequest{ Subject: "events.test", - Data: Data(&emptypb.Empty{}), + Data: Data(&testv1.StringValue{Value: "test"}), }) Expect(err).ToNot(HaveOccurred()) @@ -348,7 +357,12 @@ var _ = Describe("Events", func() { Fail("expected Event message") } - eventID := in.GetEvent().GetId() + e := in.GetEvent() + Expect(e.Subject).To(Equal("events.test")) + Expect(e.DeliveryAttempt).To(BeNumerically("==", 1)) + Expect(e.Data).To(Equal(Data(&testv1.StringValue{Value: "test"}))) + + eventID := e.GetId() // Reject the event err = client.Send(&eventsv1alpha1.EventsRequest{ @@ -374,6 +388,11 @@ var _ = Describe("Events", func() { if _, ok := in.Response.(*eventsv1alpha1.EventsResponse_Event); !ok { Fail("expected Event message") } + + e = in.GetEvent() + Expect(e.Subject).To(Equal("events.test")) + Expect(e.DeliveryAttempt).To(BeNumerically("==", 2)) + Expect(e.Data).To(Equal(Data(&testv1.StringValue{Value: "test"}))) }) It("rejecting unknown event fails", NodeTimeout(5*time.Second), func(ctx context.Context) { @@ -458,7 +477,7 @@ var _ = Describe("Events", func() { // Send an event _, err = service.PublishEvent(ctx, &eventsv1alpha1.PublishEventRequest{ Subject: "events.test", - Data: Data(&emptypb.Empty{}), + Data: Data(&testv1.StringValue{Value: "test"}), }) Expect(err).ToNot(HaveOccurred()) @@ -469,7 +488,11 @@ var _ = Describe("Events", func() { Fail("expected Event message") } - eventID := in.GetEvent().GetId() + e := in.GetEvent() + Expect(e.Subject).To(Equal("events.test")) + Expect(e.DeliveryAttempt).To(BeNumerically("==", 1)) + Expect(e.Data).To(Equal(Data(&testv1.StringValue{Value: "test"}))) + eventID := e.GetId() // Reject the event err = client.Send(&eventsv1alpha1.EventsRequest{ diff --git a/internal/events/event.go b/internal/events/event.go index fb84ad4..7d1d235 100644 --- a/internal/events/event.go +++ b/internal/events/event.go @@ -52,6 +52,10 @@ type Event struct { // resume from there on the next run. StreamSeq uint64 + // DeliveryAttempt is the number of times the event has been delivered to + // a consumer. The first delivery is 1. + DeliveryAttempt uint64 + // Headers contains the headers of the event. Headers *Headers @@ -108,16 +112,17 @@ func newEvent( } return &Event{ - span: span, - logger: logger, - msg: msg, - onProcess: onProcess, - Context: ctx, - Subject: msg.Subject(), - ConsumerSeq: md.Sequence.Stream, - StreamSeq: md.Sequence.Consumer, - Headers: headers, - Data: data, + span: span, + logger: logger, + msg: msg, + onProcess: onProcess, + Context: ctx, + Subject: msg.Subject(), + ConsumerSeq: md.Sequence.Stream, + StreamSeq: md.Sequence.Consumer, + DeliveryAttempt: md.NumDelivered, + Headers: headers, + Data: data, }, nil } diff --git a/internal/events/events_test.go b/internal/events/events_test.go index 81aba7f..97f2876 100644 --- a/internal/events/events_test.go +++ b/internal/events/events_test.go @@ -559,6 +559,7 @@ var _ = Describe("Event Consumption", func() { select { case event := <-ec.Incoming(): Expect(event).ToNot(BeNil()) + Expect(event.DeliveryAttempt).To(BeNumerically("==", 1)) err = event.Reject() Expect(err).ToNot(HaveOccurred()) @@ -569,6 +570,7 @@ var _ = Describe("Event Consumption", func() { select { case event := <-ec.Incoming(): Expect(event).ToNot(BeNil()) + Expect(event.DeliveryAttempt).To(BeNumerically("==", 2)) err = event.Ack() Expect(err).ToNot(HaveOccurred()) @@ -611,6 +613,7 @@ var _ = Describe("Event Consumption", func() { select { case event := <-ec.Incoming(): Expect(event).ToNot(BeNil()) + Expect(event.DeliveryAttempt).To(BeNumerically("==", 1)) event.DiscardData() err = event.Reject() @@ -622,6 +625,7 @@ var _ = Describe("Event Consumption", func() { select { case event := <-ec.Incoming(): Expect(event).ToNot(BeNil()) + Expect(event.DeliveryAttempt).To(BeNumerically("==", 2)) err = event.Ack() Expect(err).ToNot(HaveOccurred()) @@ -665,6 +669,7 @@ var _ = Describe("Event Consumption", func() { event := <-ec1.Incoming() Expect(event).ToNot(BeNil()) + Expect(event.DeliveryAttempt).To(BeNumerically("==", 1)) err = ec1.Close() Expect(err).ToNot(HaveOccurred()) @@ -675,6 +680,7 @@ var _ = Describe("Event Consumption", func() { select { case event = <-ec2.Incoming(): Expect(event).ToNot(BeNil()) + Expect(event.DeliveryAttempt).To(BeNumerically("==", 2)) case <-time.After(500 * time.Millisecond): Fail("timeout waiting for event") } @@ -709,6 +715,7 @@ var _ = Describe("Event Consumption", func() { select { case event := <-ec.Incoming(): Expect(event).ToNot(BeNil()) + Expect(event.DeliveryAttempt).To(BeNumerically("==", 1)) case <-time.After(200 * time.Millisecond): Fail("no event received") } @@ -718,6 +725,7 @@ var _ = Describe("Event Consumption", func() { select { case event := <-ec.Incoming(): Expect(event).ToNot(BeNil()) + Expect(event.DeliveryAttempt).To(BeNumerically("==", 2)) err = event.Ack() Expect(err).ToNot(HaveOccurred()) @@ -758,6 +766,7 @@ var _ = Describe("Event Consumption", func() { event := <-ec.Incoming() Expect(event).ToNot(BeNil()) + Expect(event.DeliveryAttempt).To(BeNumerically("==", 1)) start := time.Now() err = event.RejectWithDelay(100 * time.Millisecond) @@ -765,10 +774,12 @@ var _ = Describe("Event Consumption", func() { // Receive the event again select { - case <-ec.Incoming(): + case event := <-ec.Incoming(): if time.Since(start) < 100*time.Millisecond { Fail("event received too early") } + + Expect(event.DeliveryAttempt).To(BeNumerically("==", 2)) case <-time.After(200 * time.Millisecond): Fail("no event received") } diff --git a/internal/proto/windshift/events/v1alpha1/service.pb.go b/internal/proto/windshift/events/v1alpha1/service.pb.go index 254c0a3..682a7b3 100644 --- a/internal/proto/windshift/events/v1alpha1/service.pb.go +++ b/internal/proto/windshift/events/v1alpha1/service.pb.go @@ -1164,6 +1164,9 @@ type Event struct { // useful to support different versions of the data. Subscribers should // ignore data they do not understand. Data *anypb.Any `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` + // The delivery attempt this is. Starts at 1 and increases for each + // redelivery of the event. + DeliveryAttempt uint64 `protobuf:"varint,5,opt,name=delivery_attempt,json=deliveryAttempt,proto3" json:"delivery_attempt,omitempty"` } func (x *Event) Reset() { @@ -1226,6 +1229,13 @@ func (x *Event) GetData() *anypb.Any { return nil } +func (x *Event) GetDeliveryAttempt() uint64 { + if x != nil { + return x.DeliveryAttempt + } + return 0 +} + type Headers struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2491,7 +2501,7 @@ var file_windshift_events_v1alpha1_service_proto_rawDesc = []byte{ 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x00, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, - 0x65, 0x74, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x22, 0x99, 0x01, + 0x65, 0x74, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x22, 0xc4, 0x01, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, @@ -2501,76 +2511,78 @@ var file_windshift_events_v1alpha1_service_proto_rawDesc = []byte{ 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x28, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x41, 0x6e, 0x79, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0xf4, 0x01, 0x0a, 0x07, 0x48, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, - 0x2c, 0x0a, 0x0f, 0x69, 0x64, 0x65, 0x6d, 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x5f, 0x6b, - 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0e, 0x69, 0x64, 0x65, 0x6d, - 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x4b, 0x65, 0x79, 0x88, 0x01, 0x01, 0x12, 0x26, 0x0a, - 0x0c, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x0b, 0x74, 0x72, 0x61, 0x63, 0x65, 0x50, 0x61, 0x72, 0x65, - 0x6e, 0x74, 0x88, 0x01, 0x01, 0x12, 0x24, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x73, - 0x74, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, 0x0a, 0x74, 0x72, - 0x61, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x88, 0x01, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x5f, - 0x69, 0x64, 0x65, 0x6d, 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x5f, 0x6b, 0x65, 0x79, 0x42, - 0x0f, 0x0a, 0x0d, 0x5f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, - 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x32, 0xc6, 0x04, 0x0a, 0x0d, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x12, 0x6f, 0x0a, 0x0c, 0x45, 0x6e, 0x73, 0x75, 0x72, 0x65, 0x53, 0x74, 0x72, 0x65, - 0x61, 0x6d, 0x12, 0x2e, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x73, 0x68, 0x69, 0x66, 0x74, 0x2e, 0x65, - 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, - 0x6e, 0x73, 0x75, 0x72, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x73, 0x68, 0x69, 0x66, 0x74, 0x2e, 0x65, + 0x41, 0x6e, 0x79, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x29, 0x0a, 0x10, 0x64, 0x65, 0x6c, + 0x69, 0x76, 0x65, 0x72, 0x79, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x0f, 0x64, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x41, 0x74, 0x74, + 0x65, 0x6d, 0x70, 0x74, 0x22, 0xf4, 0x01, 0x0a, 0x07, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, + 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, + 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2c, 0x0a, 0x0f, 0x69, 0x64, + 0x65, 0x6d, 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0e, 0x69, 0x64, 0x65, 0x6d, 0x70, 0x6f, 0x74, 0x65, 0x6e, + 0x63, 0x79, 0x4b, 0x65, 0x79, 0x88, 0x01, 0x01, 0x12, 0x26, 0x0a, 0x0c, 0x74, 0x72, 0x61, 0x63, + 0x65, 0x5f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, + 0x52, 0x0b, 0x74, 0x72, 0x61, 0x63, 0x65, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x88, 0x01, 0x01, + 0x12, 0x24, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, 0x0a, 0x74, 0x72, 0x61, 0x63, 0x65, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x88, 0x01, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x69, 0x64, 0x65, 0x6d, 0x70, + 0x6f, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x5f, 0x6b, 0x65, 0x79, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x74, + 0x72, 0x61, 0x63, 0x65, 0x5f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, + 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x32, 0xc6, 0x04, 0x0a, 0x0d, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x6f, 0x0a, + 0x0c, 0x45, 0x6e, 0x73, 0x75, 0x72, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x2e, 0x2e, + 0x77, 0x69, 0x6e, 0x64, 0x73, 0x68, 0x69, 0x66, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x6e, 0x73, 0x75, 0x72, 0x65, + 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, + 0x77, 0x69, 0x6e, 0x64, 0x73, 0x68, 0x69, 0x66, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x6e, 0x73, 0x75, 0x72, 0x65, + 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x75, + 0x0a, 0x0e, 0x45, 0x6e, 0x73, 0x75, 0x72, 0x65, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x72, + 0x12, 0x30, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x73, 0x68, 0x69, 0x66, 0x74, 0x2e, 0x65, 0x76, 0x65, + 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x6e, 0x73, + 0x75, 0x72, 0x65, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x73, 0x68, 0x69, 0x66, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, - 0x6e, 0x73, 0x75, 0x72, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x75, 0x0a, 0x0e, 0x45, 0x6e, 0x73, 0x75, 0x72, 0x65, 0x43, 0x6f, 0x6e, - 0x73, 0x75, 0x6d, 0x65, 0x72, 0x12, 0x30, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x73, 0x68, 0x69, 0x66, - 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x45, 0x6e, 0x73, 0x75, 0x72, 0x65, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x72, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x73, 0x68, + 0x6e, 0x73, 0x75, 0x72, 0x65, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x72, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x75, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, + 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x72, 0x12, 0x30, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x73, 0x68, 0x69, 0x66, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x45, 0x6e, 0x73, 0x75, 0x72, 0x65, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, - 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x75, 0x0a, 0x0e, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x72, 0x12, 0x30, 0x2e, 0x77, + 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, + 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x77, 0x69, 0x6e, 0x64, + 0x73, 0x68, 0x69, 0x66, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x73, + 0x75, 0x6d, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x71, 0x0a, 0x0c, + 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x2e, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x73, 0x68, 0x69, 0x66, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, - 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, - 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x73, 0x68, 0x69, 0x66, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, - 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x71, 0x0a, 0x0c, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x45, 0x76, 0x65, 0x6e, - 0x74, 0x12, 0x2e, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x73, 0x68, 0x69, 0x66, 0x74, 0x2e, 0x65, 0x76, - 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x75, - 0x62, 0x6c, 0x69, 0x73, 0x68, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x2f, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x73, 0x68, 0x69, 0x66, 0x74, 0x2e, 0x65, 0x76, - 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x75, - 0x62, 0x6c, 0x69, 0x73, 0x68, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x00, 0x12, 0x63, 0x0a, 0x06, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x28, - 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x73, 0x68, 0x69, 0x66, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, - 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x73, - 0x68, 0x69, 0x66, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, 0xfe, 0x01, 0x0a, 0x1d, 0x63, 0x6f, - 0x6d, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x73, 0x68, 0x69, 0x66, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, - 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x0c, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x49, 0x77, 0x69, 0x6e, - 0x64, 0x73, 0x68, 0x69, 0x66, 0x74, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x69, - 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x77, 0x69, - 0x6e, 0x64, 0x73, 0x68, 0x69, 0x66, 0x74, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x57, 0x45, 0x58, 0xaa, 0x02, 0x19, 0x57, - 0x69, 0x6e, 0x64, 0x73, 0x68, 0x69, 0x66, 0x74, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, - 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x19, 0x57, 0x69, 0x6e, 0x64, 0x73, - 0x68, 0x69, 0x66, 0x74, 0x5c, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x5c, 0x56, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, 0x25, 0x57, 0x69, 0x6e, 0x64, 0x73, 0x68, 0x69, 0x66, 0x74, - 0x5c, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1b, 0x57, - 0x69, 0x6e, 0x64, 0x73, 0x68, 0x69, 0x66, 0x74, 0x3a, 0x3a, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, - 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x77, + 0x69, 0x6e, 0x64, 0x73, 0x68, 0x69, 0x66, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, + 0x63, 0x0a, 0x06, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x28, 0x2e, 0x77, 0x69, 0x6e, 0x64, + 0x73, 0x68, 0x69, 0x66, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x73, 0x68, 0x69, 0x66, 0x74, 0x2e, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x28, 0x01, 0x30, 0x01, 0x42, 0xfe, 0x01, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x77, 0x69, 0x6e, + 0x64, 0x73, 0x68, 0x69, 0x66, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x0c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x49, 0x77, 0x69, 0x6e, 0x64, 0x73, 0x68, 0x69, 0x66, + 0x74, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, + 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x77, 0x69, 0x6e, 0x64, 0x73, 0x68, 0x69, + 0x66, 0x74, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x3b, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0xa2, 0x02, 0x03, 0x57, 0x45, 0x58, 0xaa, 0x02, 0x19, 0x57, 0x69, 0x6e, 0x64, 0x73, 0x68, + 0x69, 0x66, 0x74, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0xca, 0x02, 0x19, 0x57, 0x69, 0x6e, 0x64, 0x73, 0x68, 0x69, 0x66, 0x74, 0x5c, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, + 0x02, 0x25, 0x57, 0x69, 0x6e, 0x64, 0x73, 0x68, 0x69, 0x66, 0x74, 0x5c, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x73, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1b, 0x57, 0x69, 0x6e, 0x64, 0x73, 0x68, + 0x69, 0x66, 0x74, 0x3a, 0x3a, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x3a, 0x3a, 0x56, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/internal/proto/windshift/events/v1alpha1/service_vtproto.pb.go b/internal/proto/windshift/events/v1alpha1/service_vtproto.pb.go index f687785..b38bbad 100644 --- a/internal/proto/windshift/events/v1alpha1/service_vtproto.pb.go +++ b/internal/proto/windshift/events/v1alpha1/service_vtproto.pb.go @@ -2115,6 +2115,11 @@ func (m *Event) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if m.DeliveryAttempt != 0 { + i = encodeVarint(dAtA, i, uint64(m.DeliveryAttempt)) + i-- + dAtA[i] = 0x28 + } if m.Data != nil { if vtmsg, ok := interface{}(m.Data).(interface { MarshalToSizedBufferVT([]byte) (int, error) @@ -2991,6 +2996,9 @@ func (m *Event) SizeVT() (n int) { } n += 1 + l + sov(uint64(l)) } + if m.DeliveryAttempt != 0 { + n += 1 + sov(uint64(m.DeliveryAttempt)) + } n += len(m.unknownFields) return n } @@ -7117,6 +7125,25 @@ func (m *Event) UnmarshalVT(dAtA []byte) error { } } iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DeliveryAttempt", wireType) + } + m.DeliveryAttempt = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DeliveryAttempt |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skip(dAtA[iNdEx:]) diff --git a/internal/proto/windshift/locks/v1alpha1/service.pb.go b/internal/proto/windshift/locks/v1alpha1/service.pb.go new file mode 100644 index 0000000..f57f7c5 --- /dev/null +++ b/internal/proto/windshift/locks/v1alpha1/service.pb.go @@ -0,0 +1,1734 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc (unknown) +// source: windshift/locks/v1alpha1/service.proto + +package locksv1alpha1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + durationpb "google.golang.org/protobuf/types/known/durationpb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// * +// Request to acquire, extend or release a lock. +type LockRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // * The type of lock request. + // Types that are assignable to Lock: + // + // *LockRequest_Acquire_ + // *LockRequest_Extend_ + // *LockRequest_Release_ + Lock isLockRequest_Lock `protobuf_oneof:"lock"` +} + +func (x *LockRequest) Reset() { + *x = LockRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_windshift_locks_v1alpha1_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LockRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LockRequest) ProtoMessage() {} + +func (x *LockRequest) ProtoReflect() protoreflect.Message { + mi := &file_windshift_locks_v1alpha1_service_proto_msgTypes[0] + 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 LockRequest.ProtoReflect.Descriptor instead. +func (*LockRequest) Descriptor() ([]byte, []int) { + return file_windshift_locks_v1alpha1_service_proto_rawDescGZIP(), []int{0} +} + +func (m *LockRequest) GetLock() isLockRequest_Lock { + if m != nil { + return m.Lock + } + return nil +} + +func (x *LockRequest) GetAcquire() *LockRequest_Acquire { + if x, ok := x.GetLock().(*LockRequest_Acquire_); ok { + return x.Acquire + } + return nil +} + +func (x *LockRequest) GetExtend() *LockRequest_Extend { + if x, ok := x.GetLock().(*LockRequest_Extend_); ok { + return x.Extend + } + return nil +} + +func (x *LockRequest) GetRelease() *LockRequest_Release { + if x, ok := x.GetLock().(*LockRequest_Release_); ok { + return x.Release + } + return nil +} + +type isLockRequest_Lock interface { + isLockRequest_Lock() +} + +type LockRequest_Acquire_ struct { + // * Acquire a new lock. + Acquire *LockRequest_Acquire `protobuf:"bytes,1,opt,name=acquire,proto3,oneof"` +} + +type LockRequest_Extend_ struct { + // * Extend the duration of a lock you already hold. + Extend *LockRequest_Extend `protobuf:"bytes,2,opt,name=extend,proto3,oneof"` +} + +type LockRequest_Release_ struct { + // * Release a lock you already hold. + Release *LockRequest_Release `protobuf:"bytes,3,opt,name=release,proto3,oneof"` +} + +func (*LockRequest_Acquire_) isLockRequest_Lock() {} + +func (*LockRequest_Extend_) isLockRequest_Lock() {} + +func (*LockRequest_Release_) isLockRequest_Lock() {} + +// * +// Response to a lock request. +type LockResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // * The type of lock response. + // Types that are assignable to Lock: + // + // *LockResponse_Acquired_ + // *LockResponse_Extended_ + // *LockResponse_Released_ + // *LockResponse_Rejected_ + Lock isLockResponse_Lock `protobuf_oneof:"lock"` +} + +func (x *LockResponse) Reset() { + *x = LockResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_windshift_locks_v1alpha1_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LockResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LockResponse) ProtoMessage() {} + +func (x *LockResponse) ProtoReflect() protoreflect.Message { + mi := &file_windshift_locks_v1alpha1_service_proto_msgTypes[1] + 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 LockResponse.ProtoReflect.Descriptor instead. +func (*LockResponse) Descriptor() ([]byte, []int) { + return file_windshift_locks_v1alpha1_service_proto_rawDescGZIP(), []int{1} +} + +func (m *LockResponse) GetLock() isLockResponse_Lock { + if m != nil { + return m.Lock + } + return nil +} + +func (x *LockResponse) GetAcquired() *LockResponse_Acquired { + if x, ok := x.GetLock().(*LockResponse_Acquired_); ok { + return x.Acquired + } + return nil +} + +func (x *LockResponse) GetExtended() *LockResponse_Extended { + if x, ok := x.GetLock().(*LockResponse_Extended_); ok { + return x.Extended + } + return nil +} + +func (x *LockResponse) GetReleased() *LockResponse_Released { + if x, ok := x.GetLock().(*LockResponse_Released_); ok { + return x.Released + } + return nil +} + +func (x *LockResponse) GetRejected() *LockResponse_Rejected { + if x, ok := x.GetLock().(*LockResponse_Rejected_); ok { + return x.Rejected + } + return nil +} + +type isLockResponse_Lock interface { + isLockResponse_Lock() +} + +type LockResponse_Acquired_ struct { + // * A lock was acquired or extended. + Acquired *LockResponse_Acquired `protobuf:"bytes,1,opt,name=acquired,proto3,oneof"` +} + +type LockResponse_Extended_ struct { + // * A lock was extended. + Extended *LockResponse_Extended `protobuf:"bytes,2,opt,name=extended,proto3,oneof"` +} + +type LockResponse_Released_ struct { + // * A lock was released. + Released *LockResponse_Released `protobuf:"bytes,3,opt,name=released,proto3,oneof"` +} + +type LockResponse_Rejected_ struct { + // * A lock was rejected. + Rejected *LockResponse_Rejected `protobuf:"bytes,4,opt,name=rejected,proto3,oneof"` +} + +func (*LockResponse_Acquired_) isLockResponse_Lock() {} + +func (*LockResponse_Extended_) isLockResponse_Lock() {} + +func (*LockResponse_Released_) isLockResponse_Lock() {} + +func (*LockResponse_Rejected_) isLockResponse_Lock() {} + +// * +// Event for when a lock has been acquired. +type LockAcquiredEvent struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // * + // Name of the lock that was acquired. + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // * + // Owner of the lock, intended to be human-readable to allow + // distinguishing between different clients. + Owner string `protobuf:"bytes,3,opt,name=owner,proto3" json:"owner,omitempty"` + // * + // Expires is the timestamp at which the lock will expire on its own + // if it is not extended or released. + Expires *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=expires,proto3" json:"expires,omitempty"` +} + +func (x *LockAcquiredEvent) Reset() { + *x = LockAcquiredEvent{} + if protoimpl.UnsafeEnabled { + mi := &file_windshift_locks_v1alpha1_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LockAcquiredEvent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LockAcquiredEvent) ProtoMessage() {} + +func (x *LockAcquiredEvent) ProtoReflect() protoreflect.Message { + mi := &file_windshift_locks_v1alpha1_service_proto_msgTypes[2] + 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 LockAcquiredEvent.ProtoReflect.Descriptor instead. +func (*LockAcquiredEvent) Descriptor() ([]byte, []int) { + return file_windshift_locks_v1alpha1_service_proto_rawDescGZIP(), []int{2} +} + +func (x *LockAcquiredEvent) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *LockAcquiredEvent) GetOwner() string { + if x != nil { + return x.Owner + } + return "" +} + +func (x *LockAcquiredEvent) GetExpires() *timestamppb.Timestamp { + if x != nil { + return x.Expires + } + return nil +} + +// * +// Event for when a lock has been extended. +type LockExtendedEvent struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // * + // Name of the lock that was extended. + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // * + // Owner of the lock, intended to be human-readable to allow + // distinguishing between different clients. + Owner string `protobuf:"bytes,3,opt,name=owner,proto3" json:"owner,omitempty"` + // * + // Expires is the timestamp at which the lock will expire on its own + // if it is not extended or released. + Expires *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=expires,proto3" json:"expires,omitempty"` +} + +func (x *LockExtendedEvent) Reset() { + *x = LockExtendedEvent{} + if protoimpl.UnsafeEnabled { + mi := &file_windshift_locks_v1alpha1_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LockExtendedEvent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LockExtendedEvent) ProtoMessage() {} + +func (x *LockExtendedEvent) ProtoReflect() protoreflect.Message { + mi := &file_windshift_locks_v1alpha1_service_proto_msgTypes[3] + 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 LockExtendedEvent.ProtoReflect.Descriptor instead. +func (*LockExtendedEvent) Descriptor() ([]byte, []int) { + return file_windshift_locks_v1alpha1_service_proto_rawDescGZIP(), []int{3} +} + +func (x *LockExtendedEvent) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *LockExtendedEvent) GetOwner() string { + if x != nil { + return x.Owner + } + return "" +} + +func (x *LockExtendedEvent) GetExpires() *timestamppb.Timestamp { + if x != nil { + return x.Expires + } + return nil +} + +// * +// Event for when a lock has been released. +type LockReleasedEvent struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // * + // Name of the lock that was released. + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // * + // Owner of the lock, intended to be human-readable to allow + // distinguishing between different clients. + Owner string `protobuf:"bytes,3,opt,name=owner,proto3" json:"owner,omitempty"` +} + +func (x *LockReleasedEvent) Reset() { + *x = LockReleasedEvent{} + if protoimpl.UnsafeEnabled { + mi := &file_windshift_locks_v1alpha1_service_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LockReleasedEvent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LockReleasedEvent) ProtoMessage() {} + +func (x *LockReleasedEvent) ProtoReflect() protoreflect.Message { + mi := &file_windshift_locks_v1alpha1_service_proto_msgTypes[4] + 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 LockReleasedEvent.ProtoReflect.Descriptor instead. +func (*LockReleasedEvent) Descriptor() ([]byte, []int) { + return file_windshift_locks_v1alpha1_service_proto_rawDescGZIP(), []int{4} +} + +func (x *LockReleasedEvent) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *LockReleasedEvent) GetOwner() string { + if x != nil { + return x.Owner + } + return "" +} + +// * +// Request to monitor the state of a lock or many locks. +type MonitorRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // * + // Name of the lock to monitor. If empty, all locks will be monitored. + Name []string `protobuf:"bytes,1,rep,name=name,proto3" json:"name,omitempty"` +} + +func (x *MonitorRequest) Reset() { + *x = MonitorRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_windshift_locks_v1alpha1_service_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MonitorRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MonitorRequest) ProtoMessage() {} + +func (x *MonitorRequest) ProtoReflect() protoreflect.Message { + mi := &file_windshift_locks_v1alpha1_service_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 MonitorRequest.ProtoReflect.Descriptor instead. +func (*MonitorRequest) Descriptor() ([]byte, []int) { + return file_windshift_locks_v1alpha1_service_proto_rawDescGZIP(), []int{5} +} + +func (x *MonitorRequest) GetName() []string { + if x != nil { + return x.Name + } + return nil +} + +type MonitorResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // * + // Timestamp of the event. + Timestamp *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + // Types that are assignable to Event: + // + // *MonitorResponse_Acquired + // *MonitorResponse_Extended + // *MonitorResponse_Released + Event isMonitorResponse_Event `protobuf_oneof:"event"` +} + +func (x *MonitorResponse) Reset() { + *x = MonitorResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_windshift_locks_v1alpha1_service_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MonitorResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MonitorResponse) ProtoMessage() {} + +func (x *MonitorResponse) ProtoReflect() protoreflect.Message { + mi := &file_windshift_locks_v1alpha1_service_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 MonitorResponse.ProtoReflect.Descriptor instead. +func (*MonitorResponse) Descriptor() ([]byte, []int) { + return file_windshift_locks_v1alpha1_service_proto_rawDescGZIP(), []int{6} +} + +func (x *MonitorResponse) GetTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.Timestamp + } + return nil +} + +func (m *MonitorResponse) GetEvent() isMonitorResponse_Event { + if m != nil { + return m.Event + } + return nil +} + +func (x *MonitorResponse) GetAcquired() *LockAcquiredEvent { + if x, ok := x.GetEvent().(*MonitorResponse_Acquired); ok { + return x.Acquired + } + return nil +} + +func (x *MonitorResponse) GetExtended() *LockExtendedEvent { + if x, ok := x.GetEvent().(*MonitorResponse_Extended); ok { + return x.Extended + } + return nil +} + +func (x *MonitorResponse) GetReleased() *LockReleasedEvent { + if x, ok := x.GetEvent().(*MonitorResponse_Released); ok { + return x.Released + } + return nil +} + +type isMonitorResponse_Event interface { + isMonitorResponse_Event() +} + +type MonitorResponse_Acquired struct { + // * + // A lock was acquired. + Acquired *LockAcquiredEvent `protobuf:"bytes,2,opt,name=acquired,proto3,oneof"` +} + +type MonitorResponse_Extended struct { + // * + // A lock was extended. + Extended *LockExtendedEvent `protobuf:"bytes,3,opt,name=extended,proto3,oneof"` +} + +type MonitorResponse_Released struct { + // * + // A lock was released. + Released *LockReleasedEvent `protobuf:"bytes,4,opt,name=released,proto3,oneof"` +} + +func (*MonitorResponse_Acquired) isMonitorResponse_Event() {} + +func (*MonitorResponse_Extended) isMonitorResponse_Event() {} + +func (*MonitorResponse_Released) isMonitorResponse_Event() {} + +// * +// Request to get the history of a lock or many locks. +type HistoryRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // * + // Name of the lock to get the history of. If empty, all locks will be + // monitored. + Name []string `protobuf:"bytes,1,rep,name=name,proto3" json:"name,omitempty"` + // * + // Maximum number of events to return. If empty, all events will be + // returned. + Limit *uint32 `protobuf:"varint,2,opt,name=limit,proto3,oneof" json:"limit,omitempty"` + // * + // If set, only events after this timestamp will be returned. + After *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=after,proto3,oneof" json:"after,omitempty"` +} + +func (x *HistoryRequest) Reset() { + *x = HistoryRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_windshift_locks_v1alpha1_service_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HistoryRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HistoryRequest) ProtoMessage() {} + +func (x *HistoryRequest) ProtoReflect() protoreflect.Message { + mi := &file_windshift_locks_v1alpha1_service_proto_msgTypes[7] + 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 HistoryRequest.ProtoReflect.Descriptor instead. +func (*HistoryRequest) Descriptor() ([]byte, []int) { + return file_windshift_locks_v1alpha1_service_proto_rawDescGZIP(), []int{7} +} + +func (x *HistoryRequest) GetName() []string { + if x != nil { + return x.Name + } + return nil +} + +func (x *HistoryRequest) GetLimit() uint32 { + if x != nil && x.Limit != nil { + return *x.Limit + } + return 0 +} + +func (x *HistoryRequest) GetAfter() *timestamppb.Timestamp { + if x != nil { + return x.After + } + return nil +} + +type HistoryResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // * + // Timestamp of the event. + Timestamp *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + // Types that are assignable to Event: + // + // *HistoryResponse_Acquired + // *HistoryResponse_Extended + // *HistoryResponse_Released + Event isHistoryResponse_Event `protobuf_oneof:"event"` +} + +func (x *HistoryResponse) Reset() { + *x = HistoryResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_windshift_locks_v1alpha1_service_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HistoryResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HistoryResponse) ProtoMessage() {} + +func (x *HistoryResponse) ProtoReflect() protoreflect.Message { + mi := &file_windshift_locks_v1alpha1_service_proto_msgTypes[8] + 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 HistoryResponse.ProtoReflect.Descriptor instead. +func (*HistoryResponse) Descriptor() ([]byte, []int) { + return file_windshift_locks_v1alpha1_service_proto_rawDescGZIP(), []int{8} +} + +func (x *HistoryResponse) GetTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.Timestamp + } + return nil +} + +func (m *HistoryResponse) GetEvent() isHistoryResponse_Event { + if m != nil { + return m.Event + } + return nil +} + +func (x *HistoryResponse) GetAcquired() *LockAcquiredEvent { + if x, ok := x.GetEvent().(*HistoryResponse_Acquired); ok { + return x.Acquired + } + return nil +} + +func (x *HistoryResponse) GetExtended() *LockExtendedEvent { + if x, ok := x.GetEvent().(*HistoryResponse_Extended); ok { + return x.Extended + } + return nil +} + +func (x *HistoryResponse) GetReleased() *LockReleasedEvent { + if x, ok := x.GetEvent().(*HistoryResponse_Released); ok { + return x.Released + } + return nil +} + +type isHistoryResponse_Event interface { + isHistoryResponse_Event() +} + +type HistoryResponse_Acquired struct { + // * + // A lock was acquired. + Acquired *LockAcquiredEvent `protobuf:"bytes,2,opt,name=acquired,proto3,oneof"` +} + +type HistoryResponse_Extended struct { + // * + // A lock was extended. + Extended *LockExtendedEvent `protobuf:"bytes,3,opt,name=extended,proto3,oneof"` +} + +type HistoryResponse_Released struct { + // * + // A lock was released. + Released *LockReleasedEvent `protobuf:"bytes,4,opt,name=released,proto3,oneof"` +} + +func (*HistoryResponse_Acquired) isHistoryResponse_Event() {} + +func (*HistoryResponse_Extended) isHistoryResponse_Event() {} + +func (*HistoryResponse_Released) isHistoryResponse_Event() {} + +// * +// Acquire a new lock. If the lock is already held, this request will +// fail with a `Rejected` response. +type LockRequest_Acquire struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // * + // Name of the lock to acquire. Names are globally unique, and must + // match the regex `[a-zA-Z0-9_-]+`. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // * + // Expires is the timestamp at which the lock will expire on its own + // if it is not extended or released. It is recommended to keep this + // value small, and extend the lock at an interval smaller than this + // value. + Expires *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=expires,proto3" json:"expires,omitempty"` + // * + // Maximum time to wait before giving up on acquiring the lock. This + // lets the client simplify its logic by not having to handle retries + // itself. If the lock is not acquired before this timeout, the + // request will fail with a `Rejected` response. + Timeout *durationpb.Duration `protobuf:"bytes,3,opt,name=timeout,proto3,oneof" json:"timeout,omitempty"` +} + +func (x *LockRequest_Acquire) Reset() { + *x = LockRequest_Acquire{} + if protoimpl.UnsafeEnabled { + mi := &file_windshift_locks_v1alpha1_service_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LockRequest_Acquire) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LockRequest_Acquire) ProtoMessage() {} + +func (x *LockRequest_Acquire) ProtoReflect() protoreflect.Message { + mi := &file_windshift_locks_v1alpha1_service_proto_msgTypes[9] + 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 LockRequest_Acquire.ProtoReflect.Descriptor instead. +func (*LockRequest_Acquire) Descriptor() ([]byte, []int) { + return file_windshift_locks_v1alpha1_service_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *LockRequest_Acquire) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *LockRequest_Acquire) GetExpires() *timestamppb.Timestamp { + if x != nil { + return x.Expires + } + return nil +} + +func (x *LockRequest_Acquire) GetTimeout() *durationpb.Duration { + if x != nil { + return x.Timeout + } + return nil +} + +// * +// Extend the duration of a lock you already hold. If the lock is not +// held, this request will fail with a `Rejected` response. +type LockRequest_Extend struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // * + // Name of the lock to extend, must match the name of the lock you + // already acquired with an `Acquire` request. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // * + // Token is the token returned by the `Acquire` request. It is used + // to verify that you are the owner of the lock you are trying to + // extend. + Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` + // * + // Expires is the new timestamp at which the lock will expire on its + // own if it is not extended or released. See the `Acquire` request + // for more information. + Expires *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=expires,proto3" json:"expires,omitempty"` +} + +func (x *LockRequest_Extend) Reset() { + *x = LockRequest_Extend{} + if protoimpl.UnsafeEnabled { + mi := &file_windshift_locks_v1alpha1_service_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LockRequest_Extend) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LockRequest_Extend) ProtoMessage() {} + +func (x *LockRequest_Extend) ProtoReflect() protoreflect.Message { + mi := &file_windshift_locks_v1alpha1_service_proto_msgTypes[10] + 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 LockRequest_Extend.ProtoReflect.Descriptor instead. +func (*LockRequest_Extend) Descriptor() ([]byte, []int) { + return file_windshift_locks_v1alpha1_service_proto_rawDescGZIP(), []int{0, 1} +} + +func (x *LockRequest_Extend) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *LockRequest_Extend) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +func (x *LockRequest_Extend) GetExpires() *timestamppb.Timestamp { + if x != nil { + return x.Expires + } + return nil +} + +// * +// Release a lock you already hold. If the lock is not held, this request +// will fail with a `Rejected` response. +type LockRequest_Release struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // * + // Name of the lock to release, must match the name of the lock you + // already acquired with an `Acquire` request. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // * + // Token is the token returned by the `Acquire` request. It is used + // to verify that you are the owner of the lock you are trying to + // release. + Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` +} + +func (x *LockRequest_Release) Reset() { + *x = LockRequest_Release{} + if protoimpl.UnsafeEnabled { + mi := &file_windshift_locks_v1alpha1_service_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LockRequest_Release) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LockRequest_Release) ProtoMessage() {} + +func (x *LockRequest_Release) ProtoReflect() protoreflect.Message { + mi := &file_windshift_locks_v1alpha1_service_proto_msgTypes[11] + 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 LockRequest_Release.ProtoReflect.Descriptor instead. +func (*LockRequest_Release) Descriptor() ([]byte, []int) { + return file_windshift_locks_v1alpha1_service_proto_rawDescGZIP(), []int{0, 2} +} + +func (x *LockRequest_Release) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *LockRequest_Release) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +// * +// Acquired is sent when a lock is successfully acquired or extended. It +// contains the name of the lock, and a token that can be used to extend or +// release the lock. +type LockResponse_Acquired struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // * + // Name of the lock that was acquired. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // * + // Token is used to verify that you are the owner of the lock you are + // trying to extend or release. + Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` +} + +func (x *LockResponse_Acquired) Reset() { + *x = LockResponse_Acquired{} + if protoimpl.UnsafeEnabled { + mi := &file_windshift_locks_v1alpha1_service_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LockResponse_Acquired) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LockResponse_Acquired) ProtoMessage() {} + +func (x *LockResponse_Acquired) ProtoReflect() protoreflect.Message { + mi := &file_windshift_locks_v1alpha1_service_proto_msgTypes[12] + 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 LockResponse_Acquired.ProtoReflect.Descriptor instead. +func (*LockResponse_Acquired) Descriptor() ([]byte, []int) { + return file_windshift_locks_v1alpha1_service_proto_rawDescGZIP(), []int{1, 0} +} + +func (x *LockResponse_Acquired) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *LockResponse_Acquired) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +// * +// Extended is sent when a lock is successfully extended. +type LockResponse_Extended struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *LockResponse_Extended) Reset() { + *x = LockResponse_Extended{} + if protoimpl.UnsafeEnabled { + mi := &file_windshift_locks_v1alpha1_service_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LockResponse_Extended) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LockResponse_Extended) ProtoMessage() {} + +func (x *LockResponse_Extended) ProtoReflect() protoreflect.Message { + mi := &file_windshift_locks_v1alpha1_service_proto_msgTypes[13] + 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 LockResponse_Extended.ProtoReflect.Descriptor instead. +func (*LockResponse_Extended) Descriptor() ([]byte, []int) { + return file_windshift_locks_v1alpha1_service_proto_rawDescGZIP(), []int{1, 1} +} + +func (x *LockResponse_Extended) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +// * +// Released is sent when a lock is successfully released. +type LockResponse_Released struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *LockResponse_Released) Reset() { + *x = LockResponse_Released{} + if protoimpl.UnsafeEnabled { + mi := &file_windshift_locks_v1alpha1_service_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LockResponse_Released) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LockResponse_Released) ProtoMessage() {} + +func (x *LockResponse_Released) ProtoReflect() protoreflect.Message { + mi := &file_windshift_locks_v1alpha1_service_proto_msgTypes[14] + 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 LockResponse_Released.ProtoReflect.Descriptor instead. +func (*LockResponse_Released) Descriptor() ([]byte, []int) { + return file_windshift_locks_v1alpha1_service_proto_rawDescGZIP(), []int{1, 2} +} + +func (x *LockResponse_Released) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type LockResponse_Rejected struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // * + // Name of the lock that was rejected. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // * + // The time the lock will expire. + Expires *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=expires,proto3" json:"expires,omitempty"` +} + +func (x *LockResponse_Rejected) Reset() { + *x = LockResponse_Rejected{} + if protoimpl.UnsafeEnabled { + mi := &file_windshift_locks_v1alpha1_service_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LockResponse_Rejected) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LockResponse_Rejected) ProtoMessage() {} + +func (x *LockResponse_Rejected) ProtoReflect() protoreflect.Message { + mi := &file_windshift_locks_v1alpha1_service_proto_msgTypes[15] + 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 LockResponse_Rejected.ProtoReflect.Descriptor instead. +func (*LockResponse_Rejected) Descriptor() ([]byte, []int) { + return file_windshift_locks_v1alpha1_service_proto_rawDescGZIP(), []int{1, 3} +} + +func (x *LockResponse_Rejected) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *LockResponse_Rejected) GetExpires() *timestamppb.Timestamp { + if x != nil { + return x.Expires + } + return nil +} + +var File_windshift_locks_v1alpha1_service_proto protoreflect.FileDescriptor + +var file_windshift_locks_v1alpha1_service_proto_rawDesc = []byte{ + 0x0a, 0x26, 0x77, 0x69, 0x6e, 0x64, 0x73, 0x68, 0x69, 0x66, 0x74, 0x2f, 0x6c, 0x6f, 0x63, 0x6b, + 0x73, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x18, 0x77, 0x69, 0x6e, 0x64, 0x73, 0x68, + 0x69, 0x66, 0x74, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0xae, 0x04, 0x0a, 0x0b, 0x4c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x49, 0x0a, 0x07, 0x61, 0x63, 0x71, 0x75, 0x69, 0x72, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x73, 0x68, 0x69, 0x66, 0x74, + 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x4c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x41, 0x63, 0x71, 0x75, + 0x69, 0x72, 0x65, 0x48, 0x00, 0x52, 0x07, 0x61, 0x63, 0x71, 0x75, 0x69, 0x72, 0x65, 0x12, 0x46, + 0x0a, 0x06, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, + 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x73, 0x68, 0x69, 0x66, 0x74, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x73, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x6f, 0x63, 0x6b, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x48, 0x00, 0x52, 0x06, + 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x12, 0x49, 0x0a, 0x07, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x73, 0x68, + 0x69, 0x66, 0x74, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x4c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x52, + 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x48, 0x00, 0x52, 0x07, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, + 0x65, 0x1a, 0x99, 0x01, 0x0a, 0x07, 0x41, 0x63, 0x71, 0x75, 0x69, 0x72, 0x65, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x34, 0x0a, 0x07, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, + 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, + 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x88, 0x01, + 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x1a, 0x68, 0x0a, + 0x06, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x12, 0x34, 0x0a, 0x07, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, + 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x1a, 0x33, 0x0a, 0x07, 0x52, 0x65, 0x6c, 0x65, 0x61, + 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x06, 0x0a, 0x04, + 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x9e, 0x04, 0x0a, 0x0c, 0x4c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x08, 0x61, 0x63, 0x71, 0x75, 0x69, 0x72, 0x65, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x73, 0x68, + 0x69, 0x66, 0x74, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x4c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, + 0x41, 0x63, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x48, 0x00, 0x52, 0x08, 0x61, 0x63, 0x71, 0x75, + 0x69, 0x72, 0x65, 0x64, 0x12, 0x4d, 0x0a, 0x08, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x73, 0x68, 0x69, + 0x66, 0x74, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x4c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x45, + 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x48, 0x00, 0x52, 0x08, 0x65, 0x78, 0x74, 0x65, 0x6e, + 0x64, 0x65, 0x64, 0x12, 0x4d, 0x0a, 0x08, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x73, 0x68, 0x69, 0x66, + 0x74, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x4c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, + 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x48, 0x00, 0x52, 0x08, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, + 0x65, 0x64, 0x12, 0x4d, 0x0a, 0x08, 0x72, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x65, 0x64, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x73, 0x68, 0x69, 0x66, 0x74, + 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x4c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x6a, + 0x65, 0x63, 0x74, 0x65, 0x64, 0x48, 0x00, 0x52, 0x08, 0x72, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x65, + 0x64, 0x1a, 0x34, 0x0a, 0x08, 0x41, 0x63, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x1a, 0x1e, 0x0a, 0x08, 0x45, 0x78, 0x74, 0x65, 0x6e, + 0x64, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x1a, 0x1e, 0x0a, 0x08, 0x52, 0x65, 0x6c, 0x65, 0x61, + 0x73, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x1a, 0x54, 0x0a, 0x08, 0x52, 0x65, 0x6a, 0x65, 0x63, + 0x74, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x34, 0x0a, 0x07, 0x65, 0x78, 0x70, 0x69, 0x72, + 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x42, 0x06, 0x0a, + 0x04, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x73, 0x0a, 0x11, 0x4c, 0x6f, 0x63, 0x6b, 0x41, 0x63, 0x71, + 0x75, 0x69, 0x72, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, + 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, + 0x77, 0x6e, 0x65, 0x72, 0x12, 0x34, 0x0a, 0x07, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x52, 0x07, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x22, 0x73, 0x0a, 0x11, 0x4c, 0x6f, + 0x63, 0x6b, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x34, 0x0a, 0x07, 0x65, 0x78, 0x70, + 0x69, 0x72, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x22, + 0x3d, 0x0a, 0x11, 0x4c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, + 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x22, 0x24, + 0x0a, 0x0e, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xb5, 0x02, 0x0a, 0x0f, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x12, 0x49, 0x0a, 0x08, 0x61, 0x63, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x73, 0x68, 0x69, 0x66, 0x74, + 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x4c, 0x6f, 0x63, 0x6b, 0x41, 0x63, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x48, 0x00, 0x52, 0x08, 0x61, 0x63, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x12, 0x49, 0x0a, + 0x08, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x2b, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x73, 0x68, 0x69, 0x66, 0x74, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, + 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x6f, 0x63, 0x6b, 0x45, + 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x08, + 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x12, 0x49, 0x0a, 0x08, 0x72, 0x65, 0x6c, 0x65, + 0x61, 0x73, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x77, 0x69, 0x6e, + 0x64, 0x73, 0x68, 0x69, 0x66, 0x74, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, + 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x08, 0x72, 0x65, 0x6c, 0x65, 0x61, + 0x73, 0x65, 0x64, 0x42, 0x07, 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x22, 0x8a, 0x01, 0x0a, + 0x0e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0d, 0x48, 0x00, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x88, 0x01, 0x01, 0x12, 0x35, + 0x0a, 0x05, 0x61, 0x66, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x01, 0x52, 0x05, 0x61, 0x66, 0x74, + 0x65, 0x72, 0x88, 0x01, 0x01, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x42, + 0x08, 0x0a, 0x06, 0x5f, 0x61, 0x66, 0x74, 0x65, 0x72, 0x22, 0xb5, 0x02, 0x0a, 0x0f, 0x48, 0x69, + 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, + 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x49, 0x0a, 0x08, 0x61, 0x63, 0x71, 0x75, 0x69, + 0x72, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x77, 0x69, 0x6e, 0x64, + 0x73, 0x68, 0x69, 0x66, 0x74, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x6f, 0x63, 0x6b, 0x41, 0x63, 0x71, 0x75, 0x69, 0x72, 0x65, + 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x08, 0x61, 0x63, 0x71, 0x75, 0x69, 0x72, + 0x65, 0x64, 0x12, 0x49, 0x0a, 0x08, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x73, 0x68, 0x69, 0x66, 0x74, + 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x4c, 0x6f, 0x63, 0x6b, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x48, 0x00, 0x52, 0x08, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x12, 0x49, 0x0a, + 0x08, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x2b, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x73, 0x68, 0x69, 0x66, 0x74, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, + 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x6f, 0x63, 0x6b, 0x52, + 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x08, + 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x42, 0x07, 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, + 0x74, 0x32, 0xad, 0x02, 0x0a, 0x0c, 0x4c, 0x6f, 0x63, 0x6b, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x59, 0x0a, 0x04, 0x4c, 0x6f, 0x63, 0x6b, 0x12, 0x25, 0x2e, 0x77, 0x69, 0x6e, + 0x64, 0x73, 0x68, 0x69, 0x66, 0x74, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x26, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x73, 0x68, 0x69, 0x66, 0x74, 0x2e, 0x6c, 0x6f, + 0x63, 0x6b, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x6f, 0x63, + 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x12, 0x60, 0x0a, + 0x07, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x12, 0x28, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x73, + 0x68, 0x69, 0x66, 0x74, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x73, 0x68, 0x69, 0x66, 0x74, 0x2e, 0x6c, + 0x6f, 0x63, 0x6b, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x6f, + 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, + 0x60, 0x0a, 0x07, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x28, 0x2e, 0x77, 0x69, 0x6e, + 0x64, 0x73, 0x68, 0x69, 0x66, 0x74, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x73, 0x68, 0x69, 0x66, 0x74, + 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, + 0x01, 0x42, 0xf7, 0x01, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x73, 0x68, + 0x69, 0x66, 0x74, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x42, 0x0c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x47, 0x77, 0x69, 0x6e, 0x64, 0x73, 0x68, 0x69, 0x66, 0x74, 0x2f, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x77, 0x69, 0x6e, 0x64, 0x73, 0x68, 0x69, 0x66, 0x74, 0x2f, 0x6c, + 0x6f, 0x63, 0x6b, 0x73, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x6c, 0x6f, + 0x63, 0x6b, 0x73, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x57, 0x4c, + 0x58, 0xaa, 0x02, 0x18, 0x57, 0x69, 0x6e, 0x64, 0x73, 0x68, 0x69, 0x66, 0x74, 0x2e, 0x4c, 0x6f, + 0x63, 0x6b, 0x73, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x18, 0x57, + 0x69, 0x6e, 0x64, 0x73, 0x68, 0x69, 0x66, 0x74, 0x5c, 0x4c, 0x6f, 0x63, 0x6b, 0x73, 0x5c, 0x56, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, 0x24, 0x57, 0x69, 0x6e, 0x64, 0x73, 0x68, + 0x69, 0x66, 0x74, 0x5c, 0x4c, 0x6f, 0x63, 0x6b, 0x73, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x1a, 0x57, 0x69, 0x6e, 0x64, 0x73, 0x68, 0x69, 0x66, 0x74, 0x3a, 0x3a, 0x4c, 0x6f, 0x63, 0x6b, + 0x73, 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_windshift_locks_v1alpha1_service_proto_rawDescOnce sync.Once + file_windshift_locks_v1alpha1_service_proto_rawDescData = file_windshift_locks_v1alpha1_service_proto_rawDesc +) + +func file_windshift_locks_v1alpha1_service_proto_rawDescGZIP() []byte { + file_windshift_locks_v1alpha1_service_proto_rawDescOnce.Do(func() { + file_windshift_locks_v1alpha1_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_windshift_locks_v1alpha1_service_proto_rawDescData) + }) + return file_windshift_locks_v1alpha1_service_proto_rawDescData +} + +var file_windshift_locks_v1alpha1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 16) +var file_windshift_locks_v1alpha1_service_proto_goTypes = []interface{}{ + (*LockRequest)(nil), // 0: windshift.locks.v1alpha1.LockRequest + (*LockResponse)(nil), // 1: windshift.locks.v1alpha1.LockResponse + (*LockAcquiredEvent)(nil), // 2: windshift.locks.v1alpha1.LockAcquiredEvent + (*LockExtendedEvent)(nil), // 3: windshift.locks.v1alpha1.LockExtendedEvent + (*LockReleasedEvent)(nil), // 4: windshift.locks.v1alpha1.LockReleasedEvent + (*MonitorRequest)(nil), // 5: windshift.locks.v1alpha1.MonitorRequest + (*MonitorResponse)(nil), // 6: windshift.locks.v1alpha1.MonitorResponse + (*HistoryRequest)(nil), // 7: windshift.locks.v1alpha1.HistoryRequest + (*HistoryResponse)(nil), // 8: windshift.locks.v1alpha1.HistoryResponse + (*LockRequest_Acquire)(nil), // 9: windshift.locks.v1alpha1.LockRequest.Acquire + (*LockRequest_Extend)(nil), // 10: windshift.locks.v1alpha1.LockRequest.Extend + (*LockRequest_Release)(nil), // 11: windshift.locks.v1alpha1.LockRequest.Release + (*LockResponse_Acquired)(nil), // 12: windshift.locks.v1alpha1.LockResponse.Acquired + (*LockResponse_Extended)(nil), // 13: windshift.locks.v1alpha1.LockResponse.Extended + (*LockResponse_Released)(nil), // 14: windshift.locks.v1alpha1.LockResponse.Released + (*LockResponse_Rejected)(nil), // 15: windshift.locks.v1alpha1.LockResponse.Rejected + (*timestamppb.Timestamp)(nil), // 16: google.protobuf.Timestamp + (*durationpb.Duration)(nil), // 17: google.protobuf.Duration +} +var file_windshift_locks_v1alpha1_service_proto_depIdxs = []int32{ + 9, // 0: windshift.locks.v1alpha1.LockRequest.acquire:type_name -> windshift.locks.v1alpha1.LockRequest.Acquire + 10, // 1: windshift.locks.v1alpha1.LockRequest.extend:type_name -> windshift.locks.v1alpha1.LockRequest.Extend + 11, // 2: windshift.locks.v1alpha1.LockRequest.release:type_name -> windshift.locks.v1alpha1.LockRequest.Release + 12, // 3: windshift.locks.v1alpha1.LockResponse.acquired:type_name -> windshift.locks.v1alpha1.LockResponse.Acquired + 13, // 4: windshift.locks.v1alpha1.LockResponse.extended:type_name -> windshift.locks.v1alpha1.LockResponse.Extended + 14, // 5: windshift.locks.v1alpha1.LockResponse.released:type_name -> windshift.locks.v1alpha1.LockResponse.Released + 15, // 6: windshift.locks.v1alpha1.LockResponse.rejected:type_name -> windshift.locks.v1alpha1.LockResponse.Rejected + 16, // 7: windshift.locks.v1alpha1.LockAcquiredEvent.expires:type_name -> google.protobuf.Timestamp + 16, // 8: windshift.locks.v1alpha1.LockExtendedEvent.expires:type_name -> google.protobuf.Timestamp + 16, // 9: windshift.locks.v1alpha1.MonitorResponse.timestamp:type_name -> google.protobuf.Timestamp + 2, // 10: windshift.locks.v1alpha1.MonitorResponse.acquired:type_name -> windshift.locks.v1alpha1.LockAcquiredEvent + 3, // 11: windshift.locks.v1alpha1.MonitorResponse.extended:type_name -> windshift.locks.v1alpha1.LockExtendedEvent + 4, // 12: windshift.locks.v1alpha1.MonitorResponse.released:type_name -> windshift.locks.v1alpha1.LockReleasedEvent + 16, // 13: windshift.locks.v1alpha1.HistoryRequest.after:type_name -> google.protobuf.Timestamp + 16, // 14: windshift.locks.v1alpha1.HistoryResponse.timestamp:type_name -> google.protobuf.Timestamp + 2, // 15: windshift.locks.v1alpha1.HistoryResponse.acquired:type_name -> windshift.locks.v1alpha1.LockAcquiredEvent + 3, // 16: windshift.locks.v1alpha1.HistoryResponse.extended:type_name -> windshift.locks.v1alpha1.LockExtendedEvent + 4, // 17: windshift.locks.v1alpha1.HistoryResponse.released:type_name -> windshift.locks.v1alpha1.LockReleasedEvent + 16, // 18: windshift.locks.v1alpha1.LockRequest.Acquire.expires:type_name -> google.protobuf.Timestamp + 17, // 19: windshift.locks.v1alpha1.LockRequest.Acquire.timeout:type_name -> google.protobuf.Duration + 16, // 20: windshift.locks.v1alpha1.LockRequest.Extend.expires:type_name -> google.protobuf.Timestamp + 16, // 21: windshift.locks.v1alpha1.LockResponse.Rejected.expires:type_name -> google.protobuf.Timestamp + 0, // 22: windshift.locks.v1alpha1.LocksService.Lock:input_type -> windshift.locks.v1alpha1.LockRequest + 5, // 23: windshift.locks.v1alpha1.LocksService.Monitor:input_type -> windshift.locks.v1alpha1.MonitorRequest + 7, // 24: windshift.locks.v1alpha1.LocksService.History:input_type -> windshift.locks.v1alpha1.HistoryRequest + 1, // 25: windshift.locks.v1alpha1.LocksService.Lock:output_type -> windshift.locks.v1alpha1.LockResponse + 6, // 26: windshift.locks.v1alpha1.LocksService.Monitor:output_type -> windshift.locks.v1alpha1.MonitorResponse + 8, // 27: windshift.locks.v1alpha1.LocksService.History:output_type -> windshift.locks.v1alpha1.HistoryResponse + 25, // [25:28] is the sub-list for method output_type + 22, // [22:25] is the sub-list for method input_type + 22, // [22:22] is the sub-list for extension type_name + 22, // [22:22] is the sub-list for extension extendee + 0, // [0:22] is the sub-list for field type_name +} + +func init() { file_windshift_locks_v1alpha1_service_proto_init() } +func file_windshift_locks_v1alpha1_service_proto_init() { + if File_windshift_locks_v1alpha1_service_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_windshift_locks_v1alpha1_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LockRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_windshift_locks_v1alpha1_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LockResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_windshift_locks_v1alpha1_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LockAcquiredEvent); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_windshift_locks_v1alpha1_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LockExtendedEvent); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_windshift_locks_v1alpha1_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LockReleasedEvent); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_windshift_locks_v1alpha1_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MonitorRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_windshift_locks_v1alpha1_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MonitorResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_windshift_locks_v1alpha1_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HistoryRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_windshift_locks_v1alpha1_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HistoryResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_windshift_locks_v1alpha1_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LockRequest_Acquire); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_windshift_locks_v1alpha1_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LockRequest_Extend); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_windshift_locks_v1alpha1_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LockRequest_Release); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_windshift_locks_v1alpha1_service_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LockResponse_Acquired); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_windshift_locks_v1alpha1_service_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LockResponse_Extended); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_windshift_locks_v1alpha1_service_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LockResponse_Released); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_windshift_locks_v1alpha1_service_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LockResponse_Rejected); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_windshift_locks_v1alpha1_service_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*LockRequest_Acquire_)(nil), + (*LockRequest_Extend_)(nil), + (*LockRequest_Release_)(nil), + } + file_windshift_locks_v1alpha1_service_proto_msgTypes[1].OneofWrappers = []interface{}{ + (*LockResponse_Acquired_)(nil), + (*LockResponse_Extended_)(nil), + (*LockResponse_Released_)(nil), + (*LockResponse_Rejected_)(nil), + } + file_windshift_locks_v1alpha1_service_proto_msgTypes[6].OneofWrappers = []interface{}{ + (*MonitorResponse_Acquired)(nil), + (*MonitorResponse_Extended)(nil), + (*MonitorResponse_Released)(nil), + } + file_windshift_locks_v1alpha1_service_proto_msgTypes[7].OneofWrappers = []interface{}{} + file_windshift_locks_v1alpha1_service_proto_msgTypes[8].OneofWrappers = []interface{}{ + (*HistoryResponse_Acquired)(nil), + (*HistoryResponse_Extended)(nil), + (*HistoryResponse_Released)(nil), + } + file_windshift_locks_v1alpha1_service_proto_msgTypes[9].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_windshift_locks_v1alpha1_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 16, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_windshift_locks_v1alpha1_service_proto_goTypes, + DependencyIndexes: file_windshift_locks_v1alpha1_service_proto_depIdxs, + MessageInfos: file_windshift_locks_v1alpha1_service_proto_msgTypes, + }.Build() + File_windshift_locks_v1alpha1_service_proto = out.File + file_windshift_locks_v1alpha1_service_proto_rawDesc = nil + file_windshift_locks_v1alpha1_service_proto_goTypes = nil + file_windshift_locks_v1alpha1_service_proto_depIdxs = nil +} diff --git a/internal/proto/windshift/locks/v1alpha1/service_vtproto.pb.go b/internal/proto/windshift/locks/v1alpha1/service_vtproto.pb.go new file mode 100644 index 0000000..58ab9f3 --- /dev/null +++ b/internal/proto/windshift/locks/v1alpha1/service_vtproto.pb.go @@ -0,0 +1,4379 @@ +// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. +// protoc-gen-go-vtproto version: v0.4.0 +// source: windshift/locks/v1alpha1/service.proto + +package locksv1alpha1 + +import ( + context "context" + fmt "fmt" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + proto "google.golang.org/protobuf/proto" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + durationpb "google.golang.org/protobuf/types/known/durationpb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + io "io" + bits "math/bits" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// LocksServiceClient is the client API for LocksService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type LocksServiceClient interface { + // * + // Open a stream that will let you acquire locks, extend them or release + // them. + Lock(ctx context.Context, opts ...grpc.CallOption) (LocksService_LockClient, error) + // * + // Monitor the state of a lock. This will send a message every time the + // lock is acquired, extended or released. + Monitor(ctx context.Context, in *MonitorRequest, opts ...grpc.CallOption) (LocksService_MonitorClient, error) + // * + // Get the history of a lock. Similar to `Monitor`, but will send the + // entire history of the lock, and then close the stream. + History(ctx context.Context, in *HistoryRequest, opts ...grpc.CallOption) (LocksService_HistoryClient, error) +} + +type locksServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewLocksServiceClient(cc grpc.ClientConnInterface) LocksServiceClient { + return &locksServiceClient{cc} +} + +func (c *locksServiceClient) Lock(ctx context.Context, opts ...grpc.CallOption) (LocksService_LockClient, error) { + stream, err := c.cc.NewStream(ctx, &LocksService_ServiceDesc.Streams[0], "/windshift.locks.v1alpha1.LocksService/Lock", opts...) + if err != nil { + return nil, err + } + x := &locksServiceLockClient{stream} + return x, nil +} + +type LocksService_LockClient interface { + Send(*LockRequest) error + Recv() (*LockResponse, error) + grpc.ClientStream +} + +type locksServiceLockClient struct { + grpc.ClientStream +} + +func (x *locksServiceLockClient) Send(m *LockRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *locksServiceLockClient) Recv() (*LockResponse, error) { + m := new(LockResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *locksServiceClient) Monitor(ctx context.Context, in *MonitorRequest, opts ...grpc.CallOption) (LocksService_MonitorClient, error) { + stream, err := c.cc.NewStream(ctx, &LocksService_ServiceDesc.Streams[1], "/windshift.locks.v1alpha1.LocksService/Monitor", opts...) + if err != nil { + return nil, err + } + x := &locksServiceMonitorClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type LocksService_MonitorClient interface { + Recv() (*MonitorResponse, error) + grpc.ClientStream +} + +type locksServiceMonitorClient struct { + grpc.ClientStream +} + +func (x *locksServiceMonitorClient) Recv() (*MonitorResponse, error) { + m := new(MonitorResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *locksServiceClient) History(ctx context.Context, in *HistoryRequest, opts ...grpc.CallOption) (LocksService_HistoryClient, error) { + stream, err := c.cc.NewStream(ctx, &LocksService_ServiceDesc.Streams[2], "/windshift.locks.v1alpha1.LocksService/History", opts...) + if err != nil { + return nil, err + } + x := &locksServiceHistoryClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type LocksService_HistoryClient interface { + Recv() (*HistoryResponse, error) + grpc.ClientStream +} + +type locksServiceHistoryClient struct { + grpc.ClientStream +} + +func (x *locksServiceHistoryClient) Recv() (*HistoryResponse, error) { + m := new(HistoryResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// LocksServiceServer is the server API for LocksService service. +// All implementations must embed UnimplementedLocksServiceServer +// for forward compatibility +type LocksServiceServer interface { + // * + // Open a stream that will let you acquire locks, extend them or release + // them. + Lock(LocksService_LockServer) error + // * + // Monitor the state of a lock. This will send a message every time the + // lock is acquired, extended or released. + Monitor(*MonitorRequest, LocksService_MonitorServer) error + // * + // Get the history of a lock. Similar to `Monitor`, but will send the + // entire history of the lock, and then close the stream. + History(*HistoryRequest, LocksService_HistoryServer) error + mustEmbedUnimplementedLocksServiceServer() +} + +// UnimplementedLocksServiceServer must be embedded to have forward compatible implementations. +type UnimplementedLocksServiceServer struct { +} + +func (UnimplementedLocksServiceServer) Lock(LocksService_LockServer) error { + return status.Errorf(codes.Unimplemented, "method Lock not implemented") +} +func (UnimplementedLocksServiceServer) Monitor(*MonitorRequest, LocksService_MonitorServer) error { + return status.Errorf(codes.Unimplemented, "method Monitor not implemented") +} +func (UnimplementedLocksServiceServer) History(*HistoryRequest, LocksService_HistoryServer) error { + return status.Errorf(codes.Unimplemented, "method History not implemented") +} +func (UnimplementedLocksServiceServer) mustEmbedUnimplementedLocksServiceServer() {} + +// UnsafeLocksServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to LocksServiceServer will +// result in compilation errors. +type UnsafeLocksServiceServer interface { + mustEmbedUnimplementedLocksServiceServer() +} + +func RegisterLocksServiceServer(s grpc.ServiceRegistrar, srv LocksServiceServer) { + s.RegisterService(&LocksService_ServiceDesc, srv) +} + +func _LocksService_Lock_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(LocksServiceServer).Lock(&locksServiceLockServer{stream}) +} + +type LocksService_LockServer interface { + Send(*LockResponse) error + Recv() (*LockRequest, error) + grpc.ServerStream +} + +type locksServiceLockServer struct { + grpc.ServerStream +} + +func (x *locksServiceLockServer) Send(m *LockResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *locksServiceLockServer) Recv() (*LockRequest, error) { + m := new(LockRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _LocksService_Monitor_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(MonitorRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(LocksServiceServer).Monitor(m, &locksServiceMonitorServer{stream}) +} + +type LocksService_MonitorServer interface { + Send(*MonitorResponse) error + grpc.ServerStream +} + +type locksServiceMonitorServer struct { + grpc.ServerStream +} + +func (x *locksServiceMonitorServer) Send(m *MonitorResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _LocksService_History_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(HistoryRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(LocksServiceServer).History(m, &locksServiceHistoryServer{stream}) +} + +type LocksService_HistoryServer interface { + Send(*HistoryResponse) error + grpc.ServerStream +} + +type locksServiceHistoryServer struct { + grpc.ServerStream +} + +func (x *locksServiceHistoryServer) Send(m *HistoryResponse) error { + return x.ServerStream.SendMsg(m) +} + +// LocksService_ServiceDesc is the grpc.ServiceDesc for LocksService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var LocksService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "windshift.locks.v1alpha1.LocksService", + HandlerType: (*LocksServiceServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "Lock", + Handler: _LocksService_Lock_Handler, + ServerStreams: true, + ClientStreams: true, + }, + { + StreamName: "Monitor", + Handler: _LocksService_Monitor_Handler, + ServerStreams: true, + }, + { + StreamName: "History", + Handler: _LocksService_History_Handler, + ServerStreams: true, + }, + }, + Metadata: "windshift/locks/v1alpha1/service.proto", +} + +func (m *LockRequest_Acquire) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LockRequest_Acquire) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LockRequest_Acquire) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Timeout != nil { + if vtmsg, ok := interface{}(m.Timeout).(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.Timeout) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = encodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0x1a + } + if m.Expires != nil { + if vtmsg, ok := interface{}(m.Expires).(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.Expires) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = encodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarint(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *LockRequest_Extend) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LockRequest_Extend) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LockRequest_Extend) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Expires != nil { + if vtmsg, ok := interface{}(m.Expires).(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.Expires) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = encodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Token) > 0 { + i -= len(m.Token) + copy(dAtA[i:], m.Token) + i = encodeVarint(dAtA, i, uint64(len(m.Token))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarint(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *LockRequest_Release) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LockRequest_Release) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LockRequest_Release) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Token) > 0 { + i -= len(m.Token) + copy(dAtA[i:], m.Token) + i = encodeVarint(dAtA, i, uint64(len(m.Token))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarint(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *LockRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LockRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LockRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if vtmsg, ok := m.Lock.(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + return len(dAtA) - i, nil +} + +func (m *LockRequest_Acquire_) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LockRequest_Acquire_) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Acquire != nil { + size, err := m.Acquire.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *LockRequest_Extend_) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LockRequest_Extend_) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Extend != nil { + size, err := m.Extend.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *LockRequest_Release_) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LockRequest_Release_) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Release != nil { + size, err := m.Release.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *LockResponse_Acquired) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LockResponse_Acquired) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LockResponse_Acquired) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Token) > 0 { + i -= len(m.Token) + copy(dAtA[i:], m.Token) + i = encodeVarint(dAtA, i, uint64(len(m.Token))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarint(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *LockResponse_Extended) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LockResponse_Extended) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LockResponse_Extended) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarint(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *LockResponse_Released) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LockResponse_Released) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LockResponse_Released) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarint(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *LockResponse_Rejected) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LockResponse_Rejected) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LockResponse_Rejected) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Expires != nil { + if vtmsg, ok := interface{}(m.Expires).(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.Expires) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = encodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarint(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *LockResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LockResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LockResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if vtmsg, ok := m.Lock.(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + return len(dAtA) - i, nil +} + +func (m *LockResponse_Acquired_) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LockResponse_Acquired_) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Acquired != nil { + size, err := m.Acquired.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *LockResponse_Extended_) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LockResponse_Extended_) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Extended != nil { + size, err := m.Extended.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *LockResponse_Released_) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LockResponse_Released_) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Released != nil { + size, err := m.Released.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *LockResponse_Rejected_) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LockResponse_Rejected_) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Rejected != nil { + size, err := m.Rejected.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } + return len(dAtA) - i, nil +} +func (m *LockAcquiredEvent) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LockAcquiredEvent) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LockAcquiredEvent) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Expires != nil { + if vtmsg, ok := interface{}(m.Expires).(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.Expires) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = encodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0x22 + } + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarint(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0x1a + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarint(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} + +func (m *LockExtendedEvent) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LockExtendedEvent) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LockExtendedEvent) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Expires != nil { + if vtmsg, ok := interface{}(m.Expires).(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.Expires) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = encodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0x22 + } + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarint(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0x1a + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarint(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} + +func (m *LockReleasedEvent) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LockReleasedEvent) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LockReleasedEvent) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarint(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0x1a + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarint(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} + +func (m *MonitorRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MonitorRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *MonitorRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Name) > 0 { + for iNdEx := len(m.Name) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Name[iNdEx]) + copy(dAtA[i:], m.Name[iNdEx]) + i = encodeVarint(dAtA, i, uint64(len(m.Name[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *MonitorResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MonitorResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *MonitorResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if vtmsg, ok := m.Event.(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if m.Timestamp != nil { + if vtmsg, ok := interface{}(m.Timestamp).(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.Timestamp) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = encodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MonitorResponse_Acquired) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *MonitorResponse_Acquired) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Acquired != nil { + size, err := m.Acquired.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *MonitorResponse_Extended) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *MonitorResponse_Extended) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Extended != nil { + size, err := m.Extended.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *MonitorResponse_Released) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *MonitorResponse_Released) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Released != nil { + size, err := m.Released.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } + return len(dAtA) - i, nil +} +func (m *HistoryRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HistoryRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *HistoryRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.After != nil { + if vtmsg, ok := interface{}(m.After).(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.After) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = encodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0x1a + } + if m.Limit != nil { + i = encodeVarint(dAtA, i, uint64(*m.Limit)) + i-- + dAtA[i] = 0x10 + } + if len(m.Name) > 0 { + for iNdEx := len(m.Name) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Name[iNdEx]) + copy(dAtA[i:], m.Name[iNdEx]) + i = encodeVarint(dAtA, i, uint64(len(m.Name[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *HistoryResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HistoryResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *HistoryResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if vtmsg, ok := m.Event.(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if m.Timestamp != nil { + if vtmsg, ok := interface{}(m.Timestamp).(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.Timestamp) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = encodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *HistoryResponse_Acquired) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *HistoryResponse_Acquired) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Acquired != nil { + size, err := m.Acquired.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *HistoryResponse_Extended) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *HistoryResponse_Extended) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Extended != nil { + size, err := m.Extended.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *HistoryResponse_Released) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *HistoryResponse_Released) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Released != nil { + size, err := m.Released.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } + return len(dAtA) - i, nil +} +func encodeVarint(dAtA []byte, offset int, v uint64) int { + offset -= sov(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *LockRequest_Acquire) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + if m.Expires != nil { + if size, ok := interface{}(m.Expires).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.Expires) + } + n += 1 + l + sov(uint64(l)) + } + if m.Timeout != nil { + if size, ok := interface{}(m.Timeout).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.Timeout) + } + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *LockRequest_Extend) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + l = len(m.Token) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + if m.Expires != nil { + if size, ok := interface{}(m.Expires).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.Expires) + } + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *LockRequest_Release) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + l = len(m.Token) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *LockRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if vtmsg, ok := m.Lock.(interface{ SizeVT() int }); ok { + n += vtmsg.SizeVT() + } + n += len(m.unknownFields) + return n +} + +func (m *LockRequest_Acquire_) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Acquire != nil { + l = m.Acquire.SizeVT() + n += 1 + l + sov(uint64(l)) + } + return n +} +func (m *LockRequest_Extend_) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Extend != nil { + l = m.Extend.SizeVT() + n += 1 + l + sov(uint64(l)) + } + return n +} +func (m *LockRequest_Release_) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Release != nil { + l = m.Release.SizeVT() + n += 1 + l + sov(uint64(l)) + } + return n +} +func (m *LockResponse_Acquired) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + l = len(m.Token) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *LockResponse_Extended) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *LockResponse_Released) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *LockResponse_Rejected) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + if m.Expires != nil { + if size, ok := interface{}(m.Expires).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.Expires) + } + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *LockResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if vtmsg, ok := m.Lock.(interface{ SizeVT() int }); ok { + n += vtmsg.SizeVT() + } + n += len(m.unknownFields) + return n +} + +func (m *LockResponse_Acquired_) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Acquired != nil { + l = m.Acquired.SizeVT() + n += 1 + l + sov(uint64(l)) + } + return n +} +func (m *LockResponse_Extended_) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Extended != nil { + l = m.Extended.SizeVT() + n += 1 + l + sov(uint64(l)) + } + return n +} +func (m *LockResponse_Released_) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Released != nil { + l = m.Released.SizeVT() + n += 1 + l + sov(uint64(l)) + } + return n +} +func (m *LockResponse_Rejected_) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Rejected != nil { + l = m.Rejected.SizeVT() + n += 1 + l + sov(uint64(l)) + } + return n +} +func (m *LockAcquiredEvent) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + l = len(m.Owner) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + if m.Expires != nil { + if size, ok := interface{}(m.Expires).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.Expires) + } + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *LockExtendedEvent) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + l = len(m.Owner) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + if m.Expires != nil { + if size, ok := interface{}(m.Expires).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.Expires) + } + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *LockReleasedEvent) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + l = len(m.Owner) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *MonitorRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Name) > 0 { + for _, s := range m.Name { + l = len(s) + n += 1 + l + sov(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *MonitorResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Timestamp != nil { + if size, ok := interface{}(m.Timestamp).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.Timestamp) + } + n += 1 + l + sov(uint64(l)) + } + if vtmsg, ok := m.Event.(interface{ SizeVT() int }); ok { + n += vtmsg.SizeVT() + } + n += len(m.unknownFields) + return n +} + +func (m *MonitorResponse_Acquired) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Acquired != nil { + l = m.Acquired.SizeVT() + n += 1 + l + sov(uint64(l)) + } + return n +} +func (m *MonitorResponse_Extended) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Extended != nil { + l = m.Extended.SizeVT() + n += 1 + l + sov(uint64(l)) + } + return n +} +func (m *MonitorResponse_Released) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Released != nil { + l = m.Released.SizeVT() + n += 1 + l + sov(uint64(l)) + } + return n +} +func (m *HistoryRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Name) > 0 { + for _, s := range m.Name { + l = len(s) + n += 1 + l + sov(uint64(l)) + } + } + if m.Limit != nil { + n += 1 + sov(uint64(*m.Limit)) + } + if m.After != nil { + if size, ok := interface{}(m.After).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.After) + } + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *HistoryResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Timestamp != nil { + if size, ok := interface{}(m.Timestamp).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.Timestamp) + } + n += 1 + l + sov(uint64(l)) + } + if vtmsg, ok := m.Event.(interface{ SizeVT() int }); ok { + n += vtmsg.SizeVT() + } + n += len(m.unknownFields) + return n +} + +func (m *HistoryResponse_Acquired) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Acquired != nil { + l = m.Acquired.SizeVT() + n += 1 + l + sov(uint64(l)) + } + return n +} +func (m *HistoryResponse_Extended) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Extended != nil { + l = m.Extended.SizeVT() + n += 1 + l + sov(uint64(l)) + } + return n +} +func (m *HistoryResponse_Released) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Released != nil { + l = m.Released.SizeVT() + n += 1 + l + sov(uint64(l)) + } + return n +} + +func sov(x uint64) (n int) { + return (bits.Len64(x|1) + 6) / 7 +} +func soz(x uint64) (n int) { + return sov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *LockRequest_Acquire) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LockRequest_Acquire: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LockRequest_Acquire: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Expires", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Expires == nil { + m.Expires = ×tamppb.Timestamp{} + } + if unmarshal, ok := interface{}(m.Expires).(interface { + UnmarshalVT([]byte) error + }); ok { + if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.Expires); err != nil { + return err + } + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Timeout", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Timeout == nil { + m.Timeout = &durationpb.Duration{} + } + if unmarshal, ok := interface{}(m.Timeout).(interface { + UnmarshalVT([]byte) error + }); ok { + if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.Timeout); err != nil { + return err + } + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LockRequest_Extend) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LockRequest_Extend: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LockRequest_Extend: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Token = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Expires", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Expires == nil { + m.Expires = ×tamppb.Timestamp{} + } + if unmarshal, ok := interface{}(m.Expires).(interface { + UnmarshalVT([]byte) error + }); ok { + if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.Expires); err != nil { + return err + } + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LockRequest_Release) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LockRequest_Release: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LockRequest_Release: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Token = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LockRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LockRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LockRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Acquire", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Lock.(*LockRequest_Acquire_); ok { + if err := oneof.Acquire.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &LockRequest_Acquire{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Lock = &LockRequest_Acquire_{Acquire: v} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Extend", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Lock.(*LockRequest_Extend_); ok { + if err := oneof.Extend.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &LockRequest_Extend{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Lock = &LockRequest_Extend_{Extend: v} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Release", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Lock.(*LockRequest_Release_); ok { + if err := oneof.Release.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &LockRequest_Release{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Lock = &LockRequest_Release_{Release: v} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LockResponse_Acquired) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LockResponse_Acquired: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LockResponse_Acquired: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Token = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LockResponse_Extended) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LockResponse_Extended: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LockResponse_Extended: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LockResponse_Released) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LockResponse_Released: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LockResponse_Released: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LockResponse_Rejected) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LockResponse_Rejected: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LockResponse_Rejected: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Expires", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Expires == nil { + m.Expires = ×tamppb.Timestamp{} + } + if unmarshal, ok := interface{}(m.Expires).(interface { + UnmarshalVT([]byte) error + }); ok { + if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.Expires); err != nil { + return err + } + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LockResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LockResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LockResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Acquired", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Lock.(*LockResponse_Acquired_); ok { + if err := oneof.Acquired.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &LockResponse_Acquired{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Lock = &LockResponse_Acquired_{Acquired: v} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Extended", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Lock.(*LockResponse_Extended_); ok { + if err := oneof.Extended.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &LockResponse_Extended{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Lock = &LockResponse_Extended_{Extended: v} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Released", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Lock.(*LockResponse_Released_); ok { + if err := oneof.Released.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &LockResponse_Released{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Lock = &LockResponse_Released_{Released: v} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rejected", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Lock.(*LockResponse_Rejected_); ok { + if err := oneof.Rejected.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &LockResponse_Rejected{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Lock = &LockResponse_Rejected_{Rejected: v} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LockAcquiredEvent) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LockAcquiredEvent: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LockAcquiredEvent: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Expires", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Expires == nil { + m.Expires = ×tamppb.Timestamp{} + } + if unmarshal, ok := interface{}(m.Expires).(interface { + UnmarshalVT([]byte) error + }); ok { + if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.Expires); err != nil { + return err + } + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LockExtendedEvent) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LockExtendedEvent: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LockExtendedEvent: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Expires", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Expires == nil { + m.Expires = ×tamppb.Timestamp{} + } + if unmarshal, ok := interface{}(m.Expires).(interface { + UnmarshalVT([]byte) error + }); ok { + if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.Expires); err != nil { + return err + } + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LockReleasedEvent) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LockReleasedEvent: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LockReleasedEvent: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MonitorRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MonitorRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MonitorRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = append(m.Name, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MonitorResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MonitorResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MonitorResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Timestamp == nil { + m.Timestamp = ×tamppb.Timestamp{} + } + if unmarshal, ok := interface{}(m.Timestamp).(interface { + UnmarshalVT([]byte) error + }); ok { + if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.Timestamp); err != nil { + return err + } + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Acquired", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Event.(*MonitorResponse_Acquired); ok { + if err := oneof.Acquired.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &LockAcquiredEvent{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Event = &MonitorResponse_Acquired{Acquired: v} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Extended", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Event.(*MonitorResponse_Extended); ok { + if err := oneof.Extended.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &LockExtendedEvent{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Event = &MonitorResponse_Extended{Extended: v} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Released", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Event.(*MonitorResponse_Released); ok { + if err := oneof.Released.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &LockReleasedEvent{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Event = &MonitorResponse_Released{Released: v} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *HistoryRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: HistoryRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HistoryRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = append(m.Name, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Limit = &v + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field After", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.After == nil { + m.After = ×tamppb.Timestamp{} + } + if unmarshal, ok := interface{}(m.After).(interface { + UnmarshalVT([]byte) error + }); ok { + if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.After); err != nil { + return err + } + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *HistoryResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: HistoryResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HistoryResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Timestamp == nil { + m.Timestamp = ×tamppb.Timestamp{} + } + if unmarshal, ok := interface{}(m.Timestamp).(interface { + UnmarshalVT([]byte) error + }); ok { + if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.Timestamp); err != nil { + return err + } + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Acquired", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Event.(*HistoryResponse_Acquired); ok { + if err := oneof.Acquired.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &LockAcquiredEvent{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Event = &HistoryResponse_Acquired{Acquired: v} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Extended", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Event.(*HistoryResponse_Extended); ok { + if err := oneof.Extended.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &LockExtendedEvent{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Event = &HistoryResponse_Extended{Extended: v} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Released", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Event.(*HistoryResponse_Released); ok { + if err := oneof.Released.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &LockReleasedEvent{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Event = &HistoryResponse_Released{Released: v} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} + +func skip(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflow + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflow + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflow + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLength + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroup + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLength + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflow = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") +) diff --git a/internal/proto/windshift/state/v1alpha1/service.pb.go b/internal/proto/windshift/state/v1alpha1/service.pb.go index aa936ec..162329d 100644 --- a/internal/proto/windshift/state/v1alpha1/service.pb.go +++ b/internal/proto/windshift/state/v1alpha1/service.pb.go @@ -22,15 +22,17 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// * // EnsureStoreRequest creates or updates a state store. type EnsureStoreRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // * - // The name of the store to create or update. + // The name of the store to create or update. Store names are case-sensitive + // and should only contain the following characters: + // + // - `a` to `z`, `A` to `Z` and `0` to `9` are allowed. + // - `_` and `-` are allowed for separating words. Store string `protobuf:"bytes,1,opt,name=store,proto3" json:"store,omitempty"` } @@ -111,17 +113,14 @@ func (*EnsureStoreResponse) Descriptor() ([]byte, []int) { return file_windshift_state_v1alpha1_service_proto_rawDescGZIP(), []int{1} } -// * // GetRequest is the message sent to retrieve a value from a store. type GetRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // * // Store to retrieve the value from. Store string `protobuf:"bytes,1,opt,name=store,proto3" json:"store,omitempty"` - // * // Key to retrieve the value for. Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` } @@ -172,7 +171,6 @@ func (x *GetRequest) GetKey() string { return "" } -// * // GetResponse is the message returned when retrieving a value from a store. type GetResponse struct { state protoimpl.MessageState @@ -248,20 +246,21 @@ type SetRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // * // Store to set the value in. Store string `protobuf:"bytes,1,opt,name=store,proto3" json:"store,omitempty"` - // * - // Key to set the value for. + // Key to set the value for. Keys are case-sensitive and should only contain + // the following characters: + // + // - `a` to `z`, `A` to `Z` and `0` to `9` are allowed. + // - `_` and `-` are allowed for separating words, but the use of camelCase + // is recommended. + // - `.` is allowed and used a hierarchy separator. Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` - // * // Value to set. Value *anypb.Any `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` - // * // If set the operation will only succeed if the key does not already // exist in the store. CreateOnly *bool `protobuf:"varint,4,opt,name=create_only,json=createOnly,proto3,oneof" json:"create_only,omitempty"` - // * // If set the operation will only succeed if the current revision of the // key matches the given revision. LastRevision *uint64 `protobuf:"varint,5,opt,name=last_revision,json=lastRevision,proto3,oneof" json:"last_revision,omitempty"` @@ -339,7 +338,6 @@ type SetResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // * // The revision of the key. Revision uint64 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` } @@ -388,13 +386,10 @@ type DeleteRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // * // Store to delete the key from. Store string `protobuf:"bytes,1,opt,name=store,proto3" json:"store,omitempty"` - // * // Key to delete. Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` - // * // If set the operation will only succeed if the current revision of the // key matches the given revision. LastRevision *uint64 `protobuf:"varint,3,opt,name=last_revision,json=lastRevision,proto3,oneof" json:"last_revision,omitempty"` diff --git a/internal/proto/windshift/state/v1alpha1/service_vtproto.pb.go b/internal/proto/windshift/state/v1alpha1/service_vtproto.pb.go index 8398a80..746445e 100644 --- a/internal/proto/windshift/state/v1alpha1/service_vtproto.pb.go +++ b/internal/proto/windshift/state/v1alpha1/service_vtproto.pb.go @@ -34,17 +34,16 @@ const _ = grpc.SupportPackageIsVersion7 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type StateServiceClient interface { - // * // EnsureStore ensures that a store exists. If the store does not exist, it // will be created. + // + // Stores are used to collect related data. For example, a store could be + // used to store the state of a single application. EnsureStore(ctx context.Context, in *EnsureStoreRequest, opts ...grpc.CallOption) (*EnsureStoreResponse, error) - // * // Get retrieves the value of a key in a store. Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) - // * // Set sets the value of a key in a store. Set(ctx context.Context, in *SetRequest, opts ...grpc.CallOption) (*SetResponse, error) - // * // Delete deletes a key from a store. Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) } @@ -97,17 +96,16 @@ func (c *stateServiceClient) Delete(ctx context.Context, in *DeleteRequest, opts // All implementations must embed UnimplementedStateServiceServer // for forward compatibility type StateServiceServer interface { - // * // EnsureStore ensures that a store exists. If the store does not exist, it // will be created. + // + // Stores are used to collect related data. For example, a store could be + // used to store the state of a single application. EnsureStore(context.Context, *EnsureStoreRequest) (*EnsureStoreResponse, error) - // * // Get retrieves the value of a key in a store. Get(context.Context, *GetRequest) (*GetResponse, error) - // * // Set sets the value of a key in a store. Set(context.Context, *SetRequest) (*SetResponse, error) - // * // Delete deletes a key from a store. Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) mustEmbedUnimplementedStateServiceServer() diff --git a/proto/windshift/events/v1alpha1/service.proto b/proto/windshift/events/v1alpha1/service.proto index 770f047..08af356 100644 --- a/proto/windshift/events/v1alpha1/service.proto +++ b/proto/windshift/events/v1alpha1/service.proto @@ -529,6 +529,9 @@ message Event { // useful to support different versions of the data. Subscribers should // ignore data they do not understand. google.protobuf.Any data = 4; + // The delivery attempt this is. Starts at 1 and increases for each + // redelivery of the event. + uint64 delivery_attempt = 5; } message Headers {