// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: proto/pbsubscribe/subscribe.proto package pbsubscribe import ( context "context" fmt "fmt" io "io" math "math" math_bits "math/bits" proto "github.com/golang/protobuf/proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" pbservice "github.com/hashicorp/consul/proto/pbservice" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package // Topic enumerates the supported event topics. type Topic int32 const ( Topic_Unknown Topic = 0 // ServiceHealth topic contains events for any changes to service health. Topic_ServiceHealth Topic = 1 // ServiceHealthConnect topic contains events for any changes to service // health for connect-enabled services. Topic_ServiceHealthConnect Topic = 2 ) var Topic_name = map[int32]string{ 0: "Unknown", 1: "ServiceHealth", 2: "ServiceHealthConnect", } var Topic_value = map[string]int32{ "Unknown": 0, "ServiceHealth": 1, "ServiceHealthConnect": 2, } func (x Topic) String() string { return proto.EnumName(Topic_name, int32(x)) } func (Topic) EnumDescriptor() ([]byte, []int) { return fileDescriptor_ab3eb8c810e315fb, []int{0} } type CatalogOp int32 const ( CatalogOp_Register CatalogOp = 0 CatalogOp_Deregister CatalogOp = 1 ) var CatalogOp_name = map[int32]string{ 0: "Register", 1: "Deregister", } var CatalogOp_value = map[string]int32{ "Register": 0, "Deregister": 1, } func (x CatalogOp) String() string { return proto.EnumName(CatalogOp_name, int32(x)) } func (CatalogOp) EnumDescriptor() ([]byte, []int) { return fileDescriptor_ab3eb8c810e315fb, []int{1} } // SubscribeRequest used to subscribe to a topic. type SubscribeRequest struct { // Topic identifies the set of events the subscriber is interested in. Topic Topic `protobuf:"varint,1,opt,name=Topic,proto3,enum=subscribe.Topic" json:"Topic,omitempty"` // Key is a topic-specific identifier that restricts the scope of the // subscription to only events pertaining to that identifier. For example, // to receive events for a single service, the service's name is // specified as the key. An empty key indicates that all events in the topic // are of interest. Key string `protobuf:"bytes,2,opt,name=Key,proto3" json:"Key,omitempty"` // Token is the ACL token to authenticate the request. The token must have // sufficient privileges to read the requested information otherwise events // will be filtered, possibly resulting in an empty snapshot and no further // updates sent. Token string `protobuf:"bytes,3,opt,name=Token,proto3" json:"Token,omitempty"` // Index is the raft index the subscriber has already observed up to. This // is zero on an initial streaming call, but then can be provided by a // client on subsequent re-connections such that the full snapshot doesn't // need to be resent if the client is up to date. Index uint64 `protobuf:"varint,4,opt,name=Index,proto3" json:"Index,omitempty"` // Datacenter specifies the Consul datacenter the request is targeted at. // If it's not the local DC the server will forward the request to // the remote DC and proxy the results back to the subscriber. An empty // string defaults to the local datacenter. Datacenter string `protobuf:"bytes,5,opt,name=Datacenter,proto3" json:"Datacenter,omitempty"` // Namespace which contains the resources. If Namespace is not specified the // default namespace will be used. // // Namespace is an enterprise-only feature. Namespace string `protobuf:"bytes,6,opt,name=Namespace,proto3" json:"Namespace,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *SubscribeRequest) Reset() { *m = SubscribeRequest{} } func (m *SubscribeRequest) String() string { return proto.CompactTextString(m) } func (*SubscribeRequest) ProtoMessage() {} func (*SubscribeRequest) Descriptor() ([]byte, []int) { return fileDescriptor_ab3eb8c810e315fb, []int{0} } func (m *SubscribeRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *SubscribeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_SubscribeRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *SubscribeRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_SubscribeRequest.Merge(m, src) } func (m *SubscribeRequest) XXX_Size() int { return m.Size() } func (m *SubscribeRequest) XXX_DiscardUnknown() { xxx_messageInfo_SubscribeRequest.DiscardUnknown(m) } var xxx_messageInfo_SubscribeRequest proto.InternalMessageInfo func (m *SubscribeRequest) GetTopic() Topic { if m != nil { return m.Topic } return Topic_Unknown } func (m *SubscribeRequest) GetKey() string { if m != nil { return m.Key } return "" } func (m *SubscribeRequest) GetToken() string { if m != nil { return m.Token } return "" } func (m *SubscribeRequest) GetIndex() uint64 { if m != nil { return m.Index } return 0 } func (m *SubscribeRequest) GetDatacenter() string { if m != nil { return m.Datacenter } return "" } func (m *SubscribeRequest) GetNamespace() string { if m != nil { return m.Namespace } return "" } // Event describes a streaming update on a subscription. Events are used both to // describe the current "snapshot" of the result as well as ongoing mutations to // that snapshot. type Event struct { // Key is the logical identifier for the entity that was mutated. Key string `protobuf:"bytes,1,opt,name=Key,proto3" json:"Key,omitempty"` // Index is the raft index at which the mutation took place. At the top // level of a subscription there will always be at most one Event per index. // If multiple events are published to the same topic in a single raft // transaction then the batch of events will be encoded inside a single // top-level event to ensure they are delivered atomically to clients. Index uint64 `protobuf:"varint,2,opt,name=Index,proto3" json:"Index,omitempty"` // Payload is the actual event content. // // Types that are valid to be assigned to Payload: // *Event_EndOfSnapshot // *Event_NewSnapshotToFollow // *Event_EventBatch // *Event_ServiceHealth Payload isEvent_Payload `protobuf_oneof:"Payload"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Event) Reset() { *m = Event{} } func (m *Event) String() string { return proto.CompactTextString(m) } func (*Event) ProtoMessage() {} func (*Event) Descriptor() ([]byte, []int) { return fileDescriptor_ab3eb8c810e315fb, []int{1} } func (m *Event) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Event) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Event.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *Event) XXX_Merge(src proto.Message) { xxx_messageInfo_Event.Merge(m, src) } func (m *Event) XXX_Size() int { return m.Size() } func (m *Event) XXX_DiscardUnknown() { xxx_messageInfo_Event.DiscardUnknown(m) } var xxx_messageInfo_Event proto.InternalMessageInfo type isEvent_Payload interface { isEvent_Payload() MarshalTo([]byte) (int, error) Size() int } type Event_EndOfSnapshot struct { EndOfSnapshot bool `protobuf:"varint,3,opt,name=EndOfSnapshot,proto3,oneof"` } type Event_NewSnapshotToFollow struct { NewSnapshotToFollow bool `protobuf:"varint,4,opt,name=NewSnapshotToFollow,proto3,oneof"` } type Event_EventBatch struct { EventBatch *EventBatch `protobuf:"bytes,5,opt,name=EventBatch,proto3,oneof"` } type Event_ServiceHealth struct { ServiceHealth *ServiceHealthUpdate `protobuf:"bytes,10,opt,name=ServiceHealth,proto3,oneof"` } func (*Event_EndOfSnapshot) isEvent_Payload() {} func (*Event_NewSnapshotToFollow) isEvent_Payload() {} func (*Event_EventBatch) isEvent_Payload() {} func (*Event_ServiceHealth) isEvent_Payload() {} func (m *Event) GetPayload() isEvent_Payload { if m != nil { return m.Payload } return nil } func (m *Event) GetKey() string { if m != nil { return m.Key } return "" } func (m *Event) GetIndex() uint64 { if m != nil { return m.Index } return 0 } func (m *Event) GetEndOfSnapshot() bool { if x, ok := m.GetPayload().(*Event_EndOfSnapshot); ok { return x.EndOfSnapshot } return false } func (m *Event) GetNewSnapshotToFollow() bool { if x, ok := m.GetPayload().(*Event_NewSnapshotToFollow); ok { return x.NewSnapshotToFollow } return false } func (m *Event) GetEventBatch() *EventBatch { if x, ok := m.GetPayload().(*Event_EventBatch); ok { return x.EventBatch } return nil } func (m *Event) GetServiceHealth() *ServiceHealthUpdate { if x, ok := m.GetPayload().(*Event_ServiceHealth); ok { return x.ServiceHealth } return nil } // XXX_OneofFuncs is for the internal use of the proto package. func (*Event) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { return _Event_OneofMarshaler, _Event_OneofUnmarshaler, _Event_OneofSizer, []interface{}{ (*Event_EndOfSnapshot)(nil), (*Event_NewSnapshotToFollow)(nil), (*Event_EventBatch)(nil), (*Event_ServiceHealth)(nil), } } func _Event_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { m := msg.(*Event) // Payload switch x := m.Payload.(type) { case *Event_EndOfSnapshot: t := uint64(0) if x.EndOfSnapshot { t = 1 } _ = b.EncodeVarint(3<<3 | proto.WireVarint) _ = b.EncodeVarint(t) case *Event_NewSnapshotToFollow: t := uint64(0) if x.NewSnapshotToFollow { t = 1 } _ = b.EncodeVarint(4<<3 | proto.WireVarint) _ = b.EncodeVarint(t) case *Event_EventBatch: _ = b.EncodeVarint(5<<3 | proto.WireBytes) if err := b.EncodeMessage(x.EventBatch); err != nil { return err } case *Event_ServiceHealth: _ = b.EncodeVarint(10<<3 | proto.WireBytes) if err := b.EncodeMessage(x.ServiceHealth); err != nil { return err } case nil: default: return fmt.Errorf("Event.Payload has unexpected type %T", x) } return nil } func _Event_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { m := msg.(*Event) switch tag { case 3: // Payload.EndOfSnapshot if wire != proto.WireVarint { return true, proto.ErrInternalBadWireType } x, err := b.DecodeVarint() m.Payload = &Event_EndOfSnapshot{x != 0} return true, err case 4: // Payload.NewSnapshotToFollow if wire != proto.WireVarint { return true, proto.ErrInternalBadWireType } x, err := b.DecodeVarint() m.Payload = &Event_NewSnapshotToFollow{x != 0} return true, err case 5: // Payload.EventBatch if wire != proto.WireBytes { return true, proto.ErrInternalBadWireType } msg := new(EventBatch) err := b.DecodeMessage(msg) m.Payload = &Event_EventBatch{msg} return true, err case 10: // Payload.ServiceHealth if wire != proto.WireBytes { return true, proto.ErrInternalBadWireType } msg := new(ServiceHealthUpdate) err := b.DecodeMessage(msg) m.Payload = &Event_ServiceHealth{msg} return true, err default: return false, nil } } func _Event_OneofSizer(msg proto.Message) (n int) { m := msg.(*Event) // Payload switch x := m.Payload.(type) { case *Event_EndOfSnapshot: n += 1 // tag and wire n += 1 case *Event_NewSnapshotToFollow: n += 1 // tag and wire n += 1 case *Event_EventBatch: s := proto.Size(x.EventBatch) n += 1 // tag and wire n += proto.SizeVarint(uint64(s)) n += s case *Event_ServiceHealth: s := proto.Size(x.ServiceHealth) n += 1 // tag and wire n += proto.SizeVarint(uint64(s)) n += s case nil: default: panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) } return n } type EventBatch struct { Events []*Event `protobuf:"bytes,1,rep,name=Events,proto3" json:"Events,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *EventBatch) Reset() { *m = EventBatch{} } func (m *EventBatch) String() string { return proto.CompactTextString(m) } func (*EventBatch) ProtoMessage() {} func (*EventBatch) Descriptor() ([]byte, []int) { return fileDescriptor_ab3eb8c810e315fb, []int{2} } func (m *EventBatch) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *EventBatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_EventBatch.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *EventBatch) XXX_Merge(src proto.Message) { xxx_messageInfo_EventBatch.Merge(m, src) } func (m *EventBatch) XXX_Size() int { return m.Size() } func (m *EventBatch) XXX_DiscardUnknown() { xxx_messageInfo_EventBatch.DiscardUnknown(m) } var xxx_messageInfo_EventBatch proto.InternalMessageInfo func (m *EventBatch) GetEvents() []*Event { if m != nil { return m.Events } return nil } type ServiceHealthUpdate struct { Op CatalogOp `protobuf:"varint,1,opt,name=Op,proto3,enum=subscribe.CatalogOp" json:"Op,omitempty"` CheckServiceNode *pbservice.CheckServiceNode `protobuf:"bytes,2,opt,name=CheckServiceNode,proto3" json:"CheckServiceNode,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ServiceHealthUpdate) Reset() { *m = ServiceHealthUpdate{} } func (m *ServiceHealthUpdate) String() string { return proto.CompactTextString(m) } func (*ServiceHealthUpdate) ProtoMessage() {} func (*ServiceHealthUpdate) Descriptor() ([]byte, []int) { return fileDescriptor_ab3eb8c810e315fb, []int{3} } func (m *ServiceHealthUpdate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ServiceHealthUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ServiceHealthUpdate.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ServiceHealthUpdate) XXX_Merge(src proto.Message) { xxx_messageInfo_ServiceHealthUpdate.Merge(m, src) } func (m *ServiceHealthUpdate) XXX_Size() int { return m.Size() } func (m *ServiceHealthUpdate) XXX_DiscardUnknown() { xxx_messageInfo_ServiceHealthUpdate.DiscardUnknown(m) } var xxx_messageInfo_ServiceHealthUpdate proto.InternalMessageInfo func (m *ServiceHealthUpdate) GetOp() CatalogOp { if m != nil { return m.Op } return CatalogOp_Register } func (m *ServiceHealthUpdate) GetCheckServiceNode() *pbservice.CheckServiceNode { if m != nil { return m.CheckServiceNode } return nil } func init() { proto.RegisterEnum("subscribe.Topic", Topic_name, Topic_value) proto.RegisterEnum("subscribe.CatalogOp", CatalogOp_name, CatalogOp_value) proto.RegisterType((*SubscribeRequest)(nil), "subscribe.SubscribeRequest") proto.RegisterType((*Event)(nil), "subscribe.Event") proto.RegisterType((*EventBatch)(nil), "subscribe.EventBatch") proto.RegisterType((*ServiceHealthUpdate)(nil), "subscribe.ServiceHealthUpdate") } func init() { proto.RegisterFile("proto/pbsubscribe/subscribe.proto", fileDescriptor_ab3eb8c810e315fb) } var fileDescriptor_ab3eb8c810e315fb = []byte{ // 542 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x53, 0xcd, 0x6e, 0xd3, 0x40, 0x10, 0xf6, 0xba, 0xbf, 0x9e, 0xd0, 0xca, 0x6c, 0x8b, 0xb0, 0x5a, 0x64, 0x85, 0x08, 0x55, 0xa1, 0x12, 0x31, 0x0a, 0x12, 0xdc, 0x40, 0x24, 0x6d, 0x09, 0x42, 0x4a, 0x90, 0xd3, 0x1e, 0xe0, 0xb6, 0xb1, 0x87, 0xd8, 0x8a, 0xbb, 0x6b, 0xec, 0x4d, 0x43, 0xef, 0xbc, 0x03, 0x3c, 0x09, 0xcf, 0xc0, 0x91, 0x47, 0x40, 0xe1, 0x45, 0x50, 0x36, 0x8e, 0x63, 0x27, 0xbd, 0x79, 0xbe, 0x9f, 0xdd, 0xcf, 0xb3, 0x33, 0xf0, 0x38, 0x4e, 0x84, 0x14, 0x4e, 0x3c, 0x48, 0xc7, 0x83, 0xd4, 0x4b, 0xc2, 0x01, 0x3a, 0xf9, 0x57, 0x43, 0x71, 0xd4, 0xc8, 0x81, 0xa3, 0xa3, 0x5c, 0x8d, 0xc9, 0x4d, 0xe8, 0xa1, 0xc3, 0x85, 0x9f, 0xc9, 0x6a, 0xbf, 0x08, 0x98, 0xfd, 0x85, 0xd2, 0xc5, 0xaf, 0x63, 0x4c, 0x25, 0x3d, 0x81, 0xad, 0x4b, 0x11, 0x87, 0x9e, 0x45, 0xaa, 0xa4, 0xbe, 0xdf, 0x34, 0x1b, 0xcb, 0xc3, 0x15, 0xee, 0xce, 0x69, 0x6a, 0xc2, 0xc6, 0x07, 0xbc, 0xb5, 0xf4, 0x2a, 0xa9, 0x1b, 0xee, 0xec, 0x93, 0x1e, 0xce, 0x9c, 0x23, 0xe4, 0xd6, 0x86, 0xc2, 0xe6, 0xc5, 0x0c, 0x7d, 0xcf, 0x7d, 0xfc, 0x66, 0x6d, 0x56, 0x49, 0x7d, 0xd3, 0x9d, 0x17, 0xd4, 0x06, 0x38, 0x63, 0x92, 0x79, 0xc8, 0x25, 0x26, 0xd6, 0x96, 0x32, 0x14, 0x10, 0xfa, 0x08, 0x8c, 0x2e, 0xbb, 0xc6, 0x34, 0x66, 0x1e, 0x5a, 0xdb, 0x8a, 0x5e, 0x02, 0xb5, 0x1f, 0x3a, 0x6c, 0x9d, 0xdf, 0x20, 0x97, 0x8b, 0x14, 0xa4, 0x94, 0x62, 0x7e, 0x9f, 0x5e, 0xbc, 0xef, 0x04, 0xf6, 0xce, 0xb9, 0xdf, 0xfb, 0xd2, 0xe7, 0x2c, 0x4e, 0x03, 0x21, 0x55, 0xc6, 0xdd, 0x8e, 0xe6, 0x96, 0x61, 0xda, 0x84, 0x83, 0x2e, 0x4e, 0x16, 0xe5, 0xa5, 0xb8, 0x10, 0x51, 0x24, 0x26, 0x2a, 0xfb, 0x4c, 0x7d, 0x17, 0x49, 0x5f, 0x01, 0xa8, 0x30, 0x2d, 0x26, 0xbd, 0x40, 0xfd, 0x4b, 0xa5, 0xf9, 0xa0, 0xd0, 0xb6, 0x25, 0xd9, 0xd1, 0xdc, 0x82, 0x94, 0x5e, 0xc0, 0x5e, 0x7f, 0xfe, 0x2a, 0x1d, 0x64, 0x91, 0x0c, 0x2c, 0x50, 0x5e, 0xbb, 0xe0, 0x2d, 0xf1, 0x57, 0xb1, 0xcf, 0x24, 0xce, 0x42, 0x97, 0xe0, 0x96, 0x01, 0x3b, 0x1f, 0xd9, 0x6d, 0x24, 0x98, 0x5f, 0x7b, 0x59, 0xcc, 0x42, 0xeb, 0xb0, 0xad, 0xaa, 0xd4, 0x22, 0xd5, 0x8d, 0x7a, 0xa5, 0xf4, 0x98, 0x8a, 0x70, 0x33, 0xbe, 0xf6, 0x9d, 0xc0, 0xc1, 0x1d, 0x77, 0xd1, 0x27, 0xa0, 0xf7, 0xe2, 0x6c, 0x14, 0x0e, 0x0b, 0xee, 0x36, 0x93, 0x2c, 0x12, 0xc3, 0x5e, 0xec, 0xea, 0xbd, 0x98, 0xbe, 0x03, 0xb3, 0x1d, 0xa0, 0x37, 0xca, 0x4e, 0xe8, 0x0a, 0x1f, 0x55, 0xfb, 0x2b, 0xcd, 0xe3, 0x46, 0x3e, 0x79, 0x8d, 0x55, 0x89, 0xbb, 0x66, 0x3a, 0x7d, 0x9b, 0x0d, 0x1f, 0xad, 0xc0, 0xce, 0x15, 0x1f, 0x71, 0x31, 0xe1, 0xa6, 0x46, 0xef, 0xaf, 0xf4, 0xc9, 0x24, 0xd4, 0x82, 0xc3, 0x12, 0xd4, 0x16, 0x9c, 0xa3, 0x27, 0x4d, 0xfd, 0xf4, 0x29, 0x18, 0x79, 0x38, 0x7a, 0x0f, 0x76, 0x5d, 0x1c, 0x86, 0xa9, 0xc4, 0xc4, 0xd4, 0xe8, 0x3e, 0xc0, 0x19, 0x26, 0x8b, 0x9a, 0x34, 0x3f, 0xc1, 0xc3, 0xbe, 0x64, 0x12, 0xdb, 0x01, 0xe3, 0x43, 0xcc, 0x36, 0x21, 0x96, 0xa1, 0xe0, 0xf4, 0x35, 0x18, 0xf9, 0x66, 0xd0, 0xe3, 0xe2, 0x83, 0xac, 0xec, 0xcb, 0xd1, 0x5a, 0x4f, 0x6b, 0xda, 0x73, 0xd2, 0x7a, 0xf3, 0x7b, 0x6a, 0x93, 0x3f, 0x53, 0x9b, 0xfc, 0x9d, 0xda, 0xe4, 0xe7, 0x3f, 0x5b, 0xfb, 0xfc, 0x6c, 0x18, 0xca, 0x60, 0x3c, 0x68, 0x78, 0xe2, 0xda, 0x09, 0x58, 0x1a, 0x84, 0x9e, 0x48, 0x62, 0xc7, 0x13, 0x3c, 0x1d, 0x47, 0xce, 0xda, 0x4a, 0x0f, 0xb6, 0x15, 0xf4, 0xe2, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x20, 0xe5, 0xc9, 0x9d, 0xee, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. var _ context.Context var _ grpc.ClientConn // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. const _ = grpc.SupportPackageIsVersion4 // StateChangeSubscriptionClient is the client API for StateChangeSubscription service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type StateChangeSubscriptionClient interface { // Subscribe to a topic to receive events when there are changes to the topic. // // If SubscribeRequest.Index is 0 the event stream will start with one or // more snapshot events, followed by an EndOfSnapshot event. Subsequent // events will be a live stream of events as they happen. // // If SubscribeRequest.Index is > 0 it is assumed the client already has a // snapshot, and is trying to resume a stream that was disconnected. The // client will either receive a NewSnapshotToFollow event, indicating the // client view is stale and it must reset its view and prepare for a new // snapshot. Or, if no NewSnapshotToFollow event is received, the client // view is still fresh, and all events will be the live stream. // // Subscribe may return a gRPC status error with codes.ABORTED to indicate // the client view is now stale due to a change on the server. The client // must reset its view and issue a new Subscribe call to restart the stream. // This error is used when the server can no longer correctly maintain the // stream, for example because the ACL permissions for the token changed, or // because the server state was restored from a snapshot. Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (StateChangeSubscription_SubscribeClient, error) } type stateChangeSubscriptionClient struct { cc *grpc.ClientConn } func NewStateChangeSubscriptionClient(cc *grpc.ClientConn) StateChangeSubscriptionClient { return &stateChangeSubscriptionClient{cc} } func (c *stateChangeSubscriptionClient) Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (StateChangeSubscription_SubscribeClient, error) { stream, err := c.cc.NewStream(ctx, &_StateChangeSubscription_serviceDesc.Streams[0], "/subscribe.StateChangeSubscription/Subscribe", opts...) if err != nil { return nil, err } x := &stateChangeSubscriptionSubscribeClient{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 StateChangeSubscription_SubscribeClient interface { Recv() (*Event, error) grpc.ClientStream } type stateChangeSubscriptionSubscribeClient struct { grpc.ClientStream } func (x *stateChangeSubscriptionSubscribeClient) Recv() (*Event, error) { m := new(Event) if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err } return m, nil } // StateChangeSubscriptionServer is the server API for StateChangeSubscription service. type StateChangeSubscriptionServer interface { // Subscribe to a topic to receive events when there are changes to the topic. // // If SubscribeRequest.Index is 0 the event stream will start with one or // more snapshot events, followed by an EndOfSnapshot event. Subsequent // events will be a live stream of events as they happen. // // If SubscribeRequest.Index is > 0 it is assumed the client already has a // snapshot, and is trying to resume a stream that was disconnected. The // client will either receive a NewSnapshotToFollow event, indicating the // client view is stale and it must reset its view and prepare for a new // snapshot. Or, if no NewSnapshotToFollow event is received, the client // view is still fresh, and all events will be the live stream. // // Subscribe may return a gRPC status error with codes.ABORTED to indicate // the client view is now stale due to a change on the server. The client // must reset its view and issue a new Subscribe call to restart the stream. // This error is used when the server can no longer correctly maintain the // stream, for example because the ACL permissions for the token changed, or // because the server state was restored from a snapshot. Subscribe(*SubscribeRequest, StateChangeSubscription_SubscribeServer) error } // UnimplementedStateChangeSubscriptionServer can be embedded to have forward compatible implementations. type UnimplementedStateChangeSubscriptionServer struct { } func (*UnimplementedStateChangeSubscriptionServer) Subscribe(req *SubscribeRequest, srv StateChangeSubscription_SubscribeServer) error { return status.Errorf(codes.Unimplemented, "method Subscribe not implemented") } func RegisterStateChangeSubscriptionServer(s *grpc.Server, srv StateChangeSubscriptionServer) { s.RegisterService(&_StateChangeSubscription_serviceDesc, srv) } func _StateChangeSubscription_Subscribe_Handler(srv interface{}, stream grpc.ServerStream) error { m := new(SubscribeRequest) if err := stream.RecvMsg(m); err != nil { return err } return srv.(StateChangeSubscriptionServer).Subscribe(m, &stateChangeSubscriptionSubscribeServer{stream}) } type StateChangeSubscription_SubscribeServer interface { Send(*Event) error grpc.ServerStream } type stateChangeSubscriptionSubscribeServer struct { grpc.ServerStream } func (x *stateChangeSubscriptionSubscribeServer) Send(m *Event) error { return x.ServerStream.SendMsg(m) } var _StateChangeSubscription_serviceDesc = grpc.ServiceDesc{ ServiceName: "subscribe.StateChangeSubscription", HandlerType: (*StateChangeSubscriptionServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "Subscribe", Handler: _StateChangeSubscription_Subscribe_Handler, ServerStreams: true, }, }, Metadata: "proto/pbsubscribe/subscribe.proto", } func (m *SubscribeRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *SubscribeRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *SubscribeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Namespace) > 0 { i -= len(m.Namespace) copy(dAtA[i:], m.Namespace) i = encodeVarintSubscribe(dAtA, i, uint64(len(m.Namespace))) i-- dAtA[i] = 0x32 } if len(m.Datacenter) > 0 { i -= len(m.Datacenter) copy(dAtA[i:], m.Datacenter) i = encodeVarintSubscribe(dAtA, i, uint64(len(m.Datacenter))) i-- dAtA[i] = 0x2a } if m.Index != 0 { i = encodeVarintSubscribe(dAtA, i, uint64(m.Index)) i-- dAtA[i] = 0x20 } if len(m.Token) > 0 { i -= len(m.Token) copy(dAtA[i:], m.Token) i = encodeVarintSubscribe(dAtA, i, uint64(len(m.Token))) i-- dAtA[i] = 0x1a } if len(m.Key) > 0 { i -= len(m.Key) copy(dAtA[i:], m.Key) i = encodeVarintSubscribe(dAtA, i, uint64(len(m.Key))) i-- dAtA[i] = 0x12 } if m.Topic != 0 { i = encodeVarintSubscribe(dAtA, i, uint64(m.Topic)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } func (m *Event) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *Event) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Event) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } if m.Payload != nil { { size := m.Payload.Size() i -= size if _, err := m.Payload.MarshalTo(dAtA[i:]); err != nil { return 0, err } } } if m.Index != 0 { i = encodeVarintSubscribe(dAtA, i, uint64(m.Index)) i-- dAtA[i] = 0x10 } if len(m.Key) > 0 { i -= len(m.Key) copy(dAtA[i:], m.Key) i = encodeVarintSubscribe(dAtA, i, uint64(len(m.Key))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *Event_EndOfSnapshot) MarshalTo(dAtA []byte) (int, error) { return m.MarshalToSizedBuffer(dAtA[:m.Size()]) } func (m *Event_EndOfSnapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) i-- if m.EndOfSnapshot { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x18 return len(dAtA) - i, nil } func (m *Event_NewSnapshotToFollow) MarshalTo(dAtA []byte) (int, error) { return m.MarshalToSizedBuffer(dAtA[:m.Size()]) } func (m *Event_NewSnapshotToFollow) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) i-- if m.NewSnapshotToFollow { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x20 return len(dAtA) - i, nil } func (m *Event_EventBatch) MarshalTo(dAtA []byte) (int, error) { return m.MarshalToSizedBuffer(dAtA[:m.Size()]) } func (m *Event_EventBatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.EventBatch != nil { { size, err := m.EventBatch.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintSubscribe(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x2a } return len(dAtA) - i, nil } func (m *Event_ServiceHealth) MarshalTo(dAtA []byte) (int, error) { return m.MarshalToSizedBuffer(dAtA[:m.Size()]) } func (m *Event_ServiceHealth) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.ServiceHealth != nil { { size, err := m.ServiceHealth.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintSubscribe(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x52 } return len(dAtA) - i, nil } func (m *EventBatch) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *EventBatch) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *EventBatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Events) > 0 { for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Events[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintSubscribe(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *ServiceHealthUpdate) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ServiceHealthUpdate) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ServiceHealthUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } if m.CheckServiceNode != nil { { size, err := m.CheckServiceNode.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintSubscribe(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } if m.Op != 0 { i = encodeVarintSubscribe(dAtA, i, uint64(m.Op)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } func encodeVarintSubscribe(dAtA []byte, offset int, v uint64) int { offset -= sovSubscribe(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return base } func (m *SubscribeRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Topic != 0 { n += 1 + sovSubscribe(uint64(m.Topic)) } l = len(m.Key) if l > 0 { n += 1 + l + sovSubscribe(uint64(l)) } l = len(m.Token) if l > 0 { n += 1 + l + sovSubscribe(uint64(l)) } if m.Index != 0 { n += 1 + sovSubscribe(uint64(m.Index)) } l = len(m.Datacenter) if l > 0 { n += 1 + l + sovSubscribe(uint64(l)) } l = len(m.Namespace) if l > 0 { n += 1 + l + sovSubscribe(uint64(l)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *Event) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Key) if l > 0 { n += 1 + l + sovSubscribe(uint64(l)) } if m.Index != 0 { n += 1 + sovSubscribe(uint64(m.Index)) } if m.Payload != nil { n += m.Payload.Size() } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *Event_EndOfSnapshot) Size() (n int) { if m == nil { return 0 } var l int _ = l n += 2 return n } func (m *Event_NewSnapshotToFollow) Size() (n int) { if m == nil { return 0 } var l int _ = l n += 2 return n } func (m *Event_EventBatch) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.EventBatch != nil { l = m.EventBatch.Size() n += 1 + l + sovSubscribe(uint64(l)) } return n } func (m *Event_ServiceHealth) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.ServiceHealth != nil { l = m.ServiceHealth.Size() n += 1 + l + sovSubscribe(uint64(l)) } return n } func (m *EventBatch) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.Events) > 0 { for _, e := range m.Events { l = e.Size() n += 1 + l + sovSubscribe(uint64(l)) } } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *ServiceHealthUpdate) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Op != 0 { n += 1 + sovSubscribe(uint64(m.Op)) } if m.CheckServiceNode != nil { l = m.CheckServiceNode.Size() n += 1 + l + sovSubscribe(uint64(l)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func sovSubscribe(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } func sozSubscribe(x uint64) (n int) { return sovSubscribe(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (m *SubscribeRequest) Unmarshal(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 ErrIntOverflowSubscribe } 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: SubscribeRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: SubscribeRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Topic", wireType) } m.Topic = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSubscribe } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Topic |= Topic(b&0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSubscribe } 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 ErrInvalidLengthSubscribe } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthSubscribe } if postIndex > l { return io.ErrUnexpectedEOF } m.Key = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: 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 ErrIntOverflowSubscribe } 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 ErrInvalidLengthSubscribe } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthSubscribe } if postIndex > l { return io.ErrUnexpectedEOF } m.Token = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) } m.Index = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSubscribe } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Index |= uint64(b&0x7F) << shift if b < 0x80 { break } } case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Datacenter", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSubscribe } 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 ErrInvalidLengthSubscribe } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthSubscribe } if postIndex > l { return io.ErrUnexpectedEOF } m.Datacenter = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSubscribe } 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 ErrInvalidLengthSubscribe } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthSubscribe } if postIndex > l { return io.ErrUnexpectedEOF } m.Namespace = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipSubscribe(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthSubscribe } if (iNdEx + skippy) < 0 { return ErrInvalidLengthSubscribe } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *Event) Unmarshal(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 ErrIntOverflowSubscribe } 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: Event: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Event: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSubscribe } 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 ErrInvalidLengthSubscribe } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthSubscribe } if postIndex > l { return io.ErrUnexpectedEOF } m.Key = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) } m.Index = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSubscribe } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Index |= uint64(b&0x7F) << shift if b < 0x80 { break } } case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field EndOfSnapshot", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSubscribe } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } b := bool(v != 0) m.Payload = &Event_EndOfSnapshot{b} case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field NewSnapshotToFollow", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSubscribe } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } b := bool(v != 0) m.Payload = &Event_NewSnapshotToFollow{b} case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field EventBatch", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSubscribe } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthSubscribe } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthSubscribe } if postIndex > l { return io.ErrUnexpectedEOF } v := &EventBatch{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } m.Payload = &Event_EventBatch{v} iNdEx = postIndex case 10: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ServiceHealth", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSubscribe } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthSubscribe } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthSubscribe } if postIndex > l { return io.ErrUnexpectedEOF } v := &ServiceHealthUpdate{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } m.Payload = &Event_ServiceHealth{v} iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipSubscribe(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthSubscribe } if (iNdEx + skippy) < 0 { return ErrInvalidLengthSubscribe } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *EventBatch) Unmarshal(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 ErrIntOverflowSubscribe } 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: EventBatch: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: EventBatch: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSubscribe } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthSubscribe } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthSubscribe } if postIndex > l { return io.ErrUnexpectedEOF } m.Events = append(m.Events, &Event{}) if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipSubscribe(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthSubscribe } if (iNdEx + skippy) < 0 { return ErrInvalidLengthSubscribe } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ServiceHealthUpdate) Unmarshal(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 ErrIntOverflowSubscribe } 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: ServiceHealthUpdate: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ServiceHealthUpdate: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Op", wireType) } m.Op = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSubscribe } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Op |= CatalogOp(b&0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field CheckServiceNode", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSubscribe } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthSubscribe } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthSubscribe } if postIndex > l { return io.ErrUnexpectedEOF } if m.CheckServiceNode == nil { m.CheckServiceNode = &pbservice.CheckServiceNode{} } if err := m.CheckServiceNode.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipSubscribe(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthSubscribe } if (iNdEx + skippy) < 0 { return ErrInvalidLengthSubscribe } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func skipSubscribe(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowSubscribe } 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, ErrIntOverflowSubscribe } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } iNdEx++ if dAtA[iNdEx-1] < 0x80 { break } } return iNdEx, nil case 1: iNdEx += 8 return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowSubscribe } 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, ErrInvalidLengthSubscribe } iNdEx += length if iNdEx < 0 { return 0, ErrInvalidLengthSubscribe } return iNdEx, nil case 3: for { var innerWire uint64 var start int = iNdEx for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowSubscribe } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ innerWire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } innerWireType := int(innerWire & 0x7) if innerWireType == 4 { break } next, err := skipSubscribe(dAtA[start:]) if err != nil { return 0, err } iNdEx = start + next if iNdEx < 0 { return 0, ErrInvalidLengthSubscribe } } return iNdEx, nil case 4: return iNdEx, nil case 5: iNdEx += 4 return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } } panic("unreachable") } var ( ErrInvalidLengthSubscribe = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowSubscribe = fmt.Errorf("proto: integer overflow") )