...

Source file src/go.etcd.io/etcd/raft/v3/raftpb/raft.pb.go

Documentation: go.etcd.io/etcd/raft/v3/raftpb

     1  // Code generated by protoc-gen-gogo. DO NOT EDIT.
     2  // source: raft.proto
     3  
     4  package raftpb
     5  
     6  import (
     7  	fmt "fmt"
     8  	io "io"
     9  	math "math"
    10  	math_bits "math/bits"
    11  
    12  	_ "github.com/gogo/protobuf/gogoproto"
    13  	proto "github.com/golang/protobuf/proto"
    14  )
    15  
    16  // Reference imports to suppress errors if they are not otherwise used.
    17  var _ = proto.Marshal
    18  var _ = fmt.Errorf
    19  var _ = math.Inf
    20  
    21  // This is a compile-time assertion to ensure that this generated file
    22  // is compatible with the proto package it is being compiled against.
    23  // A compilation error at this line likely means your copy of the
    24  // proto package needs to be updated.
    25  const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
    26  
    27  type EntryType int32
    28  
    29  const (
    30  	EntryNormal       EntryType = 0
    31  	EntryConfChange   EntryType = 1
    32  	EntryConfChangeV2 EntryType = 2
    33  )
    34  
    35  var EntryType_name = map[int32]string{
    36  	0: "EntryNormal",
    37  	1: "EntryConfChange",
    38  	2: "EntryConfChangeV2",
    39  }
    40  
    41  var EntryType_value = map[string]int32{
    42  	"EntryNormal":       0,
    43  	"EntryConfChange":   1,
    44  	"EntryConfChangeV2": 2,
    45  }
    46  
    47  func (x EntryType) Enum() *EntryType {
    48  	p := new(EntryType)
    49  	*p = x
    50  	return p
    51  }
    52  
    53  func (x EntryType) String() string {
    54  	return proto.EnumName(EntryType_name, int32(x))
    55  }
    56  
    57  func (x *EntryType) UnmarshalJSON(data []byte) error {
    58  	value, err := proto.UnmarshalJSONEnum(EntryType_value, data, "EntryType")
    59  	if err != nil {
    60  		return err
    61  	}
    62  	*x = EntryType(value)
    63  	return nil
    64  }
    65  
    66  func (EntryType) EnumDescriptor() ([]byte, []int) {
    67  	return fileDescriptor_b042552c306ae59b, []int{0}
    68  }
    69  
    70  // For description of different message types, see:
    71  // https://pkg.go.dev/go.etcd.io/etcd/raft/v3#hdr-MessageType
    72  type MessageType int32
    73  
    74  const (
    75  	MsgHup            MessageType = 0
    76  	MsgBeat           MessageType = 1
    77  	MsgProp           MessageType = 2
    78  	MsgApp            MessageType = 3
    79  	MsgAppResp        MessageType = 4
    80  	MsgVote           MessageType = 5
    81  	MsgVoteResp       MessageType = 6
    82  	MsgSnap           MessageType = 7
    83  	MsgHeartbeat      MessageType = 8
    84  	MsgHeartbeatResp  MessageType = 9
    85  	MsgUnreachable    MessageType = 10
    86  	MsgSnapStatus     MessageType = 11
    87  	MsgCheckQuorum    MessageType = 12
    88  	MsgTransferLeader MessageType = 13
    89  	MsgTimeoutNow     MessageType = 14
    90  	MsgReadIndex      MessageType = 15
    91  	MsgReadIndexResp  MessageType = 16
    92  	MsgPreVote        MessageType = 17
    93  	MsgPreVoteResp    MessageType = 18
    94  )
    95  
    96  var MessageType_name = map[int32]string{
    97  	0:  "MsgHup",
    98  	1:  "MsgBeat",
    99  	2:  "MsgProp",
   100  	3:  "MsgApp",
   101  	4:  "MsgAppResp",
   102  	5:  "MsgVote",
   103  	6:  "MsgVoteResp",
   104  	7:  "MsgSnap",
   105  	8:  "MsgHeartbeat",
   106  	9:  "MsgHeartbeatResp",
   107  	10: "MsgUnreachable",
   108  	11: "MsgSnapStatus",
   109  	12: "MsgCheckQuorum",
   110  	13: "MsgTransferLeader",
   111  	14: "MsgTimeoutNow",
   112  	15: "MsgReadIndex",
   113  	16: "MsgReadIndexResp",
   114  	17: "MsgPreVote",
   115  	18: "MsgPreVoteResp",
   116  }
   117  
   118  var MessageType_value = map[string]int32{
   119  	"MsgHup":            0,
   120  	"MsgBeat":           1,
   121  	"MsgProp":           2,
   122  	"MsgApp":            3,
   123  	"MsgAppResp":        4,
   124  	"MsgVote":           5,
   125  	"MsgVoteResp":       6,
   126  	"MsgSnap":           7,
   127  	"MsgHeartbeat":      8,
   128  	"MsgHeartbeatResp":  9,
   129  	"MsgUnreachable":    10,
   130  	"MsgSnapStatus":     11,
   131  	"MsgCheckQuorum":    12,
   132  	"MsgTransferLeader": 13,
   133  	"MsgTimeoutNow":     14,
   134  	"MsgReadIndex":      15,
   135  	"MsgReadIndexResp":  16,
   136  	"MsgPreVote":        17,
   137  	"MsgPreVoteResp":    18,
   138  }
   139  
   140  func (x MessageType) Enum() *MessageType {
   141  	p := new(MessageType)
   142  	*p = x
   143  	return p
   144  }
   145  
   146  func (x MessageType) String() string {
   147  	return proto.EnumName(MessageType_name, int32(x))
   148  }
   149  
   150  func (x *MessageType) UnmarshalJSON(data []byte) error {
   151  	value, err := proto.UnmarshalJSONEnum(MessageType_value, data, "MessageType")
   152  	if err != nil {
   153  		return err
   154  	}
   155  	*x = MessageType(value)
   156  	return nil
   157  }
   158  
   159  func (MessageType) EnumDescriptor() ([]byte, []int) {
   160  	return fileDescriptor_b042552c306ae59b, []int{1}
   161  }
   162  
   163  // ConfChangeTransition specifies the behavior of a configuration change with
   164  // respect to joint consensus.
   165  type ConfChangeTransition int32
   166  
   167  const (
   168  	// Automatically use the simple protocol if possible, otherwise fall back
   169  	// to ConfChangeJointImplicit. Most applications will want to use this.
   170  	ConfChangeTransitionAuto ConfChangeTransition = 0
   171  	// Use joint consensus unconditionally, and transition out of them
   172  	// automatically (by proposing a zero configuration change).
   173  	//
   174  	// This option is suitable for applications that want to minimize the time
   175  	// spent in the joint configuration and do not store the joint configuration
   176  	// in the state machine (outside of InitialState).
   177  	ConfChangeTransitionJointImplicit ConfChangeTransition = 1
   178  	// Use joint consensus and remain in the joint configuration until the
   179  	// application proposes a no-op configuration change. This is suitable for
   180  	// applications that want to explicitly control the transitions, for example
   181  	// to use a custom payload (via the Context field).
   182  	ConfChangeTransitionJointExplicit ConfChangeTransition = 2
   183  )
   184  
   185  var ConfChangeTransition_name = map[int32]string{
   186  	0: "ConfChangeTransitionAuto",
   187  	1: "ConfChangeTransitionJointImplicit",
   188  	2: "ConfChangeTransitionJointExplicit",
   189  }
   190  
   191  var ConfChangeTransition_value = map[string]int32{
   192  	"ConfChangeTransitionAuto":          0,
   193  	"ConfChangeTransitionJointImplicit": 1,
   194  	"ConfChangeTransitionJointExplicit": 2,
   195  }
   196  
   197  func (x ConfChangeTransition) Enum() *ConfChangeTransition {
   198  	p := new(ConfChangeTransition)
   199  	*p = x
   200  	return p
   201  }
   202  
   203  func (x ConfChangeTransition) String() string {
   204  	return proto.EnumName(ConfChangeTransition_name, int32(x))
   205  }
   206  
   207  func (x *ConfChangeTransition) UnmarshalJSON(data []byte) error {
   208  	value, err := proto.UnmarshalJSONEnum(ConfChangeTransition_value, data, "ConfChangeTransition")
   209  	if err != nil {
   210  		return err
   211  	}
   212  	*x = ConfChangeTransition(value)
   213  	return nil
   214  }
   215  
   216  func (ConfChangeTransition) EnumDescriptor() ([]byte, []int) {
   217  	return fileDescriptor_b042552c306ae59b, []int{2}
   218  }
   219  
   220  type ConfChangeType int32
   221  
   222  const (
   223  	ConfChangeAddNode        ConfChangeType = 0
   224  	ConfChangeRemoveNode     ConfChangeType = 1
   225  	ConfChangeUpdateNode     ConfChangeType = 2
   226  	ConfChangeAddLearnerNode ConfChangeType = 3
   227  )
   228  
   229  var ConfChangeType_name = map[int32]string{
   230  	0: "ConfChangeAddNode",
   231  	1: "ConfChangeRemoveNode",
   232  	2: "ConfChangeUpdateNode",
   233  	3: "ConfChangeAddLearnerNode",
   234  }
   235  
   236  var ConfChangeType_value = map[string]int32{
   237  	"ConfChangeAddNode":        0,
   238  	"ConfChangeRemoveNode":     1,
   239  	"ConfChangeUpdateNode":     2,
   240  	"ConfChangeAddLearnerNode": 3,
   241  }
   242  
   243  func (x ConfChangeType) Enum() *ConfChangeType {
   244  	p := new(ConfChangeType)
   245  	*p = x
   246  	return p
   247  }
   248  
   249  func (x ConfChangeType) String() string {
   250  	return proto.EnumName(ConfChangeType_name, int32(x))
   251  }
   252  
   253  func (x *ConfChangeType) UnmarshalJSON(data []byte) error {
   254  	value, err := proto.UnmarshalJSONEnum(ConfChangeType_value, data, "ConfChangeType")
   255  	if err != nil {
   256  		return err
   257  	}
   258  	*x = ConfChangeType(value)
   259  	return nil
   260  }
   261  
   262  func (ConfChangeType) EnumDescriptor() ([]byte, []int) {
   263  	return fileDescriptor_b042552c306ae59b, []int{3}
   264  }
   265  
   266  type Entry struct {
   267  	Term  uint64    `protobuf:"varint,2,opt,name=Term" json:"Term"`
   268  	Index uint64    `protobuf:"varint,3,opt,name=Index" json:"Index"`
   269  	Type  EntryType `protobuf:"varint,1,opt,name=Type,enum=raftpb.EntryType" json:"Type"`
   270  	Data  []byte    `protobuf:"bytes,4,opt,name=Data" json:"Data,omitempty"`
   271  }
   272  
   273  func (m *Entry) Reset()         { *m = Entry{} }
   274  func (m *Entry) String() string { return proto.CompactTextString(m) }
   275  func (*Entry) ProtoMessage()    {}
   276  func (*Entry) Descriptor() ([]byte, []int) {
   277  	return fileDescriptor_b042552c306ae59b, []int{0}
   278  }
   279  func (m *Entry) XXX_Unmarshal(b []byte) error {
   280  	return m.Unmarshal(b)
   281  }
   282  func (m *Entry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   283  	if deterministic {
   284  		return xxx_messageInfo_Entry.Marshal(b, m, deterministic)
   285  	} else {
   286  		b = b[:cap(b)]
   287  		n, err := m.MarshalToSizedBuffer(b)
   288  		if err != nil {
   289  			return nil, err
   290  		}
   291  		return b[:n], nil
   292  	}
   293  }
   294  func (m *Entry) XXX_Merge(src proto.Message) {
   295  	xxx_messageInfo_Entry.Merge(m, src)
   296  }
   297  func (m *Entry) XXX_Size() int {
   298  	return m.Size()
   299  }
   300  func (m *Entry) XXX_DiscardUnknown() {
   301  	xxx_messageInfo_Entry.DiscardUnknown(m)
   302  }
   303  
   304  var xxx_messageInfo_Entry proto.InternalMessageInfo
   305  
   306  type SnapshotMetadata struct {
   307  	ConfState ConfState `protobuf:"bytes,1,opt,name=conf_state,json=confState" json:"conf_state"`
   308  	Index     uint64    `protobuf:"varint,2,opt,name=index" json:"index"`
   309  	Term      uint64    `protobuf:"varint,3,opt,name=term" json:"term"`
   310  }
   311  
   312  func (m *SnapshotMetadata) Reset()         { *m = SnapshotMetadata{} }
   313  func (m *SnapshotMetadata) String() string { return proto.CompactTextString(m) }
   314  func (*SnapshotMetadata) ProtoMessage()    {}
   315  func (*SnapshotMetadata) Descriptor() ([]byte, []int) {
   316  	return fileDescriptor_b042552c306ae59b, []int{1}
   317  }
   318  func (m *SnapshotMetadata) XXX_Unmarshal(b []byte) error {
   319  	return m.Unmarshal(b)
   320  }
   321  func (m *SnapshotMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   322  	if deterministic {
   323  		return xxx_messageInfo_SnapshotMetadata.Marshal(b, m, deterministic)
   324  	} else {
   325  		b = b[:cap(b)]
   326  		n, err := m.MarshalToSizedBuffer(b)
   327  		if err != nil {
   328  			return nil, err
   329  		}
   330  		return b[:n], nil
   331  	}
   332  }
   333  func (m *SnapshotMetadata) XXX_Merge(src proto.Message) {
   334  	xxx_messageInfo_SnapshotMetadata.Merge(m, src)
   335  }
   336  func (m *SnapshotMetadata) XXX_Size() int {
   337  	return m.Size()
   338  }
   339  func (m *SnapshotMetadata) XXX_DiscardUnknown() {
   340  	xxx_messageInfo_SnapshotMetadata.DiscardUnknown(m)
   341  }
   342  
   343  var xxx_messageInfo_SnapshotMetadata proto.InternalMessageInfo
   344  
   345  type Snapshot struct {
   346  	Data     []byte           `protobuf:"bytes,1,opt,name=data" json:"data,omitempty"`
   347  	Metadata SnapshotMetadata `protobuf:"bytes,2,opt,name=metadata" json:"metadata"`
   348  }
   349  
   350  func (m *Snapshot) Reset()         { *m = Snapshot{} }
   351  func (m *Snapshot) String() string { return proto.CompactTextString(m) }
   352  func (*Snapshot) ProtoMessage()    {}
   353  func (*Snapshot) Descriptor() ([]byte, []int) {
   354  	return fileDescriptor_b042552c306ae59b, []int{2}
   355  }
   356  func (m *Snapshot) XXX_Unmarshal(b []byte) error {
   357  	return m.Unmarshal(b)
   358  }
   359  func (m *Snapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   360  	if deterministic {
   361  		return xxx_messageInfo_Snapshot.Marshal(b, m, deterministic)
   362  	} else {
   363  		b = b[:cap(b)]
   364  		n, err := m.MarshalToSizedBuffer(b)
   365  		if err != nil {
   366  			return nil, err
   367  		}
   368  		return b[:n], nil
   369  	}
   370  }
   371  func (m *Snapshot) XXX_Merge(src proto.Message) {
   372  	xxx_messageInfo_Snapshot.Merge(m, src)
   373  }
   374  func (m *Snapshot) XXX_Size() int {
   375  	return m.Size()
   376  }
   377  func (m *Snapshot) XXX_DiscardUnknown() {
   378  	xxx_messageInfo_Snapshot.DiscardUnknown(m)
   379  }
   380  
   381  var xxx_messageInfo_Snapshot proto.InternalMessageInfo
   382  
   383  type Message struct {
   384  	Type MessageType `protobuf:"varint,1,opt,name=type,enum=raftpb.MessageType" json:"type"`
   385  	To   uint64      `protobuf:"varint,2,opt,name=to" json:"to"`
   386  	From uint64      `protobuf:"varint,3,opt,name=from" json:"from"`
   387  	Term uint64      `protobuf:"varint,4,opt,name=term" json:"term"`
   388  	// logTerm is generally used for appending Raft logs to followers. For example,
   389  	// (type=MsgApp,index=100,logTerm=5) means leader appends entries starting at
   390  	// index=101, and the term of entry at index 100 is 5.
   391  	// (type=MsgAppResp,reject=true,index=100,logTerm=5) means follower rejects some
   392  	// entries from its leader as it already has an entry with term 5 at index 100.
   393  	LogTerm    uint64   `protobuf:"varint,5,opt,name=logTerm" json:"logTerm"`
   394  	Index      uint64   `protobuf:"varint,6,opt,name=index" json:"index"`
   395  	Entries    []Entry  `protobuf:"bytes,7,rep,name=entries" json:"entries"`
   396  	Commit     uint64   `protobuf:"varint,8,opt,name=commit" json:"commit"`
   397  	Snapshot   Snapshot `protobuf:"bytes,9,opt,name=snapshot" json:"snapshot"`
   398  	Reject     bool     `protobuf:"varint,10,opt,name=reject" json:"reject"`
   399  	RejectHint uint64   `protobuf:"varint,11,opt,name=rejectHint" json:"rejectHint"`
   400  	Context    []byte   `protobuf:"bytes,12,opt,name=context" json:"context,omitempty"`
   401  }
   402  
   403  func (m *Message) Reset()         { *m = Message{} }
   404  func (m *Message) String() string { return proto.CompactTextString(m) }
   405  func (*Message) ProtoMessage()    {}
   406  func (*Message) Descriptor() ([]byte, []int) {
   407  	return fileDescriptor_b042552c306ae59b, []int{3}
   408  }
   409  func (m *Message) XXX_Unmarshal(b []byte) error {
   410  	return m.Unmarshal(b)
   411  }
   412  func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   413  	if deterministic {
   414  		return xxx_messageInfo_Message.Marshal(b, m, deterministic)
   415  	} else {
   416  		b = b[:cap(b)]
   417  		n, err := m.MarshalToSizedBuffer(b)
   418  		if err != nil {
   419  			return nil, err
   420  		}
   421  		return b[:n], nil
   422  	}
   423  }
   424  func (m *Message) XXX_Merge(src proto.Message) {
   425  	xxx_messageInfo_Message.Merge(m, src)
   426  }
   427  func (m *Message) XXX_Size() int {
   428  	return m.Size()
   429  }
   430  func (m *Message) XXX_DiscardUnknown() {
   431  	xxx_messageInfo_Message.DiscardUnknown(m)
   432  }
   433  
   434  var xxx_messageInfo_Message proto.InternalMessageInfo
   435  
   436  type HardState struct {
   437  	Term   uint64 `protobuf:"varint,1,opt,name=term" json:"term"`
   438  	Vote   uint64 `protobuf:"varint,2,opt,name=vote" json:"vote"`
   439  	Commit uint64 `protobuf:"varint,3,opt,name=commit" json:"commit"`
   440  }
   441  
   442  func (m *HardState) Reset()         { *m = HardState{} }
   443  func (m *HardState) String() string { return proto.CompactTextString(m) }
   444  func (*HardState) ProtoMessage()    {}
   445  func (*HardState) Descriptor() ([]byte, []int) {
   446  	return fileDescriptor_b042552c306ae59b, []int{4}
   447  }
   448  func (m *HardState) XXX_Unmarshal(b []byte) error {
   449  	return m.Unmarshal(b)
   450  }
   451  func (m *HardState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   452  	if deterministic {
   453  		return xxx_messageInfo_HardState.Marshal(b, m, deterministic)
   454  	} else {
   455  		b = b[:cap(b)]
   456  		n, err := m.MarshalToSizedBuffer(b)
   457  		if err != nil {
   458  			return nil, err
   459  		}
   460  		return b[:n], nil
   461  	}
   462  }
   463  func (m *HardState) XXX_Merge(src proto.Message) {
   464  	xxx_messageInfo_HardState.Merge(m, src)
   465  }
   466  func (m *HardState) XXX_Size() int {
   467  	return m.Size()
   468  }
   469  func (m *HardState) XXX_DiscardUnknown() {
   470  	xxx_messageInfo_HardState.DiscardUnknown(m)
   471  }
   472  
   473  var xxx_messageInfo_HardState proto.InternalMessageInfo
   474  
   475  type ConfState struct {
   476  	// The voters in the incoming config. (If the configuration is not joint,
   477  	// then the outgoing config is empty).
   478  	Voters []uint64 `protobuf:"varint,1,rep,name=voters" json:"voters,omitempty"`
   479  	// The learners in the incoming config.
   480  	Learners []uint64 `protobuf:"varint,2,rep,name=learners" json:"learners,omitempty"`
   481  	// The voters in the outgoing config.
   482  	VotersOutgoing []uint64 `protobuf:"varint,3,rep,name=voters_outgoing,json=votersOutgoing" json:"voters_outgoing,omitempty"`
   483  	// The nodes that will become learners when the outgoing config is removed.
   484  	// These nodes are necessarily currently in nodes_joint (or they would have
   485  	// been added to the incoming config right away).
   486  	LearnersNext []uint64 `protobuf:"varint,4,rep,name=learners_next,json=learnersNext" json:"learners_next,omitempty"`
   487  	// If set, the config is joint and Raft will automatically transition into
   488  	// the final config (i.e. remove the outgoing config) when this is safe.
   489  	AutoLeave bool `protobuf:"varint,5,opt,name=auto_leave,json=autoLeave" json:"auto_leave"`
   490  }
   491  
   492  func (m *ConfState) Reset()         { *m = ConfState{} }
   493  func (m *ConfState) String() string { return proto.CompactTextString(m) }
   494  func (*ConfState) ProtoMessage()    {}
   495  func (*ConfState) Descriptor() ([]byte, []int) {
   496  	return fileDescriptor_b042552c306ae59b, []int{5}
   497  }
   498  func (m *ConfState) XXX_Unmarshal(b []byte) error {
   499  	return m.Unmarshal(b)
   500  }
   501  func (m *ConfState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   502  	if deterministic {
   503  		return xxx_messageInfo_ConfState.Marshal(b, m, deterministic)
   504  	} else {
   505  		b = b[:cap(b)]
   506  		n, err := m.MarshalToSizedBuffer(b)
   507  		if err != nil {
   508  			return nil, err
   509  		}
   510  		return b[:n], nil
   511  	}
   512  }
   513  func (m *ConfState) XXX_Merge(src proto.Message) {
   514  	xxx_messageInfo_ConfState.Merge(m, src)
   515  }
   516  func (m *ConfState) XXX_Size() int {
   517  	return m.Size()
   518  }
   519  func (m *ConfState) XXX_DiscardUnknown() {
   520  	xxx_messageInfo_ConfState.DiscardUnknown(m)
   521  }
   522  
   523  var xxx_messageInfo_ConfState proto.InternalMessageInfo
   524  
   525  type ConfChange struct {
   526  	Type    ConfChangeType `protobuf:"varint,2,opt,name=type,enum=raftpb.ConfChangeType" json:"type"`
   527  	NodeID  uint64         `protobuf:"varint,3,opt,name=node_id,json=nodeId" json:"node_id"`
   528  	Context []byte         `protobuf:"bytes,4,opt,name=context" json:"context,omitempty"`
   529  	// NB: this is used only by etcd to thread through a unique identifier.
   530  	// Ideally it should really use the Context instead. No counterpart to
   531  	// this field exists in ConfChangeV2.
   532  	ID uint64 `protobuf:"varint,1,opt,name=id" json:"id"`
   533  }
   534  
   535  func (m *ConfChange) Reset()         { *m = ConfChange{} }
   536  func (m *ConfChange) String() string { return proto.CompactTextString(m) }
   537  func (*ConfChange) ProtoMessage()    {}
   538  func (*ConfChange) Descriptor() ([]byte, []int) {
   539  	return fileDescriptor_b042552c306ae59b, []int{6}
   540  }
   541  func (m *ConfChange) XXX_Unmarshal(b []byte) error {
   542  	return m.Unmarshal(b)
   543  }
   544  func (m *ConfChange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   545  	if deterministic {
   546  		return xxx_messageInfo_ConfChange.Marshal(b, m, deterministic)
   547  	} else {
   548  		b = b[:cap(b)]
   549  		n, err := m.MarshalToSizedBuffer(b)
   550  		if err != nil {
   551  			return nil, err
   552  		}
   553  		return b[:n], nil
   554  	}
   555  }
   556  func (m *ConfChange) XXX_Merge(src proto.Message) {
   557  	xxx_messageInfo_ConfChange.Merge(m, src)
   558  }
   559  func (m *ConfChange) XXX_Size() int {
   560  	return m.Size()
   561  }
   562  func (m *ConfChange) XXX_DiscardUnknown() {
   563  	xxx_messageInfo_ConfChange.DiscardUnknown(m)
   564  }
   565  
   566  var xxx_messageInfo_ConfChange proto.InternalMessageInfo
   567  
   568  // ConfChangeSingle is an individual configuration change operation. Multiple
   569  // such operations can be carried out atomically via a ConfChangeV2.
   570  type ConfChangeSingle struct {
   571  	Type   ConfChangeType `protobuf:"varint,1,opt,name=type,enum=raftpb.ConfChangeType" json:"type"`
   572  	NodeID uint64         `protobuf:"varint,2,opt,name=node_id,json=nodeId" json:"node_id"`
   573  }
   574  
   575  func (m *ConfChangeSingle) Reset()         { *m = ConfChangeSingle{} }
   576  func (m *ConfChangeSingle) String() string { return proto.CompactTextString(m) }
   577  func (*ConfChangeSingle) ProtoMessage()    {}
   578  func (*ConfChangeSingle) Descriptor() ([]byte, []int) {
   579  	return fileDescriptor_b042552c306ae59b, []int{7}
   580  }
   581  func (m *ConfChangeSingle) XXX_Unmarshal(b []byte) error {
   582  	return m.Unmarshal(b)
   583  }
   584  func (m *ConfChangeSingle) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   585  	if deterministic {
   586  		return xxx_messageInfo_ConfChangeSingle.Marshal(b, m, deterministic)
   587  	} else {
   588  		b = b[:cap(b)]
   589  		n, err := m.MarshalToSizedBuffer(b)
   590  		if err != nil {
   591  			return nil, err
   592  		}
   593  		return b[:n], nil
   594  	}
   595  }
   596  func (m *ConfChangeSingle) XXX_Merge(src proto.Message) {
   597  	xxx_messageInfo_ConfChangeSingle.Merge(m, src)
   598  }
   599  func (m *ConfChangeSingle) XXX_Size() int {
   600  	return m.Size()
   601  }
   602  func (m *ConfChangeSingle) XXX_DiscardUnknown() {
   603  	xxx_messageInfo_ConfChangeSingle.DiscardUnknown(m)
   604  }
   605  
   606  var xxx_messageInfo_ConfChangeSingle proto.InternalMessageInfo
   607  
   608  // ConfChangeV2 messages initiate configuration changes. They support both the
   609  // simple "one at a time" membership change protocol and full Joint Consensus
   610  // allowing for arbitrary changes in membership.
   611  //
   612  // The supplied context is treated as an opaque payload and can be used to
   613  // attach an action on the state machine to the application of the config change
   614  // proposal. Note that contrary to Joint Consensus as outlined in the Raft
   615  // paper[1], configuration changes become active when they are *applied* to the
   616  // state machine (not when they are appended to the log).
   617  //
   618  // The simple protocol can be used whenever only a single change is made.
   619  //
   620  // Non-simple changes require the use of Joint Consensus, for which two
   621  // configuration changes are run. The first configuration change specifies the
   622  // desired changes and transitions the Raft group into the joint configuration,
   623  // in which quorum requires a majority of both the pre-changes and post-changes
   624  // configuration. Joint Consensus avoids entering fragile intermediate
   625  // configurations that could compromise survivability. For example, without the
   626  // use of Joint Consensus and running across three availability zones with a
   627  // replication factor of three, it is not possible to replace a voter without
   628  // entering an intermediate configuration that does not survive the outage of
   629  // one availability zone.
   630  //
   631  // The provided ConfChangeTransition specifies how (and whether) Joint Consensus
   632  // is used, and assigns the task of leaving the joint configuration either to
   633  // Raft or the application. Leaving the joint configuration is accomplished by
   634  // proposing a ConfChangeV2 with only and optionally the Context field
   635  // populated.
   636  //
   637  // For details on Raft membership changes, see:
   638  //
   639  // [1]: https://github.com/ongardie/dissertation/blob/master/online-trim.pdf
   640  type ConfChangeV2 struct {
   641  	Transition ConfChangeTransition `protobuf:"varint,1,opt,name=transition,enum=raftpb.ConfChangeTransition" json:"transition"`
   642  	Changes    []ConfChangeSingle   `protobuf:"bytes,2,rep,name=changes" json:"changes"`
   643  	Context    []byte               `protobuf:"bytes,3,opt,name=context" json:"context,omitempty"`
   644  }
   645  
   646  func (m *ConfChangeV2) Reset()         { *m = ConfChangeV2{} }
   647  func (m *ConfChangeV2) String() string { return proto.CompactTextString(m) }
   648  func (*ConfChangeV2) ProtoMessage()    {}
   649  func (*ConfChangeV2) Descriptor() ([]byte, []int) {
   650  	return fileDescriptor_b042552c306ae59b, []int{8}
   651  }
   652  func (m *ConfChangeV2) XXX_Unmarshal(b []byte) error {
   653  	return m.Unmarshal(b)
   654  }
   655  func (m *ConfChangeV2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   656  	if deterministic {
   657  		return xxx_messageInfo_ConfChangeV2.Marshal(b, m, deterministic)
   658  	} else {
   659  		b = b[:cap(b)]
   660  		n, err := m.MarshalToSizedBuffer(b)
   661  		if err != nil {
   662  			return nil, err
   663  		}
   664  		return b[:n], nil
   665  	}
   666  }
   667  func (m *ConfChangeV2) XXX_Merge(src proto.Message) {
   668  	xxx_messageInfo_ConfChangeV2.Merge(m, src)
   669  }
   670  func (m *ConfChangeV2) XXX_Size() int {
   671  	return m.Size()
   672  }
   673  func (m *ConfChangeV2) XXX_DiscardUnknown() {
   674  	xxx_messageInfo_ConfChangeV2.DiscardUnknown(m)
   675  }
   676  
   677  var xxx_messageInfo_ConfChangeV2 proto.InternalMessageInfo
   678  
   679  func init() {
   680  	proto.RegisterEnum("raftpb.EntryType", EntryType_name, EntryType_value)
   681  	proto.RegisterEnum("raftpb.MessageType", MessageType_name, MessageType_value)
   682  	proto.RegisterEnum("raftpb.ConfChangeTransition", ConfChangeTransition_name, ConfChangeTransition_value)
   683  	proto.RegisterEnum("raftpb.ConfChangeType", ConfChangeType_name, ConfChangeType_value)
   684  	proto.RegisterType((*Entry)(nil), "raftpb.Entry")
   685  	proto.RegisterType((*SnapshotMetadata)(nil), "raftpb.SnapshotMetadata")
   686  	proto.RegisterType((*Snapshot)(nil), "raftpb.Snapshot")
   687  	proto.RegisterType((*Message)(nil), "raftpb.Message")
   688  	proto.RegisterType((*HardState)(nil), "raftpb.HardState")
   689  	proto.RegisterType((*ConfState)(nil), "raftpb.ConfState")
   690  	proto.RegisterType((*ConfChange)(nil), "raftpb.ConfChange")
   691  	proto.RegisterType((*ConfChangeSingle)(nil), "raftpb.ConfChangeSingle")
   692  	proto.RegisterType((*ConfChangeV2)(nil), "raftpb.ConfChangeV2")
   693  }
   694  
   695  func init() { proto.RegisterFile("raft.proto", fileDescriptor_b042552c306ae59b) }
   696  
   697  var fileDescriptor_b042552c306ae59b = []byte{
   698  	// 1026 bytes of a gzipped FileDescriptorProto
   699  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0xcd, 0x6e, 0xdb, 0x46,
   700  	0x17, 0x25, 0x29, 0x5a, 0x3f, 0x57, 0xb2, 0x3c, 0xbe, 0xf1, 0x17, 0x10, 0x86, 0xc1, 0xe8, 0x53,
   701  	0x52, 0x44, 0x70, 0x11, 0xb7, 0xd0, 0xa2, 0x28, 0xba, 0xf3, 0x4f, 0x00, 0xab, 0xb0, 0xdc, 0x54,
   702  	0x76, 0xbc, 0x28, 0x50, 0x08, 0x63, 0x71, 0x44, 0xb3, 0x15, 0x39, 0x04, 0x39, 0x72, 0xed, 0x4d,
   703  	0x51, 0xf4, 0x09, 0xba, 0xec, 0x26, 0xdb, 0x3e, 0x40, 0x9f, 0xc2, 0x4b, 0x03, 0xdd, 0x74, 0x15,
   704  	0x34, 0xf6, 0x8b, 0x14, 0x33, 0x1c, 0x4a, 0x94, 0x6c, 0x64, 0xd1, 0xdd, 0xcc, 0xb9, 0x67, 0xee,
   705  	0x9c, 0x73, 0xef, 0xe5, 0x10, 0x20, 0xa1, 0x63, 0xb1, 0x13, 0x27, 0x5c, 0x70, 0x2c, 0xcb, 0x75,
   706  	0x7c, 0xbe, 0xb9, 0xe1, 0x73, 0x9f, 0x2b, 0xe8, 0x33, 0xb9, 0xca, 0xa2, 0xed, 0x9f, 0x61, 0xe5,
   707  	0x75, 0x24, 0x92, 0x6b, 0x74, 0xc0, 0x3e, 0x65, 0x49, 0xe8, 0x58, 0x2d, 0xb3, 0x63, 0xef, 0xd9,
   708  	0x37, 0xef, 0x9f, 0x19, 0x03, 0x85, 0xe0, 0x26, 0xac, 0xf4, 0x22, 0x8f, 0x5d, 0x39, 0xa5, 0x42,
   709  	0x28, 0x83, 0xf0, 0x53, 0xb0, 0x4f, 0xaf, 0x63, 0xe6, 0x98, 0x2d, 0xb3, 0xd3, 0xec, 0xae, 0xef,
   710  	0x64, 0x77, 0xed, 0xa8, 0x94, 0x32, 0x30, 0x4b, 0x74, 0x1d, 0x33, 0x44, 0xb0, 0x0f, 0xa8, 0xa0,
   711  	0x8e, 0xdd, 0x32, 0x3b, 0x8d, 0x81, 0x5a, 0xb7, 0x7f, 0x31, 0x81, 0x9c, 0x44, 0x34, 0x4e, 0x2f,
   712  	0xb8, 0xe8, 0x33, 0x41, 0x3d, 0x2a, 0x28, 0x7e, 0x01, 0x30, 0xe2, 0xd1, 0x78, 0x98, 0x0a, 0x2a,
   713  	0xb2, 0xdc, 0xf5, 0x79, 0xee, 0x7d, 0x1e, 0x8d, 0x4f, 0x64, 0x40, 0xe7, 0xae, 0x8d, 0x72, 0x40,
   714  	0x2a, 0x0d, 0x94, 0xd2, 0xa2, 0x89, 0x0c, 0x92, 0xfe, 0x84, 0xf4, 0x57, 0x34, 0xa1, 0x90, 0xf6,
   715  	0x77, 0x50, 0xcd, 0x15, 0x48, 0x89, 0x52, 0x81, 0xba, 0xb3, 0x31, 0x50, 0x6b, 0xfc, 0x0a, 0xaa,
   716  	0xa1, 0x56, 0xa6, 0x12, 0xd7, 0xbb, 0x4e, 0xae, 0x65, 0x59, 0xb9, 0xce, 0x3b, 0xe3, 0xb7, 0xdf,
   717  	0x95, 0xa0, 0xd2, 0x67, 0x69, 0x4a, 0x7d, 0x86, 0xaf, 0xc0, 0x16, 0xf3, 0x5a, 0x3d, 0xc9, 0x73,
   718  	0xe8, 0x70, 0xb1, 0x5a, 0x92, 0x86, 0x1b, 0x60, 0x09, 0xbe, 0xe0, 0xc4, 0x12, 0x5c, 0xda, 0x18,
   719  	0x27, 0x7c, 0xc9, 0x86, 0x44, 0x66, 0x06, 0xed, 0x65, 0x83, 0xe8, 0x42, 0x65, 0xc2, 0x7d, 0xd5,
   720  	0xdd, 0x95, 0x42, 0x30, 0x07, 0xe7, 0x65, 0x2b, 0x3f, 0x2c, 0xdb, 0x2b, 0xa8, 0xb0, 0x48, 0x24,
   721  	0x01, 0x4b, 0x9d, 0x4a, 0xab, 0xd4, 0xa9, 0x77, 0x57, 0x17, 0x7a, 0x9c, 0xa7, 0xd2, 0x1c, 0xdc,
   722  	0x82, 0xf2, 0x88, 0x87, 0x61, 0x20, 0x9c, 0x6a, 0x21, 0x97, 0xc6, 0xb0, 0x0b, 0xd5, 0x54, 0x57,
   723  	0xcc, 0xa9, 0xa9, 0x4a, 0x92, 0xe5, 0x4a, 0xe6, 0x15, 0xcc, 0x79, 0x32, 0x63, 0xc2, 0x7e, 0x60,
   724  	0x23, 0xe1, 0x40, 0xcb, 0xec, 0x54, 0xf3, 0x8c, 0x19, 0x86, 0x2f, 0x00, 0xb2, 0xd5, 0x61, 0x10,
   725  	0x09, 0xa7, 0x5e, 0xb8, 0xb3, 0x80, 0xa3, 0x03, 0x95, 0x11, 0x8f, 0x04, 0xbb, 0x12, 0x4e, 0x43,
   726  	0x35, 0x36, 0xdf, 0xb6, 0xbf, 0x87, 0xda, 0x21, 0x4d, 0xbc, 0x6c, 0x7c, 0xf2, 0x0a, 0x9a, 0x0f,
   727  	0x2a, 0xe8, 0x80, 0x7d, 0xc9, 0x05, 0x5b, 0xfc, 0x38, 0x24, 0x52, 0x30, 0x5c, 0x7a, 0x68, 0xb8,
   728  	0xfd, 0xa7, 0x09, 0xb5, 0xd9, 0xbc, 0xe2, 0x53, 0x28, 0xcb, 0x33, 0x49, 0xea, 0x98, 0xad, 0x52,
   729  	0xc7, 0x1e, 0xe8, 0x1d, 0x6e, 0x42, 0x75, 0xc2, 0x68, 0x12, 0xc9, 0x88, 0xa5, 0x22, 0xb3, 0x3d,
   730  	0xbe, 0x84, 0xb5, 0x8c, 0x35, 0xe4, 0x53, 0xe1, 0xf3, 0x20, 0xf2, 0x9d, 0x92, 0xa2, 0x34, 0x33,
   731  	0xf8, 0x1b, 0x8d, 0xe2, 0x73, 0x58, 0xcd, 0x0f, 0x0d, 0x23, 0xe9, 0xd4, 0x56, 0xb4, 0x46, 0x0e,
   732  	0x1e, 0xb3, 0x2b, 0x81, 0xcf, 0x01, 0xe8, 0x54, 0xf0, 0xe1, 0x84, 0xd1, 0x4b, 0xa6, 0x86, 0x21,
   733  	0x2f, 0x68, 0x4d, 0xe2, 0x47, 0x12, 0x6e, 0xbf, 0x33, 0x01, 0xa4, 0xe8, 0xfd, 0x0b, 0x1a, 0xf9,
   734  	0x0c, 0x3f, 0xd7, 0x63, 0x6b, 0xa9, 0xb1, 0x7d, 0x5a, 0xfc, 0x0c, 0x33, 0xc6, 0x83, 0xc9, 0x7d,
   735  	0x09, 0x95, 0x88, 0x7b, 0x6c, 0x18, 0x78, 0xba, 0x28, 0x4d, 0x19, 0xbc, 0x7b, 0xff, 0xac, 0x7c,
   736  	0xcc, 0x3d, 0xd6, 0x3b, 0x18, 0x94, 0x65, 0xb8, 0xe7, 0x15, 0xfb, 0x62, 0x2f, 0xf4, 0x05, 0x37,
   737  	0xc1, 0x0a, 0x3c, 0xdd, 0x08, 0xd0, 0xa7, 0xad, 0xde, 0xc1, 0xc0, 0x0a, 0xbc, 0x76, 0x08, 0x64,
   738  	0x7e, 0xf9, 0x49, 0x10, 0xf9, 0x93, 0xb9, 0x48, 0xf3, 0xbf, 0x88, 0xb4, 0x3e, 0x26, 0xb2, 0xfd,
   739  	0x87, 0x09, 0x8d, 0x79, 0x9e, 0xb3, 0x2e, 0xee, 0x01, 0x88, 0x84, 0x46, 0x69, 0x20, 0x02, 0x1e,
   740  	0xe9, 0x1b, 0xb7, 0x1e, 0xb9, 0x71, 0xc6, 0xc9, 0x27, 0x72, 0x7e, 0x0a, 0xbf, 0x84, 0xca, 0x48,
   741  	0xb1, 0xb2, 0x8e, 0x17, 0x9e, 0x94, 0x65, 0x6b, 0xf9, 0x17, 0xa6, 0xe9, 0xc5, 0x9a, 0x95, 0x16,
   742  	0x6a, 0xb6, 0x7d, 0x08, 0xb5, 0xd9, 0xbb, 0x8b, 0x6b, 0x50, 0x57, 0x9b, 0x63, 0x9e, 0x84, 0x74,
   743  	0x42, 0x0c, 0x7c, 0x02, 0x6b, 0x0a, 0x98, 0xe7, 0x27, 0x26, 0xfe, 0x0f, 0xd6, 0x97, 0xc0, 0xb3,
   744  	0x2e, 0xb1, 0xb6, 0xff, 0xb2, 0xa0, 0x5e, 0x78, 0x96, 0x10, 0xa0, 0xdc, 0x4f, 0xfd, 0xc3, 0x69,
   745  	0x4c, 0x0c, 0xac, 0x43, 0xa5, 0x9f, 0xfa, 0x7b, 0x8c, 0x0a, 0x62, 0xea, 0xcd, 0x9b, 0x84, 0xc7,
   746  	0xc4, 0xd2, 0xac, 0xdd, 0x38, 0x26, 0x25, 0x6c, 0x02, 0x64, 0xeb, 0x01, 0x4b, 0x63, 0x62, 0x6b,
   747  	0xe2, 0x19, 0x17, 0x8c, 0xac, 0x48, 0x6d, 0x7a, 0xa3, 0xa2, 0x65, 0x1d, 0x95, 0x4f, 0x00, 0xa9,
   748  	0x20, 0x81, 0x86, 0xbc, 0x8c, 0xd1, 0x44, 0x9c, 0xcb, 0x5b, 0xaa, 0xb8, 0x01, 0xa4, 0x88, 0xa8,
   749  	0x43, 0x35, 0x44, 0x68, 0xf6, 0x53, 0xff, 0x6d, 0x94, 0x30, 0x3a, 0xba, 0xa0, 0xe7, 0x13, 0x46,
   750  	0x00, 0xd7, 0x61, 0x55, 0x27, 0x92, 0x5f, 0xdc, 0x34, 0x25, 0x75, 0x4d, 0xdb, 0xbf, 0x60, 0xa3,
   751  	0x1f, 0xbf, 0x9d, 0xf2, 0x64, 0x1a, 0x92, 0x86, 0xb4, 0xdd, 0x4f, 0x7d, 0xd5, 0xa0, 0x31, 0x4b,
   752  	0x8e, 0x18, 0xf5, 0x58, 0x42, 0x56, 0xf5, 0xe9, 0xd3, 0x20, 0x64, 0x7c, 0x2a, 0x8e, 0xf9, 0x4f,
   753  	0xa4, 0xa9, 0xc5, 0x0c, 0x18, 0xf5, 0xd4, 0xff, 0x8e, 0xac, 0x69, 0x31, 0x33, 0x44, 0x89, 0x21,
   754  	0xda, 0xef, 0x9b, 0x84, 0x29, 0x8b, 0xeb, 0xfa, 0x56, 0xbd, 0x57, 0x1c, 0xdc, 0xfe, 0xd5, 0x84,
   755  	0x8d, 0xc7, 0xc6, 0x03, 0xb7, 0xc0, 0x79, 0x0c, 0xdf, 0x9d, 0x0a, 0x4e, 0x0c, 0xfc, 0x04, 0xfe,
   756  	0xff, 0x58, 0xf4, 0x6b, 0x1e, 0x44, 0xa2, 0x17, 0xc6, 0x93, 0x60, 0x14, 0xc8, 0x56, 0x7c, 0x8c,
   757  	0xf6, 0xfa, 0x4a, 0xd3, 0xac, 0xed, 0x6b, 0x68, 0x2e, 0x7e, 0x14, 0xb2, 0x18, 0x73, 0x64, 0xd7,
   758  	0xf3, 0xe4, 0xf8, 0x13, 0x03, 0x9d, 0xa2, 0xd8, 0x01, 0x0b, 0xf9, 0x25, 0x53, 0x11, 0x73, 0x31,
   759  	0xf2, 0x36, 0xf6, 0xa8, 0xc8, 0x22, 0xd6, 0xa2, 0x91, 0x5d, 0xcf, 0x3b, 0xca, 0xde, 0x1e, 0x15,
   760  	0x2d, 0xed, 0xbd, 0xb8, 0xf9, 0xe0, 0x1a, 0xb7, 0x1f, 0x5c, 0xe3, 0xe6, 0xce, 0x35, 0x6f, 0xef,
   761  	0x5c, 0xf3, 0x9f, 0x3b, 0xd7, 0xfc, 0xed, 0xde, 0x35, 0x7e, 0xbf, 0x77, 0x8d, 0xdb, 0x7b, 0xd7,
   762  	0xf8, 0xfb, 0xde, 0x35, 0xfe, 0x0d, 0x00, 0x00, 0xff, 0xff, 0xee, 0xe3, 0x39, 0x8b, 0xbb, 0x08,
   763  	0x00, 0x00,
   764  }
   765  
   766  func (m *Entry) Marshal() (dAtA []byte, err error) {
   767  	size := m.Size()
   768  	dAtA = make([]byte, size)
   769  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   770  	if err != nil {
   771  		return nil, err
   772  	}
   773  	return dAtA[:n], nil
   774  }
   775  
   776  func (m *Entry) MarshalTo(dAtA []byte) (int, error) {
   777  	size := m.Size()
   778  	return m.MarshalToSizedBuffer(dAtA[:size])
   779  }
   780  
   781  func (m *Entry) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   782  	i := len(dAtA)
   783  	_ = i
   784  	var l int
   785  	_ = l
   786  	if m.Data != nil {
   787  		i -= len(m.Data)
   788  		copy(dAtA[i:], m.Data)
   789  		i = encodeVarintRaft(dAtA, i, uint64(len(m.Data)))
   790  		i--
   791  		dAtA[i] = 0x22
   792  	}
   793  	i = encodeVarintRaft(dAtA, i, uint64(m.Index))
   794  	i--
   795  	dAtA[i] = 0x18
   796  	i = encodeVarintRaft(dAtA, i, uint64(m.Term))
   797  	i--
   798  	dAtA[i] = 0x10
   799  	i = encodeVarintRaft(dAtA, i, uint64(m.Type))
   800  	i--
   801  	dAtA[i] = 0x8
   802  	return len(dAtA) - i, nil
   803  }
   804  
   805  func (m *SnapshotMetadata) Marshal() (dAtA []byte, err error) {
   806  	size := m.Size()
   807  	dAtA = make([]byte, size)
   808  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   809  	if err != nil {
   810  		return nil, err
   811  	}
   812  	return dAtA[:n], nil
   813  }
   814  
   815  func (m *SnapshotMetadata) MarshalTo(dAtA []byte) (int, error) {
   816  	size := m.Size()
   817  	return m.MarshalToSizedBuffer(dAtA[:size])
   818  }
   819  
   820  func (m *SnapshotMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   821  	i := len(dAtA)
   822  	_ = i
   823  	var l int
   824  	_ = l
   825  	i = encodeVarintRaft(dAtA, i, uint64(m.Term))
   826  	i--
   827  	dAtA[i] = 0x18
   828  	i = encodeVarintRaft(dAtA, i, uint64(m.Index))
   829  	i--
   830  	dAtA[i] = 0x10
   831  	{
   832  		size, err := m.ConfState.MarshalToSizedBuffer(dAtA[:i])
   833  		if err != nil {
   834  			return 0, err
   835  		}
   836  		i -= size
   837  		i = encodeVarintRaft(dAtA, i, uint64(size))
   838  	}
   839  	i--
   840  	dAtA[i] = 0xa
   841  	return len(dAtA) - i, nil
   842  }
   843  
   844  func (m *Snapshot) Marshal() (dAtA []byte, err error) {
   845  	size := m.Size()
   846  	dAtA = make([]byte, size)
   847  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   848  	if err != nil {
   849  		return nil, err
   850  	}
   851  	return dAtA[:n], nil
   852  }
   853  
   854  func (m *Snapshot) MarshalTo(dAtA []byte) (int, error) {
   855  	size := m.Size()
   856  	return m.MarshalToSizedBuffer(dAtA[:size])
   857  }
   858  
   859  func (m *Snapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   860  	i := len(dAtA)
   861  	_ = i
   862  	var l int
   863  	_ = l
   864  	{
   865  		size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i])
   866  		if err != nil {
   867  			return 0, err
   868  		}
   869  		i -= size
   870  		i = encodeVarintRaft(dAtA, i, uint64(size))
   871  	}
   872  	i--
   873  	dAtA[i] = 0x12
   874  	if m.Data != nil {
   875  		i -= len(m.Data)
   876  		copy(dAtA[i:], m.Data)
   877  		i = encodeVarintRaft(dAtA, i, uint64(len(m.Data)))
   878  		i--
   879  		dAtA[i] = 0xa
   880  	}
   881  	return len(dAtA) - i, nil
   882  }
   883  
   884  func (m *Message) Marshal() (dAtA []byte, err error) {
   885  	size := m.Size()
   886  	dAtA = make([]byte, size)
   887  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   888  	if err != nil {
   889  		return nil, err
   890  	}
   891  	return dAtA[:n], nil
   892  }
   893  
   894  func (m *Message) MarshalTo(dAtA []byte) (int, error) {
   895  	size := m.Size()
   896  	return m.MarshalToSizedBuffer(dAtA[:size])
   897  }
   898  
   899  func (m *Message) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   900  	i := len(dAtA)
   901  	_ = i
   902  	var l int
   903  	_ = l
   904  	if m.Context != nil {
   905  		i -= len(m.Context)
   906  		copy(dAtA[i:], m.Context)
   907  		i = encodeVarintRaft(dAtA, i, uint64(len(m.Context)))
   908  		i--
   909  		dAtA[i] = 0x62
   910  	}
   911  	i = encodeVarintRaft(dAtA, i, uint64(m.RejectHint))
   912  	i--
   913  	dAtA[i] = 0x58
   914  	i--
   915  	if m.Reject {
   916  		dAtA[i] = 1
   917  	} else {
   918  		dAtA[i] = 0
   919  	}
   920  	i--
   921  	dAtA[i] = 0x50
   922  	{
   923  		size, err := m.Snapshot.MarshalToSizedBuffer(dAtA[:i])
   924  		if err != nil {
   925  			return 0, err
   926  		}
   927  		i -= size
   928  		i = encodeVarintRaft(dAtA, i, uint64(size))
   929  	}
   930  	i--
   931  	dAtA[i] = 0x4a
   932  	i = encodeVarintRaft(dAtA, i, uint64(m.Commit))
   933  	i--
   934  	dAtA[i] = 0x40
   935  	if len(m.Entries) > 0 {
   936  		for iNdEx := len(m.Entries) - 1; iNdEx >= 0; iNdEx-- {
   937  			{
   938  				size, err := m.Entries[iNdEx].MarshalToSizedBuffer(dAtA[:i])
   939  				if err != nil {
   940  					return 0, err
   941  				}
   942  				i -= size
   943  				i = encodeVarintRaft(dAtA, i, uint64(size))
   944  			}
   945  			i--
   946  			dAtA[i] = 0x3a
   947  		}
   948  	}
   949  	i = encodeVarintRaft(dAtA, i, uint64(m.Index))
   950  	i--
   951  	dAtA[i] = 0x30
   952  	i = encodeVarintRaft(dAtA, i, uint64(m.LogTerm))
   953  	i--
   954  	dAtA[i] = 0x28
   955  	i = encodeVarintRaft(dAtA, i, uint64(m.Term))
   956  	i--
   957  	dAtA[i] = 0x20
   958  	i = encodeVarintRaft(dAtA, i, uint64(m.From))
   959  	i--
   960  	dAtA[i] = 0x18
   961  	i = encodeVarintRaft(dAtA, i, uint64(m.To))
   962  	i--
   963  	dAtA[i] = 0x10
   964  	i = encodeVarintRaft(dAtA, i, uint64(m.Type))
   965  	i--
   966  	dAtA[i] = 0x8
   967  	return len(dAtA) - i, nil
   968  }
   969  
   970  func (m *HardState) Marshal() (dAtA []byte, err error) {
   971  	size := m.Size()
   972  	dAtA = make([]byte, size)
   973  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   974  	if err != nil {
   975  		return nil, err
   976  	}
   977  	return dAtA[:n], nil
   978  }
   979  
   980  func (m *HardState) MarshalTo(dAtA []byte) (int, error) {
   981  	size := m.Size()
   982  	return m.MarshalToSizedBuffer(dAtA[:size])
   983  }
   984  
   985  func (m *HardState) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   986  	i := len(dAtA)
   987  	_ = i
   988  	var l int
   989  	_ = l
   990  	i = encodeVarintRaft(dAtA, i, uint64(m.Commit))
   991  	i--
   992  	dAtA[i] = 0x18
   993  	i = encodeVarintRaft(dAtA, i, uint64(m.Vote))
   994  	i--
   995  	dAtA[i] = 0x10
   996  	i = encodeVarintRaft(dAtA, i, uint64(m.Term))
   997  	i--
   998  	dAtA[i] = 0x8
   999  	return len(dAtA) - i, nil
  1000  }
  1001  
  1002  func (m *ConfState) Marshal() (dAtA []byte, err error) {
  1003  	size := m.Size()
  1004  	dAtA = make([]byte, size)
  1005  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
  1006  	if err != nil {
  1007  		return nil, err
  1008  	}
  1009  	return dAtA[:n], nil
  1010  }
  1011  
  1012  func (m *ConfState) MarshalTo(dAtA []byte) (int, error) {
  1013  	size := m.Size()
  1014  	return m.MarshalToSizedBuffer(dAtA[:size])
  1015  }
  1016  
  1017  func (m *ConfState) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  1018  	i := len(dAtA)
  1019  	_ = i
  1020  	var l int
  1021  	_ = l
  1022  	i--
  1023  	if m.AutoLeave {
  1024  		dAtA[i] = 1
  1025  	} else {
  1026  		dAtA[i] = 0
  1027  	}
  1028  	i--
  1029  	dAtA[i] = 0x28
  1030  	if len(m.LearnersNext) > 0 {
  1031  		for iNdEx := len(m.LearnersNext) - 1; iNdEx >= 0; iNdEx-- {
  1032  			i = encodeVarintRaft(dAtA, i, uint64(m.LearnersNext[iNdEx]))
  1033  			i--
  1034  			dAtA[i] = 0x20
  1035  		}
  1036  	}
  1037  	if len(m.VotersOutgoing) > 0 {
  1038  		for iNdEx := len(m.VotersOutgoing) - 1; iNdEx >= 0; iNdEx-- {
  1039  			i = encodeVarintRaft(dAtA, i, uint64(m.VotersOutgoing[iNdEx]))
  1040  			i--
  1041  			dAtA[i] = 0x18
  1042  		}
  1043  	}
  1044  	if len(m.Learners) > 0 {
  1045  		for iNdEx := len(m.Learners) - 1; iNdEx >= 0; iNdEx-- {
  1046  			i = encodeVarintRaft(dAtA, i, uint64(m.Learners[iNdEx]))
  1047  			i--
  1048  			dAtA[i] = 0x10
  1049  		}
  1050  	}
  1051  	if len(m.Voters) > 0 {
  1052  		for iNdEx := len(m.Voters) - 1; iNdEx >= 0; iNdEx-- {
  1053  			i = encodeVarintRaft(dAtA, i, uint64(m.Voters[iNdEx]))
  1054  			i--
  1055  			dAtA[i] = 0x8
  1056  		}
  1057  	}
  1058  	return len(dAtA) - i, nil
  1059  }
  1060  
  1061  func (m *ConfChange) Marshal() (dAtA []byte, err error) {
  1062  	size := m.Size()
  1063  	dAtA = make([]byte, size)
  1064  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
  1065  	if err != nil {
  1066  		return nil, err
  1067  	}
  1068  	return dAtA[:n], nil
  1069  }
  1070  
  1071  func (m *ConfChange) MarshalTo(dAtA []byte) (int, error) {
  1072  	size := m.Size()
  1073  	return m.MarshalToSizedBuffer(dAtA[:size])
  1074  }
  1075  
  1076  func (m *ConfChange) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  1077  	i := len(dAtA)
  1078  	_ = i
  1079  	var l int
  1080  	_ = l
  1081  	if m.Context != nil {
  1082  		i -= len(m.Context)
  1083  		copy(dAtA[i:], m.Context)
  1084  		i = encodeVarintRaft(dAtA, i, uint64(len(m.Context)))
  1085  		i--
  1086  		dAtA[i] = 0x22
  1087  	}
  1088  	i = encodeVarintRaft(dAtA, i, uint64(m.NodeID))
  1089  	i--
  1090  	dAtA[i] = 0x18
  1091  	i = encodeVarintRaft(dAtA, i, uint64(m.Type))
  1092  	i--
  1093  	dAtA[i] = 0x10
  1094  	i = encodeVarintRaft(dAtA, i, uint64(m.ID))
  1095  	i--
  1096  	dAtA[i] = 0x8
  1097  	return len(dAtA) - i, nil
  1098  }
  1099  
  1100  func (m *ConfChangeSingle) Marshal() (dAtA []byte, err error) {
  1101  	size := m.Size()
  1102  	dAtA = make([]byte, size)
  1103  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
  1104  	if err != nil {
  1105  		return nil, err
  1106  	}
  1107  	return dAtA[:n], nil
  1108  }
  1109  
  1110  func (m *ConfChangeSingle) MarshalTo(dAtA []byte) (int, error) {
  1111  	size := m.Size()
  1112  	return m.MarshalToSizedBuffer(dAtA[:size])
  1113  }
  1114  
  1115  func (m *ConfChangeSingle) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  1116  	i := len(dAtA)
  1117  	_ = i
  1118  	var l int
  1119  	_ = l
  1120  	i = encodeVarintRaft(dAtA, i, uint64(m.NodeID))
  1121  	i--
  1122  	dAtA[i] = 0x10
  1123  	i = encodeVarintRaft(dAtA, i, uint64(m.Type))
  1124  	i--
  1125  	dAtA[i] = 0x8
  1126  	return len(dAtA) - i, nil
  1127  }
  1128  
  1129  func (m *ConfChangeV2) Marshal() (dAtA []byte, err error) {
  1130  	size := m.Size()
  1131  	dAtA = make([]byte, size)
  1132  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
  1133  	if err != nil {
  1134  		return nil, err
  1135  	}
  1136  	return dAtA[:n], nil
  1137  }
  1138  
  1139  func (m *ConfChangeV2) MarshalTo(dAtA []byte) (int, error) {
  1140  	size := m.Size()
  1141  	return m.MarshalToSizedBuffer(dAtA[:size])
  1142  }
  1143  
  1144  func (m *ConfChangeV2) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  1145  	i := len(dAtA)
  1146  	_ = i
  1147  	var l int
  1148  	_ = l
  1149  	if m.Context != nil {
  1150  		i -= len(m.Context)
  1151  		copy(dAtA[i:], m.Context)
  1152  		i = encodeVarintRaft(dAtA, i, uint64(len(m.Context)))
  1153  		i--
  1154  		dAtA[i] = 0x1a
  1155  	}
  1156  	if len(m.Changes) > 0 {
  1157  		for iNdEx := len(m.Changes) - 1; iNdEx >= 0; iNdEx-- {
  1158  			{
  1159  				size, err := m.Changes[iNdEx].MarshalToSizedBuffer(dAtA[:i])
  1160  				if err != nil {
  1161  					return 0, err
  1162  				}
  1163  				i -= size
  1164  				i = encodeVarintRaft(dAtA, i, uint64(size))
  1165  			}
  1166  			i--
  1167  			dAtA[i] = 0x12
  1168  		}
  1169  	}
  1170  	i = encodeVarintRaft(dAtA, i, uint64(m.Transition))
  1171  	i--
  1172  	dAtA[i] = 0x8
  1173  	return len(dAtA) - i, nil
  1174  }
  1175  
  1176  func encodeVarintRaft(dAtA []byte, offset int, v uint64) int {
  1177  	offset -= sovRaft(v)
  1178  	base := offset
  1179  	for v >= 1<<7 {
  1180  		dAtA[offset] = uint8(v&0x7f | 0x80)
  1181  		v >>= 7
  1182  		offset++
  1183  	}
  1184  	dAtA[offset] = uint8(v)
  1185  	return base
  1186  }
  1187  func (m *Entry) Size() (n int) {
  1188  	if m == nil {
  1189  		return 0
  1190  	}
  1191  	var l int
  1192  	_ = l
  1193  	n += 1 + sovRaft(uint64(m.Type))
  1194  	n += 1 + sovRaft(uint64(m.Term))
  1195  	n += 1 + sovRaft(uint64(m.Index))
  1196  	if m.Data != nil {
  1197  		l = len(m.Data)
  1198  		n += 1 + l + sovRaft(uint64(l))
  1199  	}
  1200  	return n
  1201  }
  1202  
  1203  func (m *SnapshotMetadata) Size() (n int) {
  1204  	if m == nil {
  1205  		return 0
  1206  	}
  1207  	var l int
  1208  	_ = l
  1209  	l = m.ConfState.Size()
  1210  	n += 1 + l + sovRaft(uint64(l))
  1211  	n += 1 + sovRaft(uint64(m.Index))
  1212  	n += 1 + sovRaft(uint64(m.Term))
  1213  	return n
  1214  }
  1215  
  1216  func (m *Snapshot) Size() (n int) {
  1217  	if m == nil {
  1218  		return 0
  1219  	}
  1220  	var l int
  1221  	_ = l
  1222  	if m.Data != nil {
  1223  		l = len(m.Data)
  1224  		n += 1 + l + sovRaft(uint64(l))
  1225  	}
  1226  	l = m.Metadata.Size()
  1227  	n += 1 + l + sovRaft(uint64(l))
  1228  	return n
  1229  }
  1230  
  1231  func (m *Message) Size() (n int) {
  1232  	if m == nil {
  1233  		return 0
  1234  	}
  1235  	var l int
  1236  	_ = l
  1237  	n += 1 + sovRaft(uint64(m.Type))
  1238  	n += 1 + sovRaft(uint64(m.To))
  1239  	n += 1 + sovRaft(uint64(m.From))
  1240  	n += 1 + sovRaft(uint64(m.Term))
  1241  	n += 1 + sovRaft(uint64(m.LogTerm))
  1242  	n += 1 + sovRaft(uint64(m.Index))
  1243  	if len(m.Entries) > 0 {
  1244  		for _, e := range m.Entries {
  1245  			l = e.Size()
  1246  			n += 1 + l + sovRaft(uint64(l))
  1247  		}
  1248  	}
  1249  	n += 1 + sovRaft(uint64(m.Commit))
  1250  	l = m.Snapshot.Size()
  1251  	n += 1 + l + sovRaft(uint64(l))
  1252  	n += 2
  1253  	n += 1 + sovRaft(uint64(m.RejectHint))
  1254  	if m.Context != nil {
  1255  		l = len(m.Context)
  1256  		n += 1 + l + sovRaft(uint64(l))
  1257  	}
  1258  	return n
  1259  }
  1260  
  1261  func (m *HardState) Size() (n int) {
  1262  	if m == nil {
  1263  		return 0
  1264  	}
  1265  	var l int
  1266  	_ = l
  1267  	n += 1 + sovRaft(uint64(m.Term))
  1268  	n += 1 + sovRaft(uint64(m.Vote))
  1269  	n += 1 + sovRaft(uint64(m.Commit))
  1270  	return n
  1271  }
  1272  
  1273  func (m *ConfState) Size() (n int) {
  1274  	if m == nil {
  1275  		return 0
  1276  	}
  1277  	var l int
  1278  	_ = l
  1279  	if len(m.Voters) > 0 {
  1280  		for _, e := range m.Voters {
  1281  			n += 1 + sovRaft(uint64(e))
  1282  		}
  1283  	}
  1284  	if len(m.Learners) > 0 {
  1285  		for _, e := range m.Learners {
  1286  			n += 1 + sovRaft(uint64(e))
  1287  		}
  1288  	}
  1289  	if len(m.VotersOutgoing) > 0 {
  1290  		for _, e := range m.VotersOutgoing {
  1291  			n += 1 + sovRaft(uint64(e))
  1292  		}
  1293  	}
  1294  	if len(m.LearnersNext) > 0 {
  1295  		for _, e := range m.LearnersNext {
  1296  			n += 1 + sovRaft(uint64(e))
  1297  		}
  1298  	}
  1299  	n += 2
  1300  	return n
  1301  }
  1302  
  1303  func (m *ConfChange) Size() (n int) {
  1304  	if m == nil {
  1305  		return 0
  1306  	}
  1307  	var l int
  1308  	_ = l
  1309  	n += 1 + sovRaft(uint64(m.ID))
  1310  	n += 1 + sovRaft(uint64(m.Type))
  1311  	n += 1 + sovRaft(uint64(m.NodeID))
  1312  	if m.Context != nil {
  1313  		l = len(m.Context)
  1314  		n += 1 + l + sovRaft(uint64(l))
  1315  	}
  1316  	return n
  1317  }
  1318  
  1319  func (m *ConfChangeSingle) Size() (n int) {
  1320  	if m == nil {
  1321  		return 0
  1322  	}
  1323  	var l int
  1324  	_ = l
  1325  	n += 1 + sovRaft(uint64(m.Type))
  1326  	n += 1 + sovRaft(uint64(m.NodeID))
  1327  	return n
  1328  }
  1329  
  1330  func (m *ConfChangeV2) Size() (n int) {
  1331  	if m == nil {
  1332  		return 0
  1333  	}
  1334  	var l int
  1335  	_ = l
  1336  	n += 1 + sovRaft(uint64(m.Transition))
  1337  	if len(m.Changes) > 0 {
  1338  		for _, e := range m.Changes {
  1339  			l = e.Size()
  1340  			n += 1 + l + sovRaft(uint64(l))
  1341  		}
  1342  	}
  1343  	if m.Context != nil {
  1344  		l = len(m.Context)
  1345  		n += 1 + l + sovRaft(uint64(l))
  1346  	}
  1347  	return n
  1348  }
  1349  
  1350  func sovRaft(x uint64) (n int) {
  1351  	return (math_bits.Len64(x|1) + 6) / 7
  1352  }
  1353  func sozRaft(x uint64) (n int) {
  1354  	return sovRaft(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  1355  }
  1356  func (m *Entry) Unmarshal(dAtA []byte) error {
  1357  	l := len(dAtA)
  1358  	iNdEx := 0
  1359  	for iNdEx < l {
  1360  		preIndex := iNdEx
  1361  		var wire uint64
  1362  		for shift := uint(0); ; shift += 7 {
  1363  			if shift >= 64 {
  1364  				return ErrIntOverflowRaft
  1365  			}
  1366  			if iNdEx >= l {
  1367  				return io.ErrUnexpectedEOF
  1368  			}
  1369  			b := dAtA[iNdEx]
  1370  			iNdEx++
  1371  			wire |= uint64(b&0x7F) << shift
  1372  			if b < 0x80 {
  1373  				break
  1374  			}
  1375  		}
  1376  		fieldNum := int32(wire >> 3)
  1377  		wireType := int(wire & 0x7)
  1378  		if wireType == 4 {
  1379  			return fmt.Errorf("proto: Entry: wiretype end group for non-group")
  1380  		}
  1381  		if fieldNum <= 0 {
  1382  			return fmt.Errorf("proto: Entry: illegal tag %d (wire type %d)", fieldNum, wire)
  1383  		}
  1384  		switch fieldNum {
  1385  		case 1:
  1386  			if wireType != 0 {
  1387  				return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
  1388  			}
  1389  			m.Type = 0
  1390  			for shift := uint(0); ; shift += 7 {
  1391  				if shift >= 64 {
  1392  					return ErrIntOverflowRaft
  1393  				}
  1394  				if iNdEx >= l {
  1395  					return io.ErrUnexpectedEOF
  1396  				}
  1397  				b := dAtA[iNdEx]
  1398  				iNdEx++
  1399  				m.Type |= EntryType(b&0x7F) << shift
  1400  				if b < 0x80 {
  1401  					break
  1402  				}
  1403  			}
  1404  		case 2:
  1405  			if wireType != 0 {
  1406  				return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType)
  1407  			}
  1408  			m.Term = 0
  1409  			for shift := uint(0); ; shift += 7 {
  1410  				if shift >= 64 {
  1411  					return ErrIntOverflowRaft
  1412  				}
  1413  				if iNdEx >= l {
  1414  					return io.ErrUnexpectedEOF
  1415  				}
  1416  				b := dAtA[iNdEx]
  1417  				iNdEx++
  1418  				m.Term |= uint64(b&0x7F) << shift
  1419  				if b < 0x80 {
  1420  					break
  1421  				}
  1422  			}
  1423  		case 3:
  1424  			if wireType != 0 {
  1425  				return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType)
  1426  			}
  1427  			m.Index = 0
  1428  			for shift := uint(0); ; shift += 7 {
  1429  				if shift >= 64 {
  1430  					return ErrIntOverflowRaft
  1431  				}
  1432  				if iNdEx >= l {
  1433  					return io.ErrUnexpectedEOF
  1434  				}
  1435  				b := dAtA[iNdEx]
  1436  				iNdEx++
  1437  				m.Index |= uint64(b&0x7F) << shift
  1438  				if b < 0x80 {
  1439  					break
  1440  				}
  1441  			}
  1442  		case 4:
  1443  			if wireType != 2 {
  1444  				return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType)
  1445  			}
  1446  			var byteLen int
  1447  			for shift := uint(0); ; shift += 7 {
  1448  				if shift >= 64 {
  1449  					return ErrIntOverflowRaft
  1450  				}
  1451  				if iNdEx >= l {
  1452  					return io.ErrUnexpectedEOF
  1453  				}
  1454  				b := dAtA[iNdEx]
  1455  				iNdEx++
  1456  				byteLen |= int(b&0x7F) << shift
  1457  				if b < 0x80 {
  1458  					break
  1459  				}
  1460  			}
  1461  			if byteLen < 0 {
  1462  				return ErrInvalidLengthRaft
  1463  			}
  1464  			postIndex := iNdEx + byteLen
  1465  			if postIndex < 0 {
  1466  				return ErrInvalidLengthRaft
  1467  			}
  1468  			if postIndex > l {
  1469  				return io.ErrUnexpectedEOF
  1470  			}
  1471  			m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...)
  1472  			if m.Data == nil {
  1473  				m.Data = []byte{}
  1474  			}
  1475  			iNdEx = postIndex
  1476  		default:
  1477  			iNdEx = preIndex
  1478  			skippy, err := skipRaft(dAtA[iNdEx:])
  1479  			if err != nil {
  1480  				return err
  1481  			}
  1482  			if (skippy < 0) || (iNdEx+skippy) < 0 {
  1483  				return ErrInvalidLengthRaft
  1484  			}
  1485  			if (iNdEx + skippy) > l {
  1486  				return io.ErrUnexpectedEOF
  1487  			}
  1488  			iNdEx += skippy
  1489  		}
  1490  	}
  1491  
  1492  	if iNdEx > l {
  1493  		return io.ErrUnexpectedEOF
  1494  	}
  1495  	return nil
  1496  }
  1497  func (m *SnapshotMetadata) Unmarshal(dAtA []byte) error {
  1498  	l := len(dAtA)
  1499  	iNdEx := 0
  1500  	for iNdEx < l {
  1501  		preIndex := iNdEx
  1502  		var wire uint64
  1503  		for shift := uint(0); ; shift += 7 {
  1504  			if shift >= 64 {
  1505  				return ErrIntOverflowRaft
  1506  			}
  1507  			if iNdEx >= l {
  1508  				return io.ErrUnexpectedEOF
  1509  			}
  1510  			b := dAtA[iNdEx]
  1511  			iNdEx++
  1512  			wire |= uint64(b&0x7F) << shift
  1513  			if b < 0x80 {
  1514  				break
  1515  			}
  1516  		}
  1517  		fieldNum := int32(wire >> 3)
  1518  		wireType := int(wire & 0x7)
  1519  		if wireType == 4 {
  1520  			return fmt.Errorf("proto: SnapshotMetadata: wiretype end group for non-group")
  1521  		}
  1522  		if fieldNum <= 0 {
  1523  			return fmt.Errorf("proto: SnapshotMetadata: illegal tag %d (wire type %d)", fieldNum, wire)
  1524  		}
  1525  		switch fieldNum {
  1526  		case 1:
  1527  			if wireType != 2 {
  1528  				return fmt.Errorf("proto: wrong wireType = %d for field ConfState", wireType)
  1529  			}
  1530  			var msglen int
  1531  			for shift := uint(0); ; shift += 7 {
  1532  				if shift >= 64 {
  1533  					return ErrIntOverflowRaft
  1534  				}
  1535  				if iNdEx >= l {
  1536  					return io.ErrUnexpectedEOF
  1537  				}
  1538  				b := dAtA[iNdEx]
  1539  				iNdEx++
  1540  				msglen |= int(b&0x7F) << shift
  1541  				if b < 0x80 {
  1542  					break
  1543  				}
  1544  			}
  1545  			if msglen < 0 {
  1546  				return ErrInvalidLengthRaft
  1547  			}
  1548  			postIndex := iNdEx + msglen
  1549  			if postIndex < 0 {
  1550  				return ErrInvalidLengthRaft
  1551  			}
  1552  			if postIndex > l {
  1553  				return io.ErrUnexpectedEOF
  1554  			}
  1555  			if err := m.ConfState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1556  				return err
  1557  			}
  1558  			iNdEx = postIndex
  1559  		case 2:
  1560  			if wireType != 0 {
  1561  				return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType)
  1562  			}
  1563  			m.Index = 0
  1564  			for shift := uint(0); ; shift += 7 {
  1565  				if shift >= 64 {
  1566  					return ErrIntOverflowRaft
  1567  				}
  1568  				if iNdEx >= l {
  1569  					return io.ErrUnexpectedEOF
  1570  				}
  1571  				b := dAtA[iNdEx]
  1572  				iNdEx++
  1573  				m.Index |= uint64(b&0x7F) << shift
  1574  				if b < 0x80 {
  1575  					break
  1576  				}
  1577  			}
  1578  		case 3:
  1579  			if wireType != 0 {
  1580  				return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType)
  1581  			}
  1582  			m.Term = 0
  1583  			for shift := uint(0); ; shift += 7 {
  1584  				if shift >= 64 {
  1585  					return ErrIntOverflowRaft
  1586  				}
  1587  				if iNdEx >= l {
  1588  					return io.ErrUnexpectedEOF
  1589  				}
  1590  				b := dAtA[iNdEx]
  1591  				iNdEx++
  1592  				m.Term |= uint64(b&0x7F) << shift
  1593  				if b < 0x80 {
  1594  					break
  1595  				}
  1596  			}
  1597  		default:
  1598  			iNdEx = preIndex
  1599  			skippy, err := skipRaft(dAtA[iNdEx:])
  1600  			if err != nil {
  1601  				return err
  1602  			}
  1603  			if (skippy < 0) || (iNdEx+skippy) < 0 {
  1604  				return ErrInvalidLengthRaft
  1605  			}
  1606  			if (iNdEx + skippy) > l {
  1607  				return io.ErrUnexpectedEOF
  1608  			}
  1609  			iNdEx += skippy
  1610  		}
  1611  	}
  1612  
  1613  	if iNdEx > l {
  1614  		return io.ErrUnexpectedEOF
  1615  	}
  1616  	return nil
  1617  }
  1618  func (m *Snapshot) Unmarshal(dAtA []byte) error {
  1619  	l := len(dAtA)
  1620  	iNdEx := 0
  1621  	for iNdEx < l {
  1622  		preIndex := iNdEx
  1623  		var wire uint64
  1624  		for shift := uint(0); ; shift += 7 {
  1625  			if shift >= 64 {
  1626  				return ErrIntOverflowRaft
  1627  			}
  1628  			if iNdEx >= l {
  1629  				return io.ErrUnexpectedEOF
  1630  			}
  1631  			b := dAtA[iNdEx]
  1632  			iNdEx++
  1633  			wire |= uint64(b&0x7F) << shift
  1634  			if b < 0x80 {
  1635  				break
  1636  			}
  1637  		}
  1638  		fieldNum := int32(wire >> 3)
  1639  		wireType := int(wire & 0x7)
  1640  		if wireType == 4 {
  1641  			return fmt.Errorf("proto: Snapshot: wiretype end group for non-group")
  1642  		}
  1643  		if fieldNum <= 0 {
  1644  			return fmt.Errorf("proto: Snapshot: illegal tag %d (wire type %d)", fieldNum, wire)
  1645  		}
  1646  		switch fieldNum {
  1647  		case 1:
  1648  			if wireType != 2 {
  1649  				return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType)
  1650  			}
  1651  			var byteLen int
  1652  			for shift := uint(0); ; shift += 7 {
  1653  				if shift >= 64 {
  1654  					return ErrIntOverflowRaft
  1655  				}
  1656  				if iNdEx >= l {
  1657  					return io.ErrUnexpectedEOF
  1658  				}
  1659  				b := dAtA[iNdEx]
  1660  				iNdEx++
  1661  				byteLen |= int(b&0x7F) << shift
  1662  				if b < 0x80 {
  1663  					break
  1664  				}
  1665  			}
  1666  			if byteLen < 0 {
  1667  				return ErrInvalidLengthRaft
  1668  			}
  1669  			postIndex := iNdEx + byteLen
  1670  			if postIndex < 0 {
  1671  				return ErrInvalidLengthRaft
  1672  			}
  1673  			if postIndex > l {
  1674  				return io.ErrUnexpectedEOF
  1675  			}
  1676  			m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...)
  1677  			if m.Data == nil {
  1678  				m.Data = []byte{}
  1679  			}
  1680  			iNdEx = postIndex
  1681  		case 2:
  1682  			if wireType != 2 {
  1683  				return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType)
  1684  			}
  1685  			var msglen int
  1686  			for shift := uint(0); ; shift += 7 {
  1687  				if shift >= 64 {
  1688  					return ErrIntOverflowRaft
  1689  				}
  1690  				if iNdEx >= l {
  1691  					return io.ErrUnexpectedEOF
  1692  				}
  1693  				b := dAtA[iNdEx]
  1694  				iNdEx++
  1695  				msglen |= int(b&0x7F) << shift
  1696  				if b < 0x80 {
  1697  					break
  1698  				}
  1699  			}
  1700  			if msglen < 0 {
  1701  				return ErrInvalidLengthRaft
  1702  			}
  1703  			postIndex := iNdEx + msglen
  1704  			if postIndex < 0 {
  1705  				return ErrInvalidLengthRaft
  1706  			}
  1707  			if postIndex > l {
  1708  				return io.ErrUnexpectedEOF
  1709  			}
  1710  			if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1711  				return err
  1712  			}
  1713  			iNdEx = postIndex
  1714  		default:
  1715  			iNdEx = preIndex
  1716  			skippy, err := skipRaft(dAtA[iNdEx:])
  1717  			if err != nil {
  1718  				return err
  1719  			}
  1720  			if (skippy < 0) || (iNdEx+skippy) < 0 {
  1721  				return ErrInvalidLengthRaft
  1722  			}
  1723  			if (iNdEx + skippy) > l {
  1724  				return io.ErrUnexpectedEOF
  1725  			}
  1726  			iNdEx += skippy
  1727  		}
  1728  	}
  1729  
  1730  	if iNdEx > l {
  1731  		return io.ErrUnexpectedEOF
  1732  	}
  1733  	return nil
  1734  }
  1735  func (m *Message) Unmarshal(dAtA []byte) error {
  1736  	l := len(dAtA)
  1737  	iNdEx := 0
  1738  	for iNdEx < l {
  1739  		preIndex := iNdEx
  1740  		var wire uint64
  1741  		for shift := uint(0); ; shift += 7 {
  1742  			if shift >= 64 {
  1743  				return ErrIntOverflowRaft
  1744  			}
  1745  			if iNdEx >= l {
  1746  				return io.ErrUnexpectedEOF
  1747  			}
  1748  			b := dAtA[iNdEx]
  1749  			iNdEx++
  1750  			wire |= uint64(b&0x7F) << shift
  1751  			if b < 0x80 {
  1752  				break
  1753  			}
  1754  		}
  1755  		fieldNum := int32(wire >> 3)
  1756  		wireType := int(wire & 0x7)
  1757  		if wireType == 4 {
  1758  			return fmt.Errorf("proto: Message: wiretype end group for non-group")
  1759  		}
  1760  		if fieldNum <= 0 {
  1761  			return fmt.Errorf("proto: Message: illegal tag %d (wire type %d)", fieldNum, wire)
  1762  		}
  1763  		switch fieldNum {
  1764  		case 1:
  1765  			if wireType != 0 {
  1766  				return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
  1767  			}
  1768  			m.Type = 0
  1769  			for shift := uint(0); ; shift += 7 {
  1770  				if shift >= 64 {
  1771  					return ErrIntOverflowRaft
  1772  				}
  1773  				if iNdEx >= l {
  1774  					return io.ErrUnexpectedEOF
  1775  				}
  1776  				b := dAtA[iNdEx]
  1777  				iNdEx++
  1778  				m.Type |= MessageType(b&0x7F) << shift
  1779  				if b < 0x80 {
  1780  					break
  1781  				}
  1782  			}
  1783  		case 2:
  1784  			if wireType != 0 {
  1785  				return fmt.Errorf("proto: wrong wireType = %d for field To", wireType)
  1786  			}
  1787  			m.To = 0
  1788  			for shift := uint(0); ; shift += 7 {
  1789  				if shift >= 64 {
  1790  					return ErrIntOverflowRaft
  1791  				}
  1792  				if iNdEx >= l {
  1793  					return io.ErrUnexpectedEOF
  1794  				}
  1795  				b := dAtA[iNdEx]
  1796  				iNdEx++
  1797  				m.To |= uint64(b&0x7F) << shift
  1798  				if b < 0x80 {
  1799  					break
  1800  				}
  1801  			}
  1802  		case 3:
  1803  			if wireType != 0 {
  1804  				return fmt.Errorf("proto: wrong wireType = %d for field From", wireType)
  1805  			}
  1806  			m.From = 0
  1807  			for shift := uint(0); ; shift += 7 {
  1808  				if shift >= 64 {
  1809  					return ErrIntOverflowRaft
  1810  				}
  1811  				if iNdEx >= l {
  1812  					return io.ErrUnexpectedEOF
  1813  				}
  1814  				b := dAtA[iNdEx]
  1815  				iNdEx++
  1816  				m.From |= uint64(b&0x7F) << shift
  1817  				if b < 0x80 {
  1818  					break
  1819  				}
  1820  			}
  1821  		case 4:
  1822  			if wireType != 0 {
  1823  				return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType)
  1824  			}
  1825  			m.Term = 0
  1826  			for shift := uint(0); ; shift += 7 {
  1827  				if shift >= 64 {
  1828  					return ErrIntOverflowRaft
  1829  				}
  1830  				if iNdEx >= l {
  1831  					return io.ErrUnexpectedEOF
  1832  				}
  1833  				b := dAtA[iNdEx]
  1834  				iNdEx++
  1835  				m.Term |= uint64(b&0x7F) << shift
  1836  				if b < 0x80 {
  1837  					break
  1838  				}
  1839  			}
  1840  		case 5:
  1841  			if wireType != 0 {
  1842  				return fmt.Errorf("proto: wrong wireType = %d for field LogTerm", wireType)
  1843  			}
  1844  			m.LogTerm = 0
  1845  			for shift := uint(0); ; shift += 7 {
  1846  				if shift >= 64 {
  1847  					return ErrIntOverflowRaft
  1848  				}
  1849  				if iNdEx >= l {
  1850  					return io.ErrUnexpectedEOF
  1851  				}
  1852  				b := dAtA[iNdEx]
  1853  				iNdEx++
  1854  				m.LogTerm |= uint64(b&0x7F) << shift
  1855  				if b < 0x80 {
  1856  					break
  1857  				}
  1858  			}
  1859  		case 6:
  1860  			if wireType != 0 {
  1861  				return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType)
  1862  			}
  1863  			m.Index = 0
  1864  			for shift := uint(0); ; shift += 7 {
  1865  				if shift >= 64 {
  1866  					return ErrIntOverflowRaft
  1867  				}
  1868  				if iNdEx >= l {
  1869  					return io.ErrUnexpectedEOF
  1870  				}
  1871  				b := dAtA[iNdEx]
  1872  				iNdEx++
  1873  				m.Index |= uint64(b&0x7F) << shift
  1874  				if b < 0x80 {
  1875  					break
  1876  				}
  1877  			}
  1878  		case 7:
  1879  			if wireType != 2 {
  1880  				return fmt.Errorf("proto: wrong wireType = %d for field Entries", wireType)
  1881  			}
  1882  			var msglen int
  1883  			for shift := uint(0); ; shift += 7 {
  1884  				if shift >= 64 {
  1885  					return ErrIntOverflowRaft
  1886  				}
  1887  				if iNdEx >= l {
  1888  					return io.ErrUnexpectedEOF
  1889  				}
  1890  				b := dAtA[iNdEx]
  1891  				iNdEx++
  1892  				msglen |= int(b&0x7F) << shift
  1893  				if b < 0x80 {
  1894  					break
  1895  				}
  1896  			}
  1897  			if msglen < 0 {
  1898  				return ErrInvalidLengthRaft
  1899  			}
  1900  			postIndex := iNdEx + msglen
  1901  			if postIndex < 0 {
  1902  				return ErrInvalidLengthRaft
  1903  			}
  1904  			if postIndex > l {
  1905  				return io.ErrUnexpectedEOF
  1906  			}
  1907  			m.Entries = append(m.Entries, Entry{})
  1908  			if err := m.Entries[len(m.Entries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1909  				return err
  1910  			}
  1911  			iNdEx = postIndex
  1912  		case 8:
  1913  			if wireType != 0 {
  1914  				return fmt.Errorf("proto: wrong wireType = %d for field Commit", wireType)
  1915  			}
  1916  			m.Commit = 0
  1917  			for shift := uint(0); ; shift += 7 {
  1918  				if shift >= 64 {
  1919  					return ErrIntOverflowRaft
  1920  				}
  1921  				if iNdEx >= l {
  1922  					return io.ErrUnexpectedEOF
  1923  				}
  1924  				b := dAtA[iNdEx]
  1925  				iNdEx++
  1926  				m.Commit |= uint64(b&0x7F) << shift
  1927  				if b < 0x80 {
  1928  					break
  1929  				}
  1930  			}
  1931  		case 9:
  1932  			if wireType != 2 {
  1933  				return fmt.Errorf("proto: wrong wireType = %d for field Snapshot", wireType)
  1934  			}
  1935  			var msglen int
  1936  			for shift := uint(0); ; shift += 7 {
  1937  				if shift >= 64 {
  1938  					return ErrIntOverflowRaft
  1939  				}
  1940  				if iNdEx >= l {
  1941  					return io.ErrUnexpectedEOF
  1942  				}
  1943  				b := dAtA[iNdEx]
  1944  				iNdEx++
  1945  				msglen |= int(b&0x7F) << shift
  1946  				if b < 0x80 {
  1947  					break
  1948  				}
  1949  			}
  1950  			if msglen < 0 {
  1951  				return ErrInvalidLengthRaft
  1952  			}
  1953  			postIndex := iNdEx + msglen
  1954  			if postIndex < 0 {
  1955  				return ErrInvalidLengthRaft
  1956  			}
  1957  			if postIndex > l {
  1958  				return io.ErrUnexpectedEOF
  1959  			}
  1960  			if err := m.Snapshot.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1961  				return err
  1962  			}
  1963  			iNdEx = postIndex
  1964  		case 10:
  1965  			if wireType != 0 {
  1966  				return fmt.Errorf("proto: wrong wireType = %d for field Reject", wireType)
  1967  			}
  1968  			var v int
  1969  			for shift := uint(0); ; shift += 7 {
  1970  				if shift >= 64 {
  1971  					return ErrIntOverflowRaft
  1972  				}
  1973  				if iNdEx >= l {
  1974  					return io.ErrUnexpectedEOF
  1975  				}
  1976  				b := dAtA[iNdEx]
  1977  				iNdEx++
  1978  				v |= int(b&0x7F) << shift
  1979  				if b < 0x80 {
  1980  					break
  1981  				}
  1982  			}
  1983  			m.Reject = bool(v != 0)
  1984  		case 11:
  1985  			if wireType != 0 {
  1986  				return fmt.Errorf("proto: wrong wireType = %d for field RejectHint", wireType)
  1987  			}
  1988  			m.RejectHint = 0
  1989  			for shift := uint(0); ; shift += 7 {
  1990  				if shift >= 64 {
  1991  					return ErrIntOverflowRaft
  1992  				}
  1993  				if iNdEx >= l {
  1994  					return io.ErrUnexpectedEOF
  1995  				}
  1996  				b := dAtA[iNdEx]
  1997  				iNdEx++
  1998  				m.RejectHint |= uint64(b&0x7F) << shift
  1999  				if b < 0x80 {
  2000  					break
  2001  				}
  2002  			}
  2003  		case 12:
  2004  			if wireType != 2 {
  2005  				return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType)
  2006  			}
  2007  			var byteLen int
  2008  			for shift := uint(0); ; shift += 7 {
  2009  				if shift >= 64 {
  2010  					return ErrIntOverflowRaft
  2011  				}
  2012  				if iNdEx >= l {
  2013  					return io.ErrUnexpectedEOF
  2014  				}
  2015  				b := dAtA[iNdEx]
  2016  				iNdEx++
  2017  				byteLen |= int(b&0x7F) << shift
  2018  				if b < 0x80 {
  2019  					break
  2020  				}
  2021  			}
  2022  			if byteLen < 0 {
  2023  				return ErrInvalidLengthRaft
  2024  			}
  2025  			postIndex := iNdEx + byteLen
  2026  			if postIndex < 0 {
  2027  				return ErrInvalidLengthRaft
  2028  			}
  2029  			if postIndex > l {
  2030  				return io.ErrUnexpectedEOF
  2031  			}
  2032  			m.Context = append(m.Context[:0], dAtA[iNdEx:postIndex]...)
  2033  			if m.Context == nil {
  2034  				m.Context = []byte{}
  2035  			}
  2036  			iNdEx = postIndex
  2037  		default:
  2038  			iNdEx = preIndex
  2039  			skippy, err := skipRaft(dAtA[iNdEx:])
  2040  			if err != nil {
  2041  				return err
  2042  			}
  2043  			if (skippy < 0) || (iNdEx+skippy) < 0 {
  2044  				return ErrInvalidLengthRaft
  2045  			}
  2046  			if (iNdEx + skippy) > l {
  2047  				return io.ErrUnexpectedEOF
  2048  			}
  2049  			iNdEx += skippy
  2050  		}
  2051  	}
  2052  
  2053  	if iNdEx > l {
  2054  		return io.ErrUnexpectedEOF
  2055  	}
  2056  	return nil
  2057  }
  2058  func (m *HardState) Unmarshal(dAtA []byte) error {
  2059  	l := len(dAtA)
  2060  	iNdEx := 0
  2061  	for iNdEx < l {
  2062  		preIndex := iNdEx
  2063  		var wire uint64
  2064  		for shift := uint(0); ; shift += 7 {
  2065  			if shift >= 64 {
  2066  				return ErrIntOverflowRaft
  2067  			}
  2068  			if iNdEx >= l {
  2069  				return io.ErrUnexpectedEOF
  2070  			}
  2071  			b := dAtA[iNdEx]
  2072  			iNdEx++
  2073  			wire |= uint64(b&0x7F) << shift
  2074  			if b < 0x80 {
  2075  				break
  2076  			}
  2077  		}
  2078  		fieldNum := int32(wire >> 3)
  2079  		wireType := int(wire & 0x7)
  2080  		if wireType == 4 {
  2081  			return fmt.Errorf("proto: HardState: wiretype end group for non-group")
  2082  		}
  2083  		if fieldNum <= 0 {
  2084  			return fmt.Errorf("proto: HardState: illegal tag %d (wire type %d)", fieldNum, wire)
  2085  		}
  2086  		switch fieldNum {
  2087  		case 1:
  2088  			if wireType != 0 {
  2089  				return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType)
  2090  			}
  2091  			m.Term = 0
  2092  			for shift := uint(0); ; shift += 7 {
  2093  				if shift >= 64 {
  2094  					return ErrIntOverflowRaft
  2095  				}
  2096  				if iNdEx >= l {
  2097  					return io.ErrUnexpectedEOF
  2098  				}
  2099  				b := dAtA[iNdEx]
  2100  				iNdEx++
  2101  				m.Term |= uint64(b&0x7F) << shift
  2102  				if b < 0x80 {
  2103  					break
  2104  				}
  2105  			}
  2106  		case 2:
  2107  			if wireType != 0 {
  2108  				return fmt.Errorf("proto: wrong wireType = %d for field Vote", wireType)
  2109  			}
  2110  			m.Vote = 0
  2111  			for shift := uint(0); ; shift += 7 {
  2112  				if shift >= 64 {
  2113  					return ErrIntOverflowRaft
  2114  				}
  2115  				if iNdEx >= l {
  2116  					return io.ErrUnexpectedEOF
  2117  				}
  2118  				b := dAtA[iNdEx]
  2119  				iNdEx++
  2120  				m.Vote |= uint64(b&0x7F) << shift
  2121  				if b < 0x80 {
  2122  					break
  2123  				}
  2124  			}
  2125  		case 3:
  2126  			if wireType != 0 {
  2127  				return fmt.Errorf("proto: wrong wireType = %d for field Commit", wireType)
  2128  			}
  2129  			m.Commit = 0
  2130  			for shift := uint(0); ; shift += 7 {
  2131  				if shift >= 64 {
  2132  					return ErrIntOverflowRaft
  2133  				}
  2134  				if iNdEx >= l {
  2135  					return io.ErrUnexpectedEOF
  2136  				}
  2137  				b := dAtA[iNdEx]
  2138  				iNdEx++
  2139  				m.Commit |= uint64(b&0x7F) << shift
  2140  				if b < 0x80 {
  2141  					break
  2142  				}
  2143  			}
  2144  		default:
  2145  			iNdEx = preIndex
  2146  			skippy, err := skipRaft(dAtA[iNdEx:])
  2147  			if err != nil {
  2148  				return err
  2149  			}
  2150  			if (skippy < 0) || (iNdEx+skippy) < 0 {
  2151  				return ErrInvalidLengthRaft
  2152  			}
  2153  			if (iNdEx + skippy) > l {
  2154  				return io.ErrUnexpectedEOF
  2155  			}
  2156  			iNdEx += skippy
  2157  		}
  2158  	}
  2159  
  2160  	if iNdEx > l {
  2161  		return io.ErrUnexpectedEOF
  2162  	}
  2163  	return nil
  2164  }
  2165  func (m *ConfState) Unmarshal(dAtA []byte) error {
  2166  	l := len(dAtA)
  2167  	iNdEx := 0
  2168  	for iNdEx < l {
  2169  		preIndex := iNdEx
  2170  		var wire uint64
  2171  		for shift := uint(0); ; shift += 7 {
  2172  			if shift >= 64 {
  2173  				return ErrIntOverflowRaft
  2174  			}
  2175  			if iNdEx >= l {
  2176  				return io.ErrUnexpectedEOF
  2177  			}
  2178  			b := dAtA[iNdEx]
  2179  			iNdEx++
  2180  			wire |= uint64(b&0x7F) << shift
  2181  			if b < 0x80 {
  2182  				break
  2183  			}
  2184  		}
  2185  		fieldNum := int32(wire >> 3)
  2186  		wireType := int(wire & 0x7)
  2187  		if wireType == 4 {
  2188  			return fmt.Errorf("proto: ConfState: wiretype end group for non-group")
  2189  		}
  2190  		if fieldNum <= 0 {
  2191  			return fmt.Errorf("proto: ConfState: illegal tag %d (wire type %d)", fieldNum, wire)
  2192  		}
  2193  		switch fieldNum {
  2194  		case 1:
  2195  			if wireType == 0 {
  2196  				var v uint64
  2197  				for shift := uint(0); ; shift += 7 {
  2198  					if shift >= 64 {
  2199  						return ErrIntOverflowRaft
  2200  					}
  2201  					if iNdEx >= l {
  2202  						return io.ErrUnexpectedEOF
  2203  					}
  2204  					b := dAtA[iNdEx]
  2205  					iNdEx++
  2206  					v |= uint64(b&0x7F) << shift
  2207  					if b < 0x80 {
  2208  						break
  2209  					}
  2210  				}
  2211  				m.Voters = append(m.Voters, v)
  2212  			} else if wireType == 2 {
  2213  				var packedLen int
  2214  				for shift := uint(0); ; shift += 7 {
  2215  					if shift >= 64 {
  2216  						return ErrIntOverflowRaft
  2217  					}
  2218  					if iNdEx >= l {
  2219  						return io.ErrUnexpectedEOF
  2220  					}
  2221  					b := dAtA[iNdEx]
  2222  					iNdEx++
  2223  					packedLen |= int(b&0x7F) << shift
  2224  					if b < 0x80 {
  2225  						break
  2226  					}
  2227  				}
  2228  				if packedLen < 0 {
  2229  					return ErrInvalidLengthRaft
  2230  				}
  2231  				postIndex := iNdEx + packedLen
  2232  				if postIndex < 0 {
  2233  					return ErrInvalidLengthRaft
  2234  				}
  2235  				if postIndex > l {
  2236  					return io.ErrUnexpectedEOF
  2237  				}
  2238  				var elementCount int
  2239  				var count int
  2240  				for _, integer := range dAtA[iNdEx:postIndex] {
  2241  					if integer < 128 {
  2242  						count++
  2243  					}
  2244  				}
  2245  				elementCount = count
  2246  				if elementCount != 0 && len(m.Voters) == 0 {
  2247  					m.Voters = make([]uint64, 0, elementCount)
  2248  				}
  2249  				for iNdEx < postIndex {
  2250  					var v uint64
  2251  					for shift := uint(0); ; shift += 7 {
  2252  						if shift >= 64 {
  2253  							return ErrIntOverflowRaft
  2254  						}
  2255  						if iNdEx >= l {
  2256  							return io.ErrUnexpectedEOF
  2257  						}
  2258  						b := dAtA[iNdEx]
  2259  						iNdEx++
  2260  						v |= uint64(b&0x7F) << shift
  2261  						if b < 0x80 {
  2262  							break
  2263  						}
  2264  					}
  2265  					m.Voters = append(m.Voters, v)
  2266  				}
  2267  			} else {
  2268  				return fmt.Errorf("proto: wrong wireType = %d for field Voters", wireType)
  2269  			}
  2270  		case 2:
  2271  			if wireType == 0 {
  2272  				var v uint64
  2273  				for shift := uint(0); ; shift += 7 {
  2274  					if shift >= 64 {
  2275  						return ErrIntOverflowRaft
  2276  					}
  2277  					if iNdEx >= l {
  2278  						return io.ErrUnexpectedEOF
  2279  					}
  2280  					b := dAtA[iNdEx]
  2281  					iNdEx++
  2282  					v |= uint64(b&0x7F) << shift
  2283  					if b < 0x80 {
  2284  						break
  2285  					}
  2286  				}
  2287  				m.Learners = append(m.Learners, v)
  2288  			} else if wireType == 2 {
  2289  				var packedLen int
  2290  				for shift := uint(0); ; shift += 7 {
  2291  					if shift >= 64 {
  2292  						return ErrIntOverflowRaft
  2293  					}
  2294  					if iNdEx >= l {
  2295  						return io.ErrUnexpectedEOF
  2296  					}
  2297  					b := dAtA[iNdEx]
  2298  					iNdEx++
  2299  					packedLen |= int(b&0x7F) << shift
  2300  					if b < 0x80 {
  2301  						break
  2302  					}
  2303  				}
  2304  				if packedLen < 0 {
  2305  					return ErrInvalidLengthRaft
  2306  				}
  2307  				postIndex := iNdEx + packedLen
  2308  				if postIndex < 0 {
  2309  					return ErrInvalidLengthRaft
  2310  				}
  2311  				if postIndex > l {
  2312  					return io.ErrUnexpectedEOF
  2313  				}
  2314  				var elementCount int
  2315  				var count int
  2316  				for _, integer := range dAtA[iNdEx:postIndex] {
  2317  					if integer < 128 {
  2318  						count++
  2319  					}
  2320  				}
  2321  				elementCount = count
  2322  				if elementCount != 0 && len(m.Learners) == 0 {
  2323  					m.Learners = make([]uint64, 0, elementCount)
  2324  				}
  2325  				for iNdEx < postIndex {
  2326  					var v uint64
  2327  					for shift := uint(0); ; shift += 7 {
  2328  						if shift >= 64 {
  2329  							return ErrIntOverflowRaft
  2330  						}
  2331  						if iNdEx >= l {
  2332  							return io.ErrUnexpectedEOF
  2333  						}
  2334  						b := dAtA[iNdEx]
  2335  						iNdEx++
  2336  						v |= uint64(b&0x7F) << shift
  2337  						if b < 0x80 {
  2338  							break
  2339  						}
  2340  					}
  2341  					m.Learners = append(m.Learners, v)
  2342  				}
  2343  			} else {
  2344  				return fmt.Errorf("proto: wrong wireType = %d for field Learners", wireType)
  2345  			}
  2346  		case 3:
  2347  			if wireType == 0 {
  2348  				var v uint64
  2349  				for shift := uint(0); ; shift += 7 {
  2350  					if shift >= 64 {
  2351  						return ErrIntOverflowRaft
  2352  					}
  2353  					if iNdEx >= l {
  2354  						return io.ErrUnexpectedEOF
  2355  					}
  2356  					b := dAtA[iNdEx]
  2357  					iNdEx++
  2358  					v |= uint64(b&0x7F) << shift
  2359  					if b < 0x80 {
  2360  						break
  2361  					}
  2362  				}
  2363  				m.VotersOutgoing = append(m.VotersOutgoing, v)
  2364  			} else if wireType == 2 {
  2365  				var packedLen int
  2366  				for shift := uint(0); ; shift += 7 {
  2367  					if shift >= 64 {
  2368  						return ErrIntOverflowRaft
  2369  					}
  2370  					if iNdEx >= l {
  2371  						return io.ErrUnexpectedEOF
  2372  					}
  2373  					b := dAtA[iNdEx]
  2374  					iNdEx++
  2375  					packedLen |= int(b&0x7F) << shift
  2376  					if b < 0x80 {
  2377  						break
  2378  					}
  2379  				}
  2380  				if packedLen < 0 {
  2381  					return ErrInvalidLengthRaft
  2382  				}
  2383  				postIndex := iNdEx + packedLen
  2384  				if postIndex < 0 {
  2385  					return ErrInvalidLengthRaft
  2386  				}
  2387  				if postIndex > l {
  2388  					return io.ErrUnexpectedEOF
  2389  				}
  2390  				var elementCount int
  2391  				var count int
  2392  				for _, integer := range dAtA[iNdEx:postIndex] {
  2393  					if integer < 128 {
  2394  						count++
  2395  					}
  2396  				}
  2397  				elementCount = count
  2398  				if elementCount != 0 && len(m.VotersOutgoing) == 0 {
  2399  					m.VotersOutgoing = make([]uint64, 0, elementCount)
  2400  				}
  2401  				for iNdEx < postIndex {
  2402  					var v uint64
  2403  					for shift := uint(0); ; shift += 7 {
  2404  						if shift >= 64 {
  2405  							return ErrIntOverflowRaft
  2406  						}
  2407  						if iNdEx >= l {
  2408  							return io.ErrUnexpectedEOF
  2409  						}
  2410  						b := dAtA[iNdEx]
  2411  						iNdEx++
  2412  						v |= uint64(b&0x7F) << shift
  2413  						if b < 0x80 {
  2414  							break
  2415  						}
  2416  					}
  2417  					m.VotersOutgoing = append(m.VotersOutgoing, v)
  2418  				}
  2419  			} else {
  2420  				return fmt.Errorf("proto: wrong wireType = %d for field VotersOutgoing", wireType)
  2421  			}
  2422  		case 4:
  2423  			if wireType == 0 {
  2424  				var v uint64
  2425  				for shift := uint(0); ; shift += 7 {
  2426  					if shift >= 64 {
  2427  						return ErrIntOverflowRaft
  2428  					}
  2429  					if iNdEx >= l {
  2430  						return io.ErrUnexpectedEOF
  2431  					}
  2432  					b := dAtA[iNdEx]
  2433  					iNdEx++
  2434  					v |= uint64(b&0x7F) << shift
  2435  					if b < 0x80 {
  2436  						break
  2437  					}
  2438  				}
  2439  				m.LearnersNext = append(m.LearnersNext, v)
  2440  			} else if wireType == 2 {
  2441  				var packedLen int
  2442  				for shift := uint(0); ; shift += 7 {
  2443  					if shift >= 64 {
  2444  						return ErrIntOverflowRaft
  2445  					}
  2446  					if iNdEx >= l {
  2447  						return io.ErrUnexpectedEOF
  2448  					}
  2449  					b := dAtA[iNdEx]
  2450  					iNdEx++
  2451  					packedLen |= int(b&0x7F) << shift
  2452  					if b < 0x80 {
  2453  						break
  2454  					}
  2455  				}
  2456  				if packedLen < 0 {
  2457  					return ErrInvalidLengthRaft
  2458  				}
  2459  				postIndex := iNdEx + packedLen
  2460  				if postIndex < 0 {
  2461  					return ErrInvalidLengthRaft
  2462  				}
  2463  				if postIndex > l {
  2464  					return io.ErrUnexpectedEOF
  2465  				}
  2466  				var elementCount int
  2467  				var count int
  2468  				for _, integer := range dAtA[iNdEx:postIndex] {
  2469  					if integer < 128 {
  2470  						count++
  2471  					}
  2472  				}
  2473  				elementCount = count
  2474  				if elementCount != 0 && len(m.LearnersNext) == 0 {
  2475  					m.LearnersNext = make([]uint64, 0, elementCount)
  2476  				}
  2477  				for iNdEx < postIndex {
  2478  					var v uint64
  2479  					for shift := uint(0); ; shift += 7 {
  2480  						if shift >= 64 {
  2481  							return ErrIntOverflowRaft
  2482  						}
  2483  						if iNdEx >= l {
  2484  							return io.ErrUnexpectedEOF
  2485  						}
  2486  						b := dAtA[iNdEx]
  2487  						iNdEx++
  2488  						v |= uint64(b&0x7F) << shift
  2489  						if b < 0x80 {
  2490  							break
  2491  						}
  2492  					}
  2493  					m.LearnersNext = append(m.LearnersNext, v)
  2494  				}
  2495  			} else {
  2496  				return fmt.Errorf("proto: wrong wireType = %d for field LearnersNext", wireType)
  2497  			}
  2498  		case 5:
  2499  			if wireType != 0 {
  2500  				return fmt.Errorf("proto: wrong wireType = %d for field AutoLeave", wireType)
  2501  			}
  2502  			var v int
  2503  			for shift := uint(0); ; shift += 7 {
  2504  				if shift >= 64 {
  2505  					return ErrIntOverflowRaft
  2506  				}
  2507  				if iNdEx >= l {
  2508  					return io.ErrUnexpectedEOF
  2509  				}
  2510  				b := dAtA[iNdEx]
  2511  				iNdEx++
  2512  				v |= int(b&0x7F) << shift
  2513  				if b < 0x80 {
  2514  					break
  2515  				}
  2516  			}
  2517  			m.AutoLeave = bool(v != 0)
  2518  		default:
  2519  			iNdEx = preIndex
  2520  			skippy, err := skipRaft(dAtA[iNdEx:])
  2521  			if err != nil {
  2522  				return err
  2523  			}
  2524  			if (skippy < 0) || (iNdEx+skippy) < 0 {
  2525  				return ErrInvalidLengthRaft
  2526  			}
  2527  			if (iNdEx + skippy) > l {
  2528  				return io.ErrUnexpectedEOF
  2529  			}
  2530  			iNdEx += skippy
  2531  		}
  2532  	}
  2533  
  2534  	if iNdEx > l {
  2535  		return io.ErrUnexpectedEOF
  2536  	}
  2537  	return nil
  2538  }
  2539  func (m *ConfChange) Unmarshal(dAtA []byte) error {
  2540  	l := len(dAtA)
  2541  	iNdEx := 0
  2542  	for iNdEx < l {
  2543  		preIndex := iNdEx
  2544  		var wire uint64
  2545  		for shift := uint(0); ; shift += 7 {
  2546  			if shift >= 64 {
  2547  				return ErrIntOverflowRaft
  2548  			}
  2549  			if iNdEx >= l {
  2550  				return io.ErrUnexpectedEOF
  2551  			}
  2552  			b := dAtA[iNdEx]
  2553  			iNdEx++
  2554  			wire |= uint64(b&0x7F) << shift
  2555  			if b < 0x80 {
  2556  				break
  2557  			}
  2558  		}
  2559  		fieldNum := int32(wire >> 3)
  2560  		wireType := int(wire & 0x7)
  2561  		if wireType == 4 {
  2562  			return fmt.Errorf("proto: ConfChange: wiretype end group for non-group")
  2563  		}
  2564  		if fieldNum <= 0 {
  2565  			return fmt.Errorf("proto: ConfChange: illegal tag %d (wire type %d)", fieldNum, wire)
  2566  		}
  2567  		switch fieldNum {
  2568  		case 1:
  2569  			if wireType != 0 {
  2570  				return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
  2571  			}
  2572  			m.ID = 0
  2573  			for shift := uint(0); ; shift += 7 {
  2574  				if shift >= 64 {
  2575  					return ErrIntOverflowRaft
  2576  				}
  2577  				if iNdEx >= l {
  2578  					return io.ErrUnexpectedEOF
  2579  				}
  2580  				b := dAtA[iNdEx]
  2581  				iNdEx++
  2582  				m.ID |= uint64(b&0x7F) << shift
  2583  				if b < 0x80 {
  2584  					break
  2585  				}
  2586  			}
  2587  		case 2:
  2588  			if wireType != 0 {
  2589  				return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
  2590  			}
  2591  			m.Type = 0
  2592  			for shift := uint(0); ; shift += 7 {
  2593  				if shift >= 64 {
  2594  					return ErrIntOverflowRaft
  2595  				}
  2596  				if iNdEx >= l {
  2597  					return io.ErrUnexpectedEOF
  2598  				}
  2599  				b := dAtA[iNdEx]
  2600  				iNdEx++
  2601  				m.Type |= ConfChangeType(b&0x7F) << shift
  2602  				if b < 0x80 {
  2603  					break
  2604  				}
  2605  			}
  2606  		case 3:
  2607  			if wireType != 0 {
  2608  				return fmt.Errorf("proto: wrong wireType = %d for field NodeID", wireType)
  2609  			}
  2610  			m.NodeID = 0
  2611  			for shift := uint(0); ; shift += 7 {
  2612  				if shift >= 64 {
  2613  					return ErrIntOverflowRaft
  2614  				}
  2615  				if iNdEx >= l {
  2616  					return io.ErrUnexpectedEOF
  2617  				}
  2618  				b := dAtA[iNdEx]
  2619  				iNdEx++
  2620  				m.NodeID |= uint64(b&0x7F) << shift
  2621  				if b < 0x80 {
  2622  					break
  2623  				}
  2624  			}
  2625  		case 4:
  2626  			if wireType != 2 {
  2627  				return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType)
  2628  			}
  2629  			var byteLen int
  2630  			for shift := uint(0); ; shift += 7 {
  2631  				if shift >= 64 {
  2632  					return ErrIntOverflowRaft
  2633  				}
  2634  				if iNdEx >= l {
  2635  					return io.ErrUnexpectedEOF
  2636  				}
  2637  				b := dAtA[iNdEx]
  2638  				iNdEx++
  2639  				byteLen |= int(b&0x7F) << shift
  2640  				if b < 0x80 {
  2641  					break
  2642  				}
  2643  			}
  2644  			if byteLen < 0 {
  2645  				return ErrInvalidLengthRaft
  2646  			}
  2647  			postIndex := iNdEx + byteLen
  2648  			if postIndex < 0 {
  2649  				return ErrInvalidLengthRaft
  2650  			}
  2651  			if postIndex > l {
  2652  				return io.ErrUnexpectedEOF
  2653  			}
  2654  			m.Context = append(m.Context[:0], dAtA[iNdEx:postIndex]...)
  2655  			if m.Context == nil {
  2656  				m.Context = []byte{}
  2657  			}
  2658  			iNdEx = postIndex
  2659  		default:
  2660  			iNdEx = preIndex
  2661  			skippy, err := skipRaft(dAtA[iNdEx:])
  2662  			if err != nil {
  2663  				return err
  2664  			}
  2665  			if (skippy < 0) || (iNdEx+skippy) < 0 {
  2666  				return ErrInvalidLengthRaft
  2667  			}
  2668  			if (iNdEx + skippy) > l {
  2669  				return io.ErrUnexpectedEOF
  2670  			}
  2671  			iNdEx += skippy
  2672  		}
  2673  	}
  2674  
  2675  	if iNdEx > l {
  2676  		return io.ErrUnexpectedEOF
  2677  	}
  2678  	return nil
  2679  }
  2680  func (m *ConfChangeSingle) Unmarshal(dAtA []byte) error {
  2681  	l := len(dAtA)
  2682  	iNdEx := 0
  2683  	for iNdEx < l {
  2684  		preIndex := iNdEx
  2685  		var wire uint64
  2686  		for shift := uint(0); ; shift += 7 {
  2687  			if shift >= 64 {
  2688  				return ErrIntOverflowRaft
  2689  			}
  2690  			if iNdEx >= l {
  2691  				return io.ErrUnexpectedEOF
  2692  			}
  2693  			b := dAtA[iNdEx]
  2694  			iNdEx++
  2695  			wire |= uint64(b&0x7F) << shift
  2696  			if b < 0x80 {
  2697  				break
  2698  			}
  2699  		}
  2700  		fieldNum := int32(wire >> 3)
  2701  		wireType := int(wire & 0x7)
  2702  		if wireType == 4 {
  2703  			return fmt.Errorf("proto: ConfChangeSingle: wiretype end group for non-group")
  2704  		}
  2705  		if fieldNum <= 0 {
  2706  			return fmt.Errorf("proto: ConfChangeSingle: illegal tag %d (wire type %d)", fieldNum, wire)
  2707  		}
  2708  		switch fieldNum {
  2709  		case 1:
  2710  			if wireType != 0 {
  2711  				return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
  2712  			}
  2713  			m.Type = 0
  2714  			for shift := uint(0); ; shift += 7 {
  2715  				if shift >= 64 {
  2716  					return ErrIntOverflowRaft
  2717  				}
  2718  				if iNdEx >= l {
  2719  					return io.ErrUnexpectedEOF
  2720  				}
  2721  				b := dAtA[iNdEx]
  2722  				iNdEx++
  2723  				m.Type |= ConfChangeType(b&0x7F) << shift
  2724  				if b < 0x80 {
  2725  					break
  2726  				}
  2727  			}
  2728  		case 2:
  2729  			if wireType != 0 {
  2730  				return fmt.Errorf("proto: wrong wireType = %d for field NodeID", wireType)
  2731  			}
  2732  			m.NodeID = 0
  2733  			for shift := uint(0); ; shift += 7 {
  2734  				if shift >= 64 {
  2735  					return ErrIntOverflowRaft
  2736  				}
  2737  				if iNdEx >= l {
  2738  					return io.ErrUnexpectedEOF
  2739  				}
  2740  				b := dAtA[iNdEx]
  2741  				iNdEx++
  2742  				m.NodeID |= uint64(b&0x7F) << shift
  2743  				if b < 0x80 {
  2744  					break
  2745  				}
  2746  			}
  2747  		default:
  2748  			iNdEx = preIndex
  2749  			skippy, err := skipRaft(dAtA[iNdEx:])
  2750  			if err != nil {
  2751  				return err
  2752  			}
  2753  			if (skippy < 0) || (iNdEx+skippy) < 0 {
  2754  				return ErrInvalidLengthRaft
  2755  			}
  2756  			if (iNdEx + skippy) > l {
  2757  				return io.ErrUnexpectedEOF
  2758  			}
  2759  			iNdEx += skippy
  2760  		}
  2761  	}
  2762  
  2763  	if iNdEx > l {
  2764  		return io.ErrUnexpectedEOF
  2765  	}
  2766  	return nil
  2767  }
  2768  func (m *ConfChangeV2) Unmarshal(dAtA []byte) error {
  2769  	l := len(dAtA)
  2770  	iNdEx := 0
  2771  	for iNdEx < l {
  2772  		preIndex := iNdEx
  2773  		var wire uint64
  2774  		for shift := uint(0); ; shift += 7 {
  2775  			if shift >= 64 {
  2776  				return ErrIntOverflowRaft
  2777  			}
  2778  			if iNdEx >= l {
  2779  				return io.ErrUnexpectedEOF
  2780  			}
  2781  			b := dAtA[iNdEx]
  2782  			iNdEx++
  2783  			wire |= uint64(b&0x7F) << shift
  2784  			if b < 0x80 {
  2785  				break
  2786  			}
  2787  		}
  2788  		fieldNum := int32(wire >> 3)
  2789  		wireType := int(wire & 0x7)
  2790  		if wireType == 4 {
  2791  			return fmt.Errorf("proto: ConfChangeV2: wiretype end group for non-group")
  2792  		}
  2793  		if fieldNum <= 0 {
  2794  			return fmt.Errorf("proto: ConfChangeV2: illegal tag %d (wire type %d)", fieldNum, wire)
  2795  		}
  2796  		switch fieldNum {
  2797  		case 1:
  2798  			if wireType != 0 {
  2799  				return fmt.Errorf("proto: wrong wireType = %d for field Transition", wireType)
  2800  			}
  2801  			m.Transition = 0
  2802  			for shift := uint(0); ; shift += 7 {
  2803  				if shift >= 64 {
  2804  					return ErrIntOverflowRaft
  2805  				}
  2806  				if iNdEx >= l {
  2807  					return io.ErrUnexpectedEOF
  2808  				}
  2809  				b := dAtA[iNdEx]
  2810  				iNdEx++
  2811  				m.Transition |= ConfChangeTransition(b&0x7F) << shift
  2812  				if b < 0x80 {
  2813  					break
  2814  				}
  2815  			}
  2816  		case 2:
  2817  			if wireType != 2 {
  2818  				return fmt.Errorf("proto: wrong wireType = %d for field Changes", wireType)
  2819  			}
  2820  			var msglen int
  2821  			for shift := uint(0); ; shift += 7 {
  2822  				if shift >= 64 {
  2823  					return ErrIntOverflowRaft
  2824  				}
  2825  				if iNdEx >= l {
  2826  					return io.ErrUnexpectedEOF
  2827  				}
  2828  				b := dAtA[iNdEx]
  2829  				iNdEx++
  2830  				msglen |= int(b&0x7F) << shift
  2831  				if b < 0x80 {
  2832  					break
  2833  				}
  2834  			}
  2835  			if msglen < 0 {
  2836  				return ErrInvalidLengthRaft
  2837  			}
  2838  			postIndex := iNdEx + msglen
  2839  			if postIndex < 0 {
  2840  				return ErrInvalidLengthRaft
  2841  			}
  2842  			if postIndex > l {
  2843  				return io.ErrUnexpectedEOF
  2844  			}
  2845  			m.Changes = append(m.Changes, ConfChangeSingle{})
  2846  			if err := m.Changes[len(m.Changes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  2847  				return err
  2848  			}
  2849  			iNdEx = postIndex
  2850  		case 3:
  2851  			if wireType != 2 {
  2852  				return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType)
  2853  			}
  2854  			var byteLen int
  2855  			for shift := uint(0); ; shift += 7 {
  2856  				if shift >= 64 {
  2857  					return ErrIntOverflowRaft
  2858  				}
  2859  				if iNdEx >= l {
  2860  					return io.ErrUnexpectedEOF
  2861  				}
  2862  				b := dAtA[iNdEx]
  2863  				iNdEx++
  2864  				byteLen |= int(b&0x7F) << shift
  2865  				if b < 0x80 {
  2866  					break
  2867  				}
  2868  			}
  2869  			if byteLen < 0 {
  2870  				return ErrInvalidLengthRaft
  2871  			}
  2872  			postIndex := iNdEx + byteLen
  2873  			if postIndex < 0 {
  2874  				return ErrInvalidLengthRaft
  2875  			}
  2876  			if postIndex > l {
  2877  				return io.ErrUnexpectedEOF
  2878  			}
  2879  			m.Context = append(m.Context[:0], dAtA[iNdEx:postIndex]...)
  2880  			if m.Context == nil {
  2881  				m.Context = []byte{}
  2882  			}
  2883  			iNdEx = postIndex
  2884  		default:
  2885  			iNdEx = preIndex
  2886  			skippy, err := skipRaft(dAtA[iNdEx:])
  2887  			if err != nil {
  2888  				return err
  2889  			}
  2890  			if (skippy < 0) || (iNdEx+skippy) < 0 {
  2891  				return ErrInvalidLengthRaft
  2892  			}
  2893  			if (iNdEx + skippy) > l {
  2894  				return io.ErrUnexpectedEOF
  2895  			}
  2896  			iNdEx += skippy
  2897  		}
  2898  	}
  2899  
  2900  	if iNdEx > l {
  2901  		return io.ErrUnexpectedEOF
  2902  	}
  2903  	return nil
  2904  }
  2905  func skipRaft(dAtA []byte) (n int, err error) {
  2906  	l := len(dAtA)
  2907  	iNdEx := 0
  2908  	depth := 0
  2909  	for iNdEx < l {
  2910  		var wire uint64
  2911  		for shift := uint(0); ; shift += 7 {
  2912  			if shift >= 64 {
  2913  				return 0, ErrIntOverflowRaft
  2914  			}
  2915  			if iNdEx >= l {
  2916  				return 0, io.ErrUnexpectedEOF
  2917  			}
  2918  			b := dAtA[iNdEx]
  2919  			iNdEx++
  2920  			wire |= (uint64(b) & 0x7F) << shift
  2921  			if b < 0x80 {
  2922  				break
  2923  			}
  2924  		}
  2925  		wireType := int(wire & 0x7)
  2926  		switch wireType {
  2927  		case 0:
  2928  			for shift := uint(0); ; shift += 7 {
  2929  				if shift >= 64 {
  2930  					return 0, ErrIntOverflowRaft
  2931  				}
  2932  				if iNdEx >= l {
  2933  					return 0, io.ErrUnexpectedEOF
  2934  				}
  2935  				iNdEx++
  2936  				if dAtA[iNdEx-1] < 0x80 {
  2937  					break
  2938  				}
  2939  			}
  2940  		case 1:
  2941  			iNdEx += 8
  2942  		case 2:
  2943  			var length int
  2944  			for shift := uint(0); ; shift += 7 {
  2945  				if shift >= 64 {
  2946  					return 0, ErrIntOverflowRaft
  2947  				}
  2948  				if iNdEx >= l {
  2949  					return 0, io.ErrUnexpectedEOF
  2950  				}
  2951  				b := dAtA[iNdEx]
  2952  				iNdEx++
  2953  				length |= (int(b) & 0x7F) << shift
  2954  				if b < 0x80 {
  2955  					break
  2956  				}
  2957  			}
  2958  			if length < 0 {
  2959  				return 0, ErrInvalidLengthRaft
  2960  			}
  2961  			iNdEx += length
  2962  		case 3:
  2963  			depth++
  2964  		case 4:
  2965  			if depth == 0 {
  2966  				return 0, ErrUnexpectedEndOfGroupRaft
  2967  			}
  2968  			depth--
  2969  		case 5:
  2970  			iNdEx += 4
  2971  		default:
  2972  			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  2973  		}
  2974  		if iNdEx < 0 {
  2975  			return 0, ErrInvalidLengthRaft
  2976  		}
  2977  		if depth == 0 {
  2978  			return iNdEx, nil
  2979  		}
  2980  	}
  2981  	return 0, io.ErrUnexpectedEOF
  2982  }
  2983  
  2984  var (
  2985  	ErrInvalidLengthRaft        = fmt.Errorf("proto: negative length found during unmarshaling")
  2986  	ErrIntOverflowRaft          = fmt.Errorf("proto: integer overflow")
  2987  	ErrUnexpectedEndOfGroupRaft = fmt.Errorf("proto: unexpected end of group")
  2988  )
  2989  

View as plain text