github.com/kaisenlinux/docker.io@v0.0.0-20230510090727-ea55db55fac7/swarmkit/api/snapshot.pb.go (about)

     1  // Code generated by protoc-gen-gogo. DO NOT EDIT.
     2  // source: github.com/docker/swarmkit/api/snapshot.proto
     3  
     4  package api
     5  
     6  import (
     7  	fmt "fmt"
     8  	github_com_docker_swarmkit_api_deepcopy "github.com/docker/swarmkit/api/deepcopy"
     9  	proto "github.com/gogo/protobuf/proto"
    10  	io "io"
    11  	math "math"
    12  	reflect "reflect"
    13  	strings "strings"
    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.GoGoProtoPackageIsVersion2 // please upgrade the proto package
    26  
    27  type Snapshot_Version int32
    28  
    29  const (
    30  	// V0 is the initial version of the StoreSnapshot message.
    31  	Snapshot_V0 Snapshot_Version = 0
    32  )
    33  
    34  var Snapshot_Version_name = map[int32]string{
    35  	0: "V0",
    36  }
    37  
    38  var Snapshot_Version_value = map[string]int32{
    39  	"V0": 0,
    40  }
    41  
    42  func (x Snapshot_Version) String() string {
    43  	return proto.EnumName(Snapshot_Version_name, int32(x))
    44  }
    45  
    46  func (Snapshot_Version) EnumDescriptor() ([]byte, []int) {
    47  	return fileDescriptor_c5cad0b62cecd9af, []int{2, 0}
    48  }
    49  
    50  // StoreSnapshot is used to store snapshots of the store.
    51  type StoreSnapshot struct {
    52  	Nodes      []*Node      `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"`
    53  	Services   []*Service   `protobuf:"bytes,2,rep,name=services,proto3" json:"services,omitempty"`
    54  	Networks   []*Network   `protobuf:"bytes,3,rep,name=networks,proto3" json:"networks,omitempty"`
    55  	Tasks      []*Task      `protobuf:"bytes,4,rep,name=tasks,proto3" json:"tasks,omitempty"`
    56  	Clusters   []*Cluster   `protobuf:"bytes,5,rep,name=clusters,proto3" json:"clusters,omitempty"`
    57  	Secrets    []*Secret    `protobuf:"bytes,6,rep,name=secrets,proto3" json:"secrets,omitempty"`
    58  	Resources  []*Resource  `protobuf:"bytes,7,rep,name=resources,proto3" json:"resources,omitempty"`
    59  	Extensions []*Extension `protobuf:"bytes,8,rep,name=extensions,proto3" json:"extensions,omitempty"`
    60  	Configs    []*Config    `protobuf:"bytes,9,rep,name=configs,proto3" json:"configs,omitempty"`
    61  }
    62  
    63  func (m *StoreSnapshot) Reset()      { *m = StoreSnapshot{} }
    64  func (*StoreSnapshot) ProtoMessage() {}
    65  func (*StoreSnapshot) Descriptor() ([]byte, []int) {
    66  	return fileDescriptor_c5cad0b62cecd9af, []int{0}
    67  }
    68  func (m *StoreSnapshot) XXX_Unmarshal(b []byte) error {
    69  	return m.Unmarshal(b)
    70  }
    71  func (m *StoreSnapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
    72  	if deterministic {
    73  		return xxx_messageInfo_StoreSnapshot.Marshal(b, m, deterministic)
    74  	} else {
    75  		b = b[:cap(b)]
    76  		n, err := m.MarshalTo(b)
    77  		if err != nil {
    78  			return nil, err
    79  		}
    80  		return b[:n], nil
    81  	}
    82  }
    83  func (m *StoreSnapshot) XXX_Merge(src proto.Message) {
    84  	xxx_messageInfo_StoreSnapshot.Merge(m, src)
    85  }
    86  func (m *StoreSnapshot) XXX_Size() int {
    87  	return m.Size()
    88  }
    89  func (m *StoreSnapshot) XXX_DiscardUnknown() {
    90  	xxx_messageInfo_StoreSnapshot.DiscardUnknown(m)
    91  }
    92  
    93  var xxx_messageInfo_StoreSnapshot proto.InternalMessageInfo
    94  
    95  // ClusterSnapshot stores cluster membership information in snapshots.
    96  type ClusterSnapshot struct {
    97  	Members []*RaftMember `protobuf:"bytes,1,rep,name=members,proto3" json:"members,omitempty"`
    98  	Removed []uint64      `protobuf:"varint,2,rep,name=removed,proto3" json:"removed,omitempty"`
    99  }
   100  
   101  func (m *ClusterSnapshot) Reset()      { *m = ClusterSnapshot{} }
   102  func (*ClusterSnapshot) ProtoMessage() {}
   103  func (*ClusterSnapshot) Descriptor() ([]byte, []int) {
   104  	return fileDescriptor_c5cad0b62cecd9af, []int{1}
   105  }
   106  func (m *ClusterSnapshot) XXX_Unmarshal(b []byte) error {
   107  	return m.Unmarshal(b)
   108  }
   109  func (m *ClusterSnapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   110  	if deterministic {
   111  		return xxx_messageInfo_ClusterSnapshot.Marshal(b, m, deterministic)
   112  	} else {
   113  		b = b[:cap(b)]
   114  		n, err := m.MarshalTo(b)
   115  		if err != nil {
   116  			return nil, err
   117  		}
   118  		return b[:n], nil
   119  	}
   120  }
   121  func (m *ClusterSnapshot) XXX_Merge(src proto.Message) {
   122  	xxx_messageInfo_ClusterSnapshot.Merge(m, src)
   123  }
   124  func (m *ClusterSnapshot) XXX_Size() int {
   125  	return m.Size()
   126  }
   127  func (m *ClusterSnapshot) XXX_DiscardUnknown() {
   128  	xxx_messageInfo_ClusterSnapshot.DiscardUnknown(m)
   129  }
   130  
   131  var xxx_messageInfo_ClusterSnapshot proto.InternalMessageInfo
   132  
   133  type Snapshot struct {
   134  	Version    Snapshot_Version `protobuf:"varint,1,opt,name=version,proto3,enum=docker.swarmkit.v1.Snapshot_Version" json:"version,omitempty"`
   135  	Membership ClusterSnapshot  `protobuf:"bytes,2,opt,name=membership,proto3" json:"membership"`
   136  	Store      StoreSnapshot    `protobuf:"bytes,3,opt,name=store,proto3" json:"store"`
   137  }
   138  
   139  func (m *Snapshot) Reset()      { *m = Snapshot{} }
   140  func (*Snapshot) ProtoMessage() {}
   141  func (*Snapshot) Descriptor() ([]byte, []int) {
   142  	return fileDescriptor_c5cad0b62cecd9af, []int{2}
   143  }
   144  func (m *Snapshot) XXX_Unmarshal(b []byte) error {
   145  	return m.Unmarshal(b)
   146  }
   147  func (m *Snapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   148  	if deterministic {
   149  		return xxx_messageInfo_Snapshot.Marshal(b, m, deterministic)
   150  	} else {
   151  		b = b[:cap(b)]
   152  		n, err := m.MarshalTo(b)
   153  		if err != nil {
   154  			return nil, err
   155  		}
   156  		return b[:n], nil
   157  	}
   158  }
   159  func (m *Snapshot) XXX_Merge(src proto.Message) {
   160  	xxx_messageInfo_Snapshot.Merge(m, src)
   161  }
   162  func (m *Snapshot) XXX_Size() int {
   163  	return m.Size()
   164  }
   165  func (m *Snapshot) XXX_DiscardUnknown() {
   166  	xxx_messageInfo_Snapshot.DiscardUnknown(m)
   167  }
   168  
   169  var xxx_messageInfo_Snapshot proto.InternalMessageInfo
   170  
   171  func init() {
   172  	proto.RegisterEnum("docker.swarmkit.v1.Snapshot_Version", Snapshot_Version_name, Snapshot_Version_value)
   173  	proto.RegisterType((*StoreSnapshot)(nil), "docker.swarmkit.v1.StoreSnapshot")
   174  	proto.RegisterType((*ClusterSnapshot)(nil), "docker.swarmkit.v1.ClusterSnapshot")
   175  	proto.RegisterType((*Snapshot)(nil), "docker.swarmkit.v1.Snapshot")
   176  }
   177  
   178  func init() {
   179  	proto.RegisterFile("github.com/docker/swarmkit/api/snapshot.proto", fileDescriptor_c5cad0b62cecd9af)
   180  }
   181  
   182  var fileDescriptor_c5cad0b62cecd9af = []byte{
   183  	// 507 bytes of a gzipped FileDescriptorProto
   184  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x93, 0xcf, 0x6f, 0xd3, 0x30,
   185  	0x14, 0xc7, 0x93, 0xfe, 0x4a, 0xe7, 0x09, 0x18, 0x16, 0x07, 0xab, 0x0c, 0x53, 0xca, 0x0e, 0x45,
   186  	0x82, 0x14, 0x0a, 0x12, 0x08, 0x69, 0x1c, 0x3a, 0x71, 0xe0, 0xc0, 0x0e, 0x2e, 0x9a, 0xb8, 0xa6,
   187  	0xa9, 0xdb, 0x86, 0x90, 0xb8, 0xf2, 0x73, 0x3b, 0x8e, 0xf0, 0x1f, 0xf0, 0x67, 0xf5, 0xb8, 0xe3,
   188  	0x4e, 0x88, 0xb5, 0x07, 0xfe, 0x0d, 0x64, 0x3b, 0x09, 0x95, 0x48, 0xb7, 0x5b, 0x64, 0x7d, 0x3e,
   189  	0xef, 0x7d, 0xed, 0xbc, 0x87, 0x9e, 0x4d, 0x23, 0x35, 0x5b, 0x8c, 0xfc, 0x50, 0x24, 0xbd, 0xb1,
   190  	0x08, 0x63, 0x2e, 0x7b, 0x70, 0x1e, 0xc8, 0x24, 0x8e, 0x54, 0x2f, 0x98, 0x47, 0x3d, 0x48, 0x83,
   191  	0x39, 0xcc, 0x84, 0xf2, 0xe7, 0x52, 0x28, 0x81, 0xb1, 0x65, 0xfc, 0x9c, 0xf1, 0x97, 0x2f, 0x5a,
   192  	0x4f, 0x6f, 0x28, 0x21, 0x46, 0x5f, 0x78, 0xa8, 0xc0, 0x56, 0x68, 0x3d, 0xb9, 0x81, 0x96, 0xc1,
   193  	0x24, 0x6b, 0xd6, 0xba, 0x37, 0x15, 0x53, 0x61, 0x3e, 0x7b, 0xfa, 0xcb, 0x9e, 0x76, 0x7e, 0xd4,
   194  	0xd0, 0xad, 0xa1, 0x12, 0x92, 0x0f, 0xb3, 0x68, 0xd8, 0x47, 0xf5, 0x54, 0x8c, 0x39, 0x10, 0xb7,
   195  	0x5d, 0xed, 0xee, 0xf7, 0x89, 0xff, 0x7f, 0x48, 0xff, 0x54, 0x8c, 0x39, 0xb3, 0x18, 0x7e, 0x8d,
   196  	0x9a, 0xc0, 0xe5, 0x32, 0x0a, 0x39, 0x90, 0x8a, 0x51, 0xee, 0x97, 0x29, 0x43, 0xcb, 0xb0, 0x02,
   197  	0xd6, 0x62, 0xca, 0xd5, 0xb9, 0x90, 0x31, 0x90, 0xea, 0x6e, 0xf1, 0xd4, 0x32, 0xac, 0x80, 0x75,
   198  	0x42, 0x15, 0x40, 0x0c, 0xa4, 0xb6, 0x3b, 0xe1, 0xa7, 0x00, 0x62, 0x66, 0x31, 0xdd, 0x28, 0xfc,
   199  	0xba, 0x00, 0xc5, 0x25, 0x90, 0xfa, 0xee, 0x46, 0x27, 0x96, 0x61, 0x05, 0x8c, 0x5f, 0x21, 0x0f,
   200  	0x78, 0x28, 0xb9, 0x02, 0xd2, 0x30, 0x5e, 0xab, 0xfc, 0x66, 0x1a, 0x61, 0x39, 0x8a, 0xdf, 0xa2,
   201  	0x3d, 0xc9, 0x41, 0x2c, 0xa4, 0x7e, 0x11, 0xcf, 0x78, 0x87, 0x65, 0x1e, 0xcb, 0x20, 0xf6, 0x0f,
   202  	0xc7, 0xc7, 0x08, 0xf1, 0x6f, 0x8a, 0xa7, 0x10, 0x89, 0x14, 0x48, 0xd3, 0xc8, 0x0f, 0xca, 0xe4,
   203  	0xf7, 0x39, 0xc5, 0xb6, 0x04, 0x1d, 0x38, 0x14, 0xe9, 0x24, 0x9a, 0x02, 0xd9, 0xdb, 0x1d, 0xf8,
   204  	0xc4, 0x20, 0x2c, 0x47, 0x3b, 0x11, 0xba, 0x93, 0xdd, 0xbd, 0x18, 0x82, 0x37, 0xc8, 0x4b, 0x78,
   205  	0x32, 0xd2, 0x2f, 0x66, 0xc7, 0x80, 0x96, 0xde, 0x20, 0x98, 0xa8, 0x8f, 0x06, 0x63, 0x39, 0x8e,
   206  	0x0f, 0x91, 0x27, 0x79, 0x22, 0x96, 0x7c, 0x6c, 0xa6, 0xa1, 0x36, 0xa8, 0x1c, 0x38, 0x2c, 0x3f,
   207  	0xea, 0xfc, 0x71, 0x51, 0xb3, 0x68, 0xf2, 0x0e, 0x79, 0x4b, 0x2e, 0x75, 0x72, 0xe2, 0xb6, 0xdd,
   208  	0xee, 0xed, 0xfe, 0x51, 0xe9, 0xf3, 0xe6, 0x3b, 0x73, 0x66, 0x59, 0x96, 0x4b, 0xf8, 0x03, 0x42,
   209  	0x59, 0xd7, 0x59, 0x34, 0x27, 0x95, 0xb6, 0xdb, 0xdd, 0xef, 0x3f, 0xbe, 0xe6, 0xcf, 0xe6, 0x95,
   210  	0x06, 0xb5, 0xd5, 0xaf, 0x87, 0x0e, 0xdb, 0x92, 0xf1, 0x31, 0xaa, 0x83, 0xde, 0x02, 0x52, 0x35,
   211  	0x55, 0x1e, 0x95, 0x06, 0xd9, 0x5e, 0x93, 0xac, 0x86, 0xb5, 0x3a, 0x77, 0x91, 0x97, 0xa5, 0xc3,
   212  	0x0d, 0x54, 0x39, 0x7b, 0x7e, 0xe0, 0x0c, 0x8e, 0x56, 0x57, 0xd4, 0xb9, 0xbc, 0xa2, 0xce, 0xf7,
   213  	0x35, 0x75, 0x57, 0x6b, 0xea, 0x5e, 0xac, 0xa9, 0xfb, 0x7b, 0x4d, 0xdd, 0x9f, 0x1b, 0xea, 0x5c,
   214  	0x6c, 0xa8, 0x73, 0xb9, 0xa1, 0xce, 0xe7, 0xca, 0xa8, 0x61, 0xf6, 0xf0, 0xe5, 0xdf, 0x00, 0x00,
   215  	0x00, 0xff, 0xff, 0x97, 0x4e, 0xfd, 0x2a, 0x3b, 0x04, 0x00, 0x00,
   216  }
   217  
   218  func (m *StoreSnapshot) Copy() *StoreSnapshot {
   219  	if m == nil {
   220  		return nil
   221  	}
   222  	o := &StoreSnapshot{}
   223  	o.CopyFrom(m)
   224  	return o
   225  }
   226  
   227  func (m *StoreSnapshot) CopyFrom(src interface{}) {
   228  
   229  	o := src.(*StoreSnapshot)
   230  	*m = *o
   231  	if o.Nodes != nil {
   232  		m.Nodes = make([]*Node, len(o.Nodes))
   233  		for i := range m.Nodes {
   234  			m.Nodes[i] = &Node{}
   235  			github_com_docker_swarmkit_api_deepcopy.Copy(m.Nodes[i], o.Nodes[i])
   236  		}
   237  	}
   238  
   239  	if o.Services != nil {
   240  		m.Services = make([]*Service, len(o.Services))
   241  		for i := range m.Services {
   242  			m.Services[i] = &Service{}
   243  			github_com_docker_swarmkit_api_deepcopy.Copy(m.Services[i], o.Services[i])
   244  		}
   245  	}
   246  
   247  	if o.Networks != nil {
   248  		m.Networks = make([]*Network, len(o.Networks))
   249  		for i := range m.Networks {
   250  			m.Networks[i] = &Network{}
   251  			github_com_docker_swarmkit_api_deepcopy.Copy(m.Networks[i], o.Networks[i])
   252  		}
   253  	}
   254  
   255  	if o.Tasks != nil {
   256  		m.Tasks = make([]*Task, len(o.Tasks))
   257  		for i := range m.Tasks {
   258  			m.Tasks[i] = &Task{}
   259  			github_com_docker_swarmkit_api_deepcopy.Copy(m.Tasks[i], o.Tasks[i])
   260  		}
   261  	}
   262  
   263  	if o.Clusters != nil {
   264  		m.Clusters = make([]*Cluster, len(o.Clusters))
   265  		for i := range m.Clusters {
   266  			m.Clusters[i] = &Cluster{}
   267  			github_com_docker_swarmkit_api_deepcopy.Copy(m.Clusters[i], o.Clusters[i])
   268  		}
   269  	}
   270  
   271  	if o.Secrets != nil {
   272  		m.Secrets = make([]*Secret, len(o.Secrets))
   273  		for i := range m.Secrets {
   274  			m.Secrets[i] = &Secret{}
   275  			github_com_docker_swarmkit_api_deepcopy.Copy(m.Secrets[i], o.Secrets[i])
   276  		}
   277  	}
   278  
   279  	if o.Resources != nil {
   280  		m.Resources = make([]*Resource, len(o.Resources))
   281  		for i := range m.Resources {
   282  			m.Resources[i] = &Resource{}
   283  			github_com_docker_swarmkit_api_deepcopy.Copy(m.Resources[i], o.Resources[i])
   284  		}
   285  	}
   286  
   287  	if o.Extensions != nil {
   288  		m.Extensions = make([]*Extension, len(o.Extensions))
   289  		for i := range m.Extensions {
   290  			m.Extensions[i] = &Extension{}
   291  			github_com_docker_swarmkit_api_deepcopy.Copy(m.Extensions[i], o.Extensions[i])
   292  		}
   293  	}
   294  
   295  	if o.Configs != nil {
   296  		m.Configs = make([]*Config, len(o.Configs))
   297  		for i := range m.Configs {
   298  			m.Configs[i] = &Config{}
   299  			github_com_docker_swarmkit_api_deepcopy.Copy(m.Configs[i], o.Configs[i])
   300  		}
   301  	}
   302  
   303  }
   304  
   305  func (m *ClusterSnapshot) Copy() *ClusterSnapshot {
   306  	if m == nil {
   307  		return nil
   308  	}
   309  	o := &ClusterSnapshot{}
   310  	o.CopyFrom(m)
   311  	return o
   312  }
   313  
   314  func (m *ClusterSnapshot) CopyFrom(src interface{}) {
   315  
   316  	o := src.(*ClusterSnapshot)
   317  	*m = *o
   318  	if o.Members != nil {
   319  		m.Members = make([]*RaftMember, len(o.Members))
   320  		for i := range m.Members {
   321  			m.Members[i] = &RaftMember{}
   322  			github_com_docker_swarmkit_api_deepcopy.Copy(m.Members[i], o.Members[i])
   323  		}
   324  	}
   325  
   326  	if o.Removed != nil {
   327  		m.Removed = make([]uint64, len(o.Removed))
   328  		copy(m.Removed, o.Removed)
   329  	}
   330  
   331  }
   332  
   333  func (m *Snapshot) Copy() *Snapshot {
   334  	if m == nil {
   335  		return nil
   336  	}
   337  	o := &Snapshot{}
   338  	o.CopyFrom(m)
   339  	return o
   340  }
   341  
   342  func (m *Snapshot) CopyFrom(src interface{}) {
   343  
   344  	o := src.(*Snapshot)
   345  	*m = *o
   346  	github_com_docker_swarmkit_api_deepcopy.Copy(&m.Membership, &o.Membership)
   347  	github_com_docker_swarmkit_api_deepcopy.Copy(&m.Store, &o.Store)
   348  }
   349  
   350  func (m *StoreSnapshot) Marshal() (dAtA []byte, err error) {
   351  	size := m.Size()
   352  	dAtA = make([]byte, size)
   353  	n, err := m.MarshalTo(dAtA)
   354  	if err != nil {
   355  		return nil, err
   356  	}
   357  	return dAtA[:n], nil
   358  }
   359  
   360  func (m *StoreSnapshot) MarshalTo(dAtA []byte) (int, error) {
   361  	var i int
   362  	_ = i
   363  	var l int
   364  	_ = l
   365  	if len(m.Nodes) > 0 {
   366  		for _, msg := range m.Nodes {
   367  			dAtA[i] = 0xa
   368  			i++
   369  			i = encodeVarintSnapshot(dAtA, i, uint64(msg.Size()))
   370  			n, err := msg.MarshalTo(dAtA[i:])
   371  			if err != nil {
   372  				return 0, err
   373  			}
   374  			i += n
   375  		}
   376  	}
   377  	if len(m.Services) > 0 {
   378  		for _, msg := range m.Services {
   379  			dAtA[i] = 0x12
   380  			i++
   381  			i = encodeVarintSnapshot(dAtA, i, uint64(msg.Size()))
   382  			n, err := msg.MarshalTo(dAtA[i:])
   383  			if err != nil {
   384  				return 0, err
   385  			}
   386  			i += n
   387  		}
   388  	}
   389  	if len(m.Networks) > 0 {
   390  		for _, msg := range m.Networks {
   391  			dAtA[i] = 0x1a
   392  			i++
   393  			i = encodeVarintSnapshot(dAtA, i, uint64(msg.Size()))
   394  			n, err := msg.MarshalTo(dAtA[i:])
   395  			if err != nil {
   396  				return 0, err
   397  			}
   398  			i += n
   399  		}
   400  	}
   401  	if len(m.Tasks) > 0 {
   402  		for _, msg := range m.Tasks {
   403  			dAtA[i] = 0x22
   404  			i++
   405  			i = encodeVarintSnapshot(dAtA, i, uint64(msg.Size()))
   406  			n, err := msg.MarshalTo(dAtA[i:])
   407  			if err != nil {
   408  				return 0, err
   409  			}
   410  			i += n
   411  		}
   412  	}
   413  	if len(m.Clusters) > 0 {
   414  		for _, msg := range m.Clusters {
   415  			dAtA[i] = 0x2a
   416  			i++
   417  			i = encodeVarintSnapshot(dAtA, i, uint64(msg.Size()))
   418  			n, err := msg.MarshalTo(dAtA[i:])
   419  			if err != nil {
   420  				return 0, err
   421  			}
   422  			i += n
   423  		}
   424  	}
   425  	if len(m.Secrets) > 0 {
   426  		for _, msg := range m.Secrets {
   427  			dAtA[i] = 0x32
   428  			i++
   429  			i = encodeVarintSnapshot(dAtA, i, uint64(msg.Size()))
   430  			n, err := msg.MarshalTo(dAtA[i:])
   431  			if err != nil {
   432  				return 0, err
   433  			}
   434  			i += n
   435  		}
   436  	}
   437  	if len(m.Resources) > 0 {
   438  		for _, msg := range m.Resources {
   439  			dAtA[i] = 0x3a
   440  			i++
   441  			i = encodeVarintSnapshot(dAtA, i, uint64(msg.Size()))
   442  			n, err := msg.MarshalTo(dAtA[i:])
   443  			if err != nil {
   444  				return 0, err
   445  			}
   446  			i += n
   447  		}
   448  	}
   449  	if len(m.Extensions) > 0 {
   450  		for _, msg := range m.Extensions {
   451  			dAtA[i] = 0x42
   452  			i++
   453  			i = encodeVarintSnapshot(dAtA, i, uint64(msg.Size()))
   454  			n, err := msg.MarshalTo(dAtA[i:])
   455  			if err != nil {
   456  				return 0, err
   457  			}
   458  			i += n
   459  		}
   460  	}
   461  	if len(m.Configs) > 0 {
   462  		for _, msg := range m.Configs {
   463  			dAtA[i] = 0x4a
   464  			i++
   465  			i = encodeVarintSnapshot(dAtA, i, uint64(msg.Size()))
   466  			n, err := msg.MarshalTo(dAtA[i:])
   467  			if err != nil {
   468  				return 0, err
   469  			}
   470  			i += n
   471  		}
   472  	}
   473  	return i, nil
   474  }
   475  
   476  func (m *ClusterSnapshot) Marshal() (dAtA []byte, err error) {
   477  	size := m.Size()
   478  	dAtA = make([]byte, size)
   479  	n, err := m.MarshalTo(dAtA)
   480  	if err != nil {
   481  		return nil, err
   482  	}
   483  	return dAtA[:n], nil
   484  }
   485  
   486  func (m *ClusterSnapshot) MarshalTo(dAtA []byte) (int, error) {
   487  	var i int
   488  	_ = i
   489  	var l int
   490  	_ = l
   491  	if len(m.Members) > 0 {
   492  		for _, msg := range m.Members {
   493  			dAtA[i] = 0xa
   494  			i++
   495  			i = encodeVarintSnapshot(dAtA, i, uint64(msg.Size()))
   496  			n, err := msg.MarshalTo(dAtA[i:])
   497  			if err != nil {
   498  				return 0, err
   499  			}
   500  			i += n
   501  		}
   502  	}
   503  	if len(m.Removed) > 0 {
   504  		for _, num := range m.Removed {
   505  			dAtA[i] = 0x10
   506  			i++
   507  			i = encodeVarintSnapshot(dAtA, i, uint64(num))
   508  		}
   509  	}
   510  	return i, nil
   511  }
   512  
   513  func (m *Snapshot) Marshal() (dAtA []byte, err error) {
   514  	size := m.Size()
   515  	dAtA = make([]byte, size)
   516  	n, err := m.MarshalTo(dAtA)
   517  	if err != nil {
   518  		return nil, err
   519  	}
   520  	return dAtA[:n], nil
   521  }
   522  
   523  func (m *Snapshot) MarshalTo(dAtA []byte) (int, error) {
   524  	var i int
   525  	_ = i
   526  	var l int
   527  	_ = l
   528  	if m.Version != 0 {
   529  		dAtA[i] = 0x8
   530  		i++
   531  		i = encodeVarintSnapshot(dAtA, i, uint64(m.Version))
   532  	}
   533  	dAtA[i] = 0x12
   534  	i++
   535  	i = encodeVarintSnapshot(dAtA, i, uint64(m.Membership.Size()))
   536  	n1, err := m.Membership.MarshalTo(dAtA[i:])
   537  	if err != nil {
   538  		return 0, err
   539  	}
   540  	i += n1
   541  	dAtA[i] = 0x1a
   542  	i++
   543  	i = encodeVarintSnapshot(dAtA, i, uint64(m.Store.Size()))
   544  	n2, err := m.Store.MarshalTo(dAtA[i:])
   545  	if err != nil {
   546  		return 0, err
   547  	}
   548  	i += n2
   549  	return i, nil
   550  }
   551  
   552  func encodeVarintSnapshot(dAtA []byte, offset int, v uint64) int {
   553  	for v >= 1<<7 {
   554  		dAtA[offset] = uint8(v&0x7f | 0x80)
   555  		v >>= 7
   556  		offset++
   557  	}
   558  	dAtA[offset] = uint8(v)
   559  	return offset + 1
   560  }
   561  func (m *StoreSnapshot) Size() (n int) {
   562  	if m == nil {
   563  		return 0
   564  	}
   565  	var l int
   566  	_ = l
   567  	if len(m.Nodes) > 0 {
   568  		for _, e := range m.Nodes {
   569  			l = e.Size()
   570  			n += 1 + l + sovSnapshot(uint64(l))
   571  		}
   572  	}
   573  	if len(m.Services) > 0 {
   574  		for _, e := range m.Services {
   575  			l = e.Size()
   576  			n += 1 + l + sovSnapshot(uint64(l))
   577  		}
   578  	}
   579  	if len(m.Networks) > 0 {
   580  		for _, e := range m.Networks {
   581  			l = e.Size()
   582  			n += 1 + l + sovSnapshot(uint64(l))
   583  		}
   584  	}
   585  	if len(m.Tasks) > 0 {
   586  		for _, e := range m.Tasks {
   587  			l = e.Size()
   588  			n += 1 + l + sovSnapshot(uint64(l))
   589  		}
   590  	}
   591  	if len(m.Clusters) > 0 {
   592  		for _, e := range m.Clusters {
   593  			l = e.Size()
   594  			n += 1 + l + sovSnapshot(uint64(l))
   595  		}
   596  	}
   597  	if len(m.Secrets) > 0 {
   598  		for _, e := range m.Secrets {
   599  			l = e.Size()
   600  			n += 1 + l + sovSnapshot(uint64(l))
   601  		}
   602  	}
   603  	if len(m.Resources) > 0 {
   604  		for _, e := range m.Resources {
   605  			l = e.Size()
   606  			n += 1 + l + sovSnapshot(uint64(l))
   607  		}
   608  	}
   609  	if len(m.Extensions) > 0 {
   610  		for _, e := range m.Extensions {
   611  			l = e.Size()
   612  			n += 1 + l + sovSnapshot(uint64(l))
   613  		}
   614  	}
   615  	if len(m.Configs) > 0 {
   616  		for _, e := range m.Configs {
   617  			l = e.Size()
   618  			n += 1 + l + sovSnapshot(uint64(l))
   619  		}
   620  	}
   621  	return n
   622  }
   623  
   624  func (m *ClusterSnapshot) Size() (n int) {
   625  	if m == nil {
   626  		return 0
   627  	}
   628  	var l int
   629  	_ = l
   630  	if len(m.Members) > 0 {
   631  		for _, e := range m.Members {
   632  			l = e.Size()
   633  			n += 1 + l + sovSnapshot(uint64(l))
   634  		}
   635  	}
   636  	if len(m.Removed) > 0 {
   637  		for _, e := range m.Removed {
   638  			n += 1 + sovSnapshot(uint64(e))
   639  		}
   640  	}
   641  	return n
   642  }
   643  
   644  func (m *Snapshot) Size() (n int) {
   645  	if m == nil {
   646  		return 0
   647  	}
   648  	var l int
   649  	_ = l
   650  	if m.Version != 0 {
   651  		n += 1 + sovSnapshot(uint64(m.Version))
   652  	}
   653  	l = m.Membership.Size()
   654  	n += 1 + l + sovSnapshot(uint64(l))
   655  	l = m.Store.Size()
   656  	n += 1 + l + sovSnapshot(uint64(l))
   657  	return n
   658  }
   659  
   660  func sovSnapshot(x uint64) (n int) {
   661  	for {
   662  		n++
   663  		x >>= 7
   664  		if x == 0 {
   665  			break
   666  		}
   667  	}
   668  	return n
   669  }
   670  func sozSnapshot(x uint64) (n int) {
   671  	return sovSnapshot(uint64((x << 1) ^ uint64((int64(x) >> 63))))
   672  }
   673  func (this *StoreSnapshot) String() string {
   674  	if this == nil {
   675  		return "nil"
   676  	}
   677  	s := strings.Join([]string{`&StoreSnapshot{`,
   678  		`Nodes:` + strings.Replace(fmt.Sprintf("%v", this.Nodes), "Node", "Node", 1) + `,`,
   679  		`Services:` + strings.Replace(fmt.Sprintf("%v", this.Services), "Service", "Service", 1) + `,`,
   680  		`Networks:` + strings.Replace(fmt.Sprintf("%v", this.Networks), "Network", "Network", 1) + `,`,
   681  		`Tasks:` + strings.Replace(fmt.Sprintf("%v", this.Tasks), "Task", "Task", 1) + `,`,
   682  		`Clusters:` + strings.Replace(fmt.Sprintf("%v", this.Clusters), "Cluster", "Cluster", 1) + `,`,
   683  		`Secrets:` + strings.Replace(fmt.Sprintf("%v", this.Secrets), "Secret", "Secret", 1) + `,`,
   684  		`Resources:` + strings.Replace(fmt.Sprintf("%v", this.Resources), "Resource", "Resource", 1) + `,`,
   685  		`Extensions:` + strings.Replace(fmt.Sprintf("%v", this.Extensions), "Extension", "Extension", 1) + `,`,
   686  		`Configs:` + strings.Replace(fmt.Sprintf("%v", this.Configs), "Config", "Config", 1) + `,`,
   687  		`}`,
   688  	}, "")
   689  	return s
   690  }
   691  func (this *ClusterSnapshot) String() string {
   692  	if this == nil {
   693  		return "nil"
   694  	}
   695  	s := strings.Join([]string{`&ClusterSnapshot{`,
   696  		`Members:` + strings.Replace(fmt.Sprintf("%v", this.Members), "RaftMember", "RaftMember", 1) + `,`,
   697  		`Removed:` + fmt.Sprintf("%v", this.Removed) + `,`,
   698  		`}`,
   699  	}, "")
   700  	return s
   701  }
   702  func (this *Snapshot) String() string {
   703  	if this == nil {
   704  		return "nil"
   705  	}
   706  	s := strings.Join([]string{`&Snapshot{`,
   707  		`Version:` + fmt.Sprintf("%v", this.Version) + `,`,
   708  		`Membership:` + strings.Replace(strings.Replace(this.Membership.String(), "ClusterSnapshot", "ClusterSnapshot", 1), `&`, ``, 1) + `,`,
   709  		`Store:` + strings.Replace(strings.Replace(this.Store.String(), "StoreSnapshot", "StoreSnapshot", 1), `&`, ``, 1) + `,`,
   710  		`}`,
   711  	}, "")
   712  	return s
   713  }
   714  func valueToStringSnapshot(v interface{}) string {
   715  	rv := reflect.ValueOf(v)
   716  	if rv.IsNil() {
   717  		return "nil"
   718  	}
   719  	pv := reflect.Indirect(rv).Interface()
   720  	return fmt.Sprintf("*%v", pv)
   721  }
   722  func (m *StoreSnapshot) Unmarshal(dAtA []byte) error {
   723  	l := len(dAtA)
   724  	iNdEx := 0
   725  	for iNdEx < l {
   726  		preIndex := iNdEx
   727  		var wire uint64
   728  		for shift := uint(0); ; shift += 7 {
   729  			if shift >= 64 {
   730  				return ErrIntOverflowSnapshot
   731  			}
   732  			if iNdEx >= l {
   733  				return io.ErrUnexpectedEOF
   734  			}
   735  			b := dAtA[iNdEx]
   736  			iNdEx++
   737  			wire |= uint64(b&0x7F) << shift
   738  			if b < 0x80 {
   739  				break
   740  			}
   741  		}
   742  		fieldNum := int32(wire >> 3)
   743  		wireType := int(wire & 0x7)
   744  		if wireType == 4 {
   745  			return fmt.Errorf("proto: StoreSnapshot: wiretype end group for non-group")
   746  		}
   747  		if fieldNum <= 0 {
   748  			return fmt.Errorf("proto: StoreSnapshot: illegal tag %d (wire type %d)", fieldNum, wire)
   749  		}
   750  		switch fieldNum {
   751  		case 1:
   752  			if wireType != 2 {
   753  				return fmt.Errorf("proto: wrong wireType = %d for field Nodes", wireType)
   754  			}
   755  			var msglen int
   756  			for shift := uint(0); ; shift += 7 {
   757  				if shift >= 64 {
   758  					return ErrIntOverflowSnapshot
   759  				}
   760  				if iNdEx >= l {
   761  					return io.ErrUnexpectedEOF
   762  				}
   763  				b := dAtA[iNdEx]
   764  				iNdEx++
   765  				msglen |= int(b&0x7F) << shift
   766  				if b < 0x80 {
   767  					break
   768  				}
   769  			}
   770  			if msglen < 0 {
   771  				return ErrInvalidLengthSnapshot
   772  			}
   773  			postIndex := iNdEx + msglen
   774  			if postIndex < 0 {
   775  				return ErrInvalidLengthSnapshot
   776  			}
   777  			if postIndex > l {
   778  				return io.ErrUnexpectedEOF
   779  			}
   780  			m.Nodes = append(m.Nodes, &Node{})
   781  			if err := m.Nodes[len(m.Nodes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   782  				return err
   783  			}
   784  			iNdEx = postIndex
   785  		case 2:
   786  			if wireType != 2 {
   787  				return fmt.Errorf("proto: wrong wireType = %d for field Services", wireType)
   788  			}
   789  			var msglen int
   790  			for shift := uint(0); ; shift += 7 {
   791  				if shift >= 64 {
   792  					return ErrIntOverflowSnapshot
   793  				}
   794  				if iNdEx >= l {
   795  					return io.ErrUnexpectedEOF
   796  				}
   797  				b := dAtA[iNdEx]
   798  				iNdEx++
   799  				msglen |= int(b&0x7F) << shift
   800  				if b < 0x80 {
   801  					break
   802  				}
   803  			}
   804  			if msglen < 0 {
   805  				return ErrInvalidLengthSnapshot
   806  			}
   807  			postIndex := iNdEx + msglen
   808  			if postIndex < 0 {
   809  				return ErrInvalidLengthSnapshot
   810  			}
   811  			if postIndex > l {
   812  				return io.ErrUnexpectedEOF
   813  			}
   814  			m.Services = append(m.Services, &Service{})
   815  			if err := m.Services[len(m.Services)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   816  				return err
   817  			}
   818  			iNdEx = postIndex
   819  		case 3:
   820  			if wireType != 2 {
   821  				return fmt.Errorf("proto: wrong wireType = %d for field Networks", wireType)
   822  			}
   823  			var msglen int
   824  			for shift := uint(0); ; shift += 7 {
   825  				if shift >= 64 {
   826  					return ErrIntOverflowSnapshot
   827  				}
   828  				if iNdEx >= l {
   829  					return io.ErrUnexpectedEOF
   830  				}
   831  				b := dAtA[iNdEx]
   832  				iNdEx++
   833  				msglen |= int(b&0x7F) << shift
   834  				if b < 0x80 {
   835  					break
   836  				}
   837  			}
   838  			if msglen < 0 {
   839  				return ErrInvalidLengthSnapshot
   840  			}
   841  			postIndex := iNdEx + msglen
   842  			if postIndex < 0 {
   843  				return ErrInvalidLengthSnapshot
   844  			}
   845  			if postIndex > l {
   846  				return io.ErrUnexpectedEOF
   847  			}
   848  			m.Networks = append(m.Networks, &Network{})
   849  			if err := m.Networks[len(m.Networks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   850  				return err
   851  			}
   852  			iNdEx = postIndex
   853  		case 4:
   854  			if wireType != 2 {
   855  				return fmt.Errorf("proto: wrong wireType = %d for field Tasks", wireType)
   856  			}
   857  			var msglen int
   858  			for shift := uint(0); ; shift += 7 {
   859  				if shift >= 64 {
   860  					return ErrIntOverflowSnapshot
   861  				}
   862  				if iNdEx >= l {
   863  					return io.ErrUnexpectedEOF
   864  				}
   865  				b := dAtA[iNdEx]
   866  				iNdEx++
   867  				msglen |= int(b&0x7F) << shift
   868  				if b < 0x80 {
   869  					break
   870  				}
   871  			}
   872  			if msglen < 0 {
   873  				return ErrInvalidLengthSnapshot
   874  			}
   875  			postIndex := iNdEx + msglen
   876  			if postIndex < 0 {
   877  				return ErrInvalidLengthSnapshot
   878  			}
   879  			if postIndex > l {
   880  				return io.ErrUnexpectedEOF
   881  			}
   882  			m.Tasks = append(m.Tasks, &Task{})
   883  			if err := m.Tasks[len(m.Tasks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   884  				return err
   885  			}
   886  			iNdEx = postIndex
   887  		case 5:
   888  			if wireType != 2 {
   889  				return fmt.Errorf("proto: wrong wireType = %d for field Clusters", wireType)
   890  			}
   891  			var msglen int
   892  			for shift := uint(0); ; shift += 7 {
   893  				if shift >= 64 {
   894  					return ErrIntOverflowSnapshot
   895  				}
   896  				if iNdEx >= l {
   897  					return io.ErrUnexpectedEOF
   898  				}
   899  				b := dAtA[iNdEx]
   900  				iNdEx++
   901  				msglen |= int(b&0x7F) << shift
   902  				if b < 0x80 {
   903  					break
   904  				}
   905  			}
   906  			if msglen < 0 {
   907  				return ErrInvalidLengthSnapshot
   908  			}
   909  			postIndex := iNdEx + msglen
   910  			if postIndex < 0 {
   911  				return ErrInvalidLengthSnapshot
   912  			}
   913  			if postIndex > l {
   914  				return io.ErrUnexpectedEOF
   915  			}
   916  			m.Clusters = append(m.Clusters, &Cluster{})
   917  			if err := m.Clusters[len(m.Clusters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   918  				return err
   919  			}
   920  			iNdEx = postIndex
   921  		case 6:
   922  			if wireType != 2 {
   923  				return fmt.Errorf("proto: wrong wireType = %d for field Secrets", wireType)
   924  			}
   925  			var msglen int
   926  			for shift := uint(0); ; shift += 7 {
   927  				if shift >= 64 {
   928  					return ErrIntOverflowSnapshot
   929  				}
   930  				if iNdEx >= l {
   931  					return io.ErrUnexpectedEOF
   932  				}
   933  				b := dAtA[iNdEx]
   934  				iNdEx++
   935  				msglen |= int(b&0x7F) << shift
   936  				if b < 0x80 {
   937  					break
   938  				}
   939  			}
   940  			if msglen < 0 {
   941  				return ErrInvalidLengthSnapshot
   942  			}
   943  			postIndex := iNdEx + msglen
   944  			if postIndex < 0 {
   945  				return ErrInvalidLengthSnapshot
   946  			}
   947  			if postIndex > l {
   948  				return io.ErrUnexpectedEOF
   949  			}
   950  			m.Secrets = append(m.Secrets, &Secret{})
   951  			if err := m.Secrets[len(m.Secrets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   952  				return err
   953  			}
   954  			iNdEx = postIndex
   955  		case 7:
   956  			if wireType != 2 {
   957  				return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType)
   958  			}
   959  			var msglen int
   960  			for shift := uint(0); ; shift += 7 {
   961  				if shift >= 64 {
   962  					return ErrIntOverflowSnapshot
   963  				}
   964  				if iNdEx >= l {
   965  					return io.ErrUnexpectedEOF
   966  				}
   967  				b := dAtA[iNdEx]
   968  				iNdEx++
   969  				msglen |= int(b&0x7F) << shift
   970  				if b < 0x80 {
   971  					break
   972  				}
   973  			}
   974  			if msglen < 0 {
   975  				return ErrInvalidLengthSnapshot
   976  			}
   977  			postIndex := iNdEx + msglen
   978  			if postIndex < 0 {
   979  				return ErrInvalidLengthSnapshot
   980  			}
   981  			if postIndex > l {
   982  				return io.ErrUnexpectedEOF
   983  			}
   984  			m.Resources = append(m.Resources, &Resource{})
   985  			if err := m.Resources[len(m.Resources)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   986  				return err
   987  			}
   988  			iNdEx = postIndex
   989  		case 8:
   990  			if wireType != 2 {
   991  				return fmt.Errorf("proto: wrong wireType = %d for field Extensions", wireType)
   992  			}
   993  			var msglen int
   994  			for shift := uint(0); ; shift += 7 {
   995  				if shift >= 64 {
   996  					return ErrIntOverflowSnapshot
   997  				}
   998  				if iNdEx >= l {
   999  					return io.ErrUnexpectedEOF
  1000  				}
  1001  				b := dAtA[iNdEx]
  1002  				iNdEx++
  1003  				msglen |= int(b&0x7F) << shift
  1004  				if b < 0x80 {
  1005  					break
  1006  				}
  1007  			}
  1008  			if msglen < 0 {
  1009  				return ErrInvalidLengthSnapshot
  1010  			}
  1011  			postIndex := iNdEx + msglen
  1012  			if postIndex < 0 {
  1013  				return ErrInvalidLengthSnapshot
  1014  			}
  1015  			if postIndex > l {
  1016  				return io.ErrUnexpectedEOF
  1017  			}
  1018  			m.Extensions = append(m.Extensions, &Extension{})
  1019  			if err := m.Extensions[len(m.Extensions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1020  				return err
  1021  			}
  1022  			iNdEx = postIndex
  1023  		case 9:
  1024  			if wireType != 2 {
  1025  				return fmt.Errorf("proto: wrong wireType = %d for field Configs", wireType)
  1026  			}
  1027  			var msglen int
  1028  			for shift := uint(0); ; shift += 7 {
  1029  				if shift >= 64 {
  1030  					return ErrIntOverflowSnapshot
  1031  				}
  1032  				if iNdEx >= l {
  1033  					return io.ErrUnexpectedEOF
  1034  				}
  1035  				b := dAtA[iNdEx]
  1036  				iNdEx++
  1037  				msglen |= int(b&0x7F) << shift
  1038  				if b < 0x80 {
  1039  					break
  1040  				}
  1041  			}
  1042  			if msglen < 0 {
  1043  				return ErrInvalidLengthSnapshot
  1044  			}
  1045  			postIndex := iNdEx + msglen
  1046  			if postIndex < 0 {
  1047  				return ErrInvalidLengthSnapshot
  1048  			}
  1049  			if postIndex > l {
  1050  				return io.ErrUnexpectedEOF
  1051  			}
  1052  			m.Configs = append(m.Configs, &Config{})
  1053  			if err := m.Configs[len(m.Configs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1054  				return err
  1055  			}
  1056  			iNdEx = postIndex
  1057  		default:
  1058  			iNdEx = preIndex
  1059  			skippy, err := skipSnapshot(dAtA[iNdEx:])
  1060  			if err != nil {
  1061  				return err
  1062  			}
  1063  			if skippy < 0 {
  1064  				return ErrInvalidLengthSnapshot
  1065  			}
  1066  			if (iNdEx + skippy) < 0 {
  1067  				return ErrInvalidLengthSnapshot
  1068  			}
  1069  			if (iNdEx + skippy) > l {
  1070  				return io.ErrUnexpectedEOF
  1071  			}
  1072  			iNdEx += skippy
  1073  		}
  1074  	}
  1075  
  1076  	if iNdEx > l {
  1077  		return io.ErrUnexpectedEOF
  1078  	}
  1079  	return nil
  1080  }
  1081  func (m *ClusterSnapshot) Unmarshal(dAtA []byte) error {
  1082  	l := len(dAtA)
  1083  	iNdEx := 0
  1084  	for iNdEx < l {
  1085  		preIndex := iNdEx
  1086  		var wire uint64
  1087  		for shift := uint(0); ; shift += 7 {
  1088  			if shift >= 64 {
  1089  				return ErrIntOverflowSnapshot
  1090  			}
  1091  			if iNdEx >= l {
  1092  				return io.ErrUnexpectedEOF
  1093  			}
  1094  			b := dAtA[iNdEx]
  1095  			iNdEx++
  1096  			wire |= uint64(b&0x7F) << shift
  1097  			if b < 0x80 {
  1098  				break
  1099  			}
  1100  		}
  1101  		fieldNum := int32(wire >> 3)
  1102  		wireType := int(wire & 0x7)
  1103  		if wireType == 4 {
  1104  			return fmt.Errorf("proto: ClusterSnapshot: wiretype end group for non-group")
  1105  		}
  1106  		if fieldNum <= 0 {
  1107  			return fmt.Errorf("proto: ClusterSnapshot: illegal tag %d (wire type %d)", fieldNum, wire)
  1108  		}
  1109  		switch fieldNum {
  1110  		case 1:
  1111  			if wireType != 2 {
  1112  				return fmt.Errorf("proto: wrong wireType = %d for field Members", wireType)
  1113  			}
  1114  			var msglen int
  1115  			for shift := uint(0); ; shift += 7 {
  1116  				if shift >= 64 {
  1117  					return ErrIntOverflowSnapshot
  1118  				}
  1119  				if iNdEx >= l {
  1120  					return io.ErrUnexpectedEOF
  1121  				}
  1122  				b := dAtA[iNdEx]
  1123  				iNdEx++
  1124  				msglen |= int(b&0x7F) << shift
  1125  				if b < 0x80 {
  1126  					break
  1127  				}
  1128  			}
  1129  			if msglen < 0 {
  1130  				return ErrInvalidLengthSnapshot
  1131  			}
  1132  			postIndex := iNdEx + msglen
  1133  			if postIndex < 0 {
  1134  				return ErrInvalidLengthSnapshot
  1135  			}
  1136  			if postIndex > l {
  1137  				return io.ErrUnexpectedEOF
  1138  			}
  1139  			m.Members = append(m.Members, &RaftMember{})
  1140  			if err := m.Members[len(m.Members)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1141  				return err
  1142  			}
  1143  			iNdEx = postIndex
  1144  		case 2:
  1145  			if wireType == 0 {
  1146  				var v uint64
  1147  				for shift := uint(0); ; shift += 7 {
  1148  					if shift >= 64 {
  1149  						return ErrIntOverflowSnapshot
  1150  					}
  1151  					if iNdEx >= l {
  1152  						return io.ErrUnexpectedEOF
  1153  					}
  1154  					b := dAtA[iNdEx]
  1155  					iNdEx++
  1156  					v |= uint64(b&0x7F) << shift
  1157  					if b < 0x80 {
  1158  						break
  1159  					}
  1160  				}
  1161  				m.Removed = append(m.Removed, v)
  1162  			} else if wireType == 2 {
  1163  				var packedLen int
  1164  				for shift := uint(0); ; shift += 7 {
  1165  					if shift >= 64 {
  1166  						return ErrIntOverflowSnapshot
  1167  					}
  1168  					if iNdEx >= l {
  1169  						return io.ErrUnexpectedEOF
  1170  					}
  1171  					b := dAtA[iNdEx]
  1172  					iNdEx++
  1173  					packedLen |= int(b&0x7F) << shift
  1174  					if b < 0x80 {
  1175  						break
  1176  					}
  1177  				}
  1178  				if packedLen < 0 {
  1179  					return ErrInvalidLengthSnapshot
  1180  				}
  1181  				postIndex := iNdEx + packedLen
  1182  				if postIndex < 0 {
  1183  					return ErrInvalidLengthSnapshot
  1184  				}
  1185  				if postIndex > l {
  1186  					return io.ErrUnexpectedEOF
  1187  				}
  1188  				var elementCount int
  1189  				var count int
  1190  				for _, integer := range dAtA[iNdEx:postIndex] {
  1191  					if integer < 128 {
  1192  						count++
  1193  					}
  1194  				}
  1195  				elementCount = count
  1196  				if elementCount != 0 && len(m.Removed) == 0 {
  1197  					m.Removed = make([]uint64, 0, elementCount)
  1198  				}
  1199  				for iNdEx < postIndex {
  1200  					var v uint64
  1201  					for shift := uint(0); ; shift += 7 {
  1202  						if shift >= 64 {
  1203  							return ErrIntOverflowSnapshot
  1204  						}
  1205  						if iNdEx >= l {
  1206  							return io.ErrUnexpectedEOF
  1207  						}
  1208  						b := dAtA[iNdEx]
  1209  						iNdEx++
  1210  						v |= uint64(b&0x7F) << shift
  1211  						if b < 0x80 {
  1212  							break
  1213  						}
  1214  					}
  1215  					m.Removed = append(m.Removed, v)
  1216  				}
  1217  			} else {
  1218  				return fmt.Errorf("proto: wrong wireType = %d for field Removed", wireType)
  1219  			}
  1220  		default:
  1221  			iNdEx = preIndex
  1222  			skippy, err := skipSnapshot(dAtA[iNdEx:])
  1223  			if err != nil {
  1224  				return err
  1225  			}
  1226  			if skippy < 0 {
  1227  				return ErrInvalidLengthSnapshot
  1228  			}
  1229  			if (iNdEx + skippy) < 0 {
  1230  				return ErrInvalidLengthSnapshot
  1231  			}
  1232  			if (iNdEx + skippy) > l {
  1233  				return io.ErrUnexpectedEOF
  1234  			}
  1235  			iNdEx += skippy
  1236  		}
  1237  	}
  1238  
  1239  	if iNdEx > l {
  1240  		return io.ErrUnexpectedEOF
  1241  	}
  1242  	return nil
  1243  }
  1244  func (m *Snapshot) Unmarshal(dAtA []byte) error {
  1245  	l := len(dAtA)
  1246  	iNdEx := 0
  1247  	for iNdEx < l {
  1248  		preIndex := iNdEx
  1249  		var wire uint64
  1250  		for shift := uint(0); ; shift += 7 {
  1251  			if shift >= 64 {
  1252  				return ErrIntOverflowSnapshot
  1253  			}
  1254  			if iNdEx >= l {
  1255  				return io.ErrUnexpectedEOF
  1256  			}
  1257  			b := dAtA[iNdEx]
  1258  			iNdEx++
  1259  			wire |= uint64(b&0x7F) << shift
  1260  			if b < 0x80 {
  1261  				break
  1262  			}
  1263  		}
  1264  		fieldNum := int32(wire >> 3)
  1265  		wireType := int(wire & 0x7)
  1266  		if wireType == 4 {
  1267  			return fmt.Errorf("proto: Snapshot: wiretype end group for non-group")
  1268  		}
  1269  		if fieldNum <= 0 {
  1270  			return fmt.Errorf("proto: Snapshot: illegal tag %d (wire type %d)", fieldNum, wire)
  1271  		}
  1272  		switch fieldNum {
  1273  		case 1:
  1274  			if wireType != 0 {
  1275  				return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType)
  1276  			}
  1277  			m.Version = 0
  1278  			for shift := uint(0); ; shift += 7 {
  1279  				if shift >= 64 {
  1280  					return ErrIntOverflowSnapshot
  1281  				}
  1282  				if iNdEx >= l {
  1283  					return io.ErrUnexpectedEOF
  1284  				}
  1285  				b := dAtA[iNdEx]
  1286  				iNdEx++
  1287  				m.Version |= Snapshot_Version(b&0x7F) << shift
  1288  				if b < 0x80 {
  1289  					break
  1290  				}
  1291  			}
  1292  		case 2:
  1293  			if wireType != 2 {
  1294  				return fmt.Errorf("proto: wrong wireType = %d for field Membership", wireType)
  1295  			}
  1296  			var msglen int
  1297  			for shift := uint(0); ; shift += 7 {
  1298  				if shift >= 64 {
  1299  					return ErrIntOverflowSnapshot
  1300  				}
  1301  				if iNdEx >= l {
  1302  					return io.ErrUnexpectedEOF
  1303  				}
  1304  				b := dAtA[iNdEx]
  1305  				iNdEx++
  1306  				msglen |= int(b&0x7F) << shift
  1307  				if b < 0x80 {
  1308  					break
  1309  				}
  1310  			}
  1311  			if msglen < 0 {
  1312  				return ErrInvalidLengthSnapshot
  1313  			}
  1314  			postIndex := iNdEx + msglen
  1315  			if postIndex < 0 {
  1316  				return ErrInvalidLengthSnapshot
  1317  			}
  1318  			if postIndex > l {
  1319  				return io.ErrUnexpectedEOF
  1320  			}
  1321  			if err := m.Membership.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1322  				return err
  1323  			}
  1324  			iNdEx = postIndex
  1325  		case 3:
  1326  			if wireType != 2 {
  1327  				return fmt.Errorf("proto: wrong wireType = %d for field Store", wireType)
  1328  			}
  1329  			var msglen int
  1330  			for shift := uint(0); ; shift += 7 {
  1331  				if shift >= 64 {
  1332  					return ErrIntOverflowSnapshot
  1333  				}
  1334  				if iNdEx >= l {
  1335  					return io.ErrUnexpectedEOF
  1336  				}
  1337  				b := dAtA[iNdEx]
  1338  				iNdEx++
  1339  				msglen |= int(b&0x7F) << shift
  1340  				if b < 0x80 {
  1341  					break
  1342  				}
  1343  			}
  1344  			if msglen < 0 {
  1345  				return ErrInvalidLengthSnapshot
  1346  			}
  1347  			postIndex := iNdEx + msglen
  1348  			if postIndex < 0 {
  1349  				return ErrInvalidLengthSnapshot
  1350  			}
  1351  			if postIndex > l {
  1352  				return io.ErrUnexpectedEOF
  1353  			}
  1354  			if err := m.Store.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1355  				return err
  1356  			}
  1357  			iNdEx = postIndex
  1358  		default:
  1359  			iNdEx = preIndex
  1360  			skippy, err := skipSnapshot(dAtA[iNdEx:])
  1361  			if err != nil {
  1362  				return err
  1363  			}
  1364  			if skippy < 0 {
  1365  				return ErrInvalidLengthSnapshot
  1366  			}
  1367  			if (iNdEx + skippy) < 0 {
  1368  				return ErrInvalidLengthSnapshot
  1369  			}
  1370  			if (iNdEx + skippy) > l {
  1371  				return io.ErrUnexpectedEOF
  1372  			}
  1373  			iNdEx += skippy
  1374  		}
  1375  	}
  1376  
  1377  	if iNdEx > l {
  1378  		return io.ErrUnexpectedEOF
  1379  	}
  1380  	return nil
  1381  }
  1382  func skipSnapshot(dAtA []byte) (n int, err error) {
  1383  	l := len(dAtA)
  1384  	iNdEx := 0
  1385  	for iNdEx < l {
  1386  		var wire uint64
  1387  		for shift := uint(0); ; shift += 7 {
  1388  			if shift >= 64 {
  1389  				return 0, ErrIntOverflowSnapshot
  1390  			}
  1391  			if iNdEx >= l {
  1392  				return 0, io.ErrUnexpectedEOF
  1393  			}
  1394  			b := dAtA[iNdEx]
  1395  			iNdEx++
  1396  			wire |= (uint64(b) & 0x7F) << shift
  1397  			if b < 0x80 {
  1398  				break
  1399  			}
  1400  		}
  1401  		wireType := int(wire & 0x7)
  1402  		switch wireType {
  1403  		case 0:
  1404  			for shift := uint(0); ; shift += 7 {
  1405  				if shift >= 64 {
  1406  					return 0, ErrIntOverflowSnapshot
  1407  				}
  1408  				if iNdEx >= l {
  1409  					return 0, io.ErrUnexpectedEOF
  1410  				}
  1411  				iNdEx++
  1412  				if dAtA[iNdEx-1] < 0x80 {
  1413  					break
  1414  				}
  1415  			}
  1416  			return iNdEx, nil
  1417  		case 1:
  1418  			iNdEx += 8
  1419  			return iNdEx, nil
  1420  		case 2:
  1421  			var length int
  1422  			for shift := uint(0); ; shift += 7 {
  1423  				if shift >= 64 {
  1424  					return 0, ErrIntOverflowSnapshot
  1425  				}
  1426  				if iNdEx >= l {
  1427  					return 0, io.ErrUnexpectedEOF
  1428  				}
  1429  				b := dAtA[iNdEx]
  1430  				iNdEx++
  1431  				length |= (int(b) & 0x7F) << shift
  1432  				if b < 0x80 {
  1433  					break
  1434  				}
  1435  			}
  1436  			if length < 0 {
  1437  				return 0, ErrInvalidLengthSnapshot
  1438  			}
  1439  			iNdEx += length
  1440  			if iNdEx < 0 {
  1441  				return 0, ErrInvalidLengthSnapshot
  1442  			}
  1443  			return iNdEx, nil
  1444  		case 3:
  1445  			for {
  1446  				var innerWire uint64
  1447  				var start int = iNdEx
  1448  				for shift := uint(0); ; shift += 7 {
  1449  					if shift >= 64 {
  1450  						return 0, ErrIntOverflowSnapshot
  1451  					}
  1452  					if iNdEx >= l {
  1453  						return 0, io.ErrUnexpectedEOF
  1454  					}
  1455  					b := dAtA[iNdEx]
  1456  					iNdEx++
  1457  					innerWire |= (uint64(b) & 0x7F) << shift
  1458  					if b < 0x80 {
  1459  						break
  1460  					}
  1461  				}
  1462  				innerWireType := int(innerWire & 0x7)
  1463  				if innerWireType == 4 {
  1464  					break
  1465  				}
  1466  				next, err := skipSnapshot(dAtA[start:])
  1467  				if err != nil {
  1468  					return 0, err
  1469  				}
  1470  				iNdEx = start + next
  1471  				if iNdEx < 0 {
  1472  					return 0, ErrInvalidLengthSnapshot
  1473  				}
  1474  			}
  1475  			return iNdEx, nil
  1476  		case 4:
  1477  			return iNdEx, nil
  1478  		case 5:
  1479  			iNdEx += 4
  1480  			return iNdEx, nil
  1481  		default:
  1482  			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  1483  		}
  1484  	}
  1485  	panic("unreachable")
  1486  }
  1487  
  1488  var (
  1489  	ErrInvalidLengthSnapshot = fmt.Errorf("proto: negative length found during unmarshaling")
  1490  	ErrIntOverflowSnapshot   = fmt.Errorf("proto: integer overflow")
  1491  )