2018-06-08 05:26:10 -04:00
|
|
|
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
2017-09-29 06:32:26 -04:00
|
|
|
// source: github.com/docker/swarmkit/api/snapshot.proto
|
2017-04-17 18:08:24 -04:00
|
|
|
|
|
|
|
package api
|
|
|
|
|
2020-02-12 12:00:03 -05:00
|
|
|
import (
|
|
|
|
fmt "fmt"
|
|
|
|
github_com_docker_swarmkit_api_deepcopy "github.com/docker/swarmkit/api/deepcopy"
|
|
|
|
proto "github.com/gogo/protobuf/proto"
|
|
|
|
io "io"
|
|
|
|
math "math"
|
2021-06-21 11:11:02 -04:00
|
|
|
math_bits "math/bits"
|
2020-02-12 12:00:03 -05:00
|
|
|
reflect "reflect"
|
|
|
|
strings "strings"
|
|
|
|
)
|
2017-04-17 18:08:24 -04:00
|
|
|
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
|
|
var _ = proto.Marshal
|
|
|
|
var _ = fmt.Errorf
|
|
|
|
var _ = math.Inf
|
|
|
|
|
2020-02-12 12:00:03 -05:00
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
|
|
// is compatible with the proto package it is being compiled against.
|
|
|
|
// A compilation error at this line likely means your copy of the
|
|
|
|
// proto package needs to be updated.
|
2021-06-21 11:11:02 -04:00
|
|
|
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
2020-02-12 12:00:03 -05:00
|
|
|
|
2017-04-17 18:08:24 -04:00
|
|
|
type Snapshot_Version int32
|
|
|
|
|
|
|
|
const (
|
|
|
|
// V0 is the initial version of the StoreSnapshot message.
|
|
|
|
Snapshot_V0 Snapshot_Version = 0
|
|
|
|
)
|
|
|
|
|
|
|
|
var Snapshot_Version_name = map[int32]string{
|
|
|
|
0: "V0",
|
|
|
|
}
|
2020-02-12 12:00:03 -05:00
|
|
|
|
2017-04-17 18:08:24 -04:00
|
|
|
var Snapshot_Version_value = map[string]int32{
|
|
|
|
"V0": 0,
|
|
|
|
}
|
|
|
|
|
|
|
|
func (x Snapshot_Version) String() string {
|
|
|
|
return proto.EnumName(Snapshot_Version_name, int32(x))
|
|
|
|
}
|
2020-02-12 12:00:03 -05:00
|
|
|
|
|
|
|
func (Snapshot_Version) EnumDescriptor() ([]byte, []int) {
|
|
|
|
return fileDescriptor_c5cad0b62cecd9af, []int{2, 0}
|
|
|
|
}
|
2017-04-17 18:08:24 -04:00
|
|
|
|
|
|
|
// StoreSnapshot is used to store snapshots of the store.
|
|
|
|
type StoreSnapshot struct {
|
2020-02-12 12:00:03 -05:00
|
|
|
Nodes []*Node `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"`
|
|
|
|
Services []*Service `protobuf:"bytes,2,rep,name=services,proto3" json:"services,omitempty"`
|
|
|
|
Networks []*Network `protobuf:"bytes,3,rep,name=networks,proto3" json:"networks,omitempty"`
|
|
|
|
Tasks []*Task `protobuf:"bytes,4,rep,name=tasks,proto3" json:"tasks,omitempty"`
|
|
|
|
Clusters []*Cluster `protobuf:"bytes,5,rep,name=clusters,proto3" json:"clusters,omitempty"`
|
|
|
|
Secrets []*Secret `protobuf:"bytes,6,rep,name=secrets,proto3" json:"secrets,omitempty"`
|
|
|
|
Resources []*Resource `protobuf:"bytes,7,rep,name=resources,proto3" json:"resources,omitempty"`
|
|
|
|
Extensions []*Extension `protobuf:"bytes,8,rep,name=extensions,proto3" json:"extensions,omitempty"`
|
|
|
|
Configs []*Config `protobuf:"bytes,9,rep,name=configs,proto3" json:"configs,omitempty"`
|
2017-04-17 18:08:24 -04:00
|
|
|
}
|
|
|
|
|
2020-02-12 12:00:03 -05:00
|
|
|
func (m *StoreSnapshot) Reset() { *m = StoreSnapshot{} }
|
|
|
|
func (*StoreSnapshot) ProtoMessage() {}
|
|
|
|
func (*StoreSnapshot) Descriptor() ([]byte, []int) {
|
|
|
|
return fileDescriptor_c5cad0b62cecd9af, []int{0}
|
|
|
|
}
|
|
|
|
func (m *StoreSnapshot) XXX_Unmarshal(b []byte) error {
|
|
|
|
return m.Unmarshal(b)
|
|
|
|
}
|
|
|
|
func (m *StoreSnapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
|
|
if deterministic {
|
|
|
|
return xxx_messageInfo_StoreSnapshot.Marshal(b, m, deterministic)
|
|
|
|
} else {
|
|
|
|
b = b[:cap(b)]
|
2021-06-21 11:11:02 -04:00
|
|
|
n, err := m.MarshalToSizedBuffer(b)
|
2020-02-12 12:00:03 -05:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return b[:n], nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
func (m *StoreSnapshot) XXX_Merge(src proto.Message) {
|
|
|
|
xxx_messageInfo_StoreSnapshot.Merge(m, src)
|
|
|
|
}
|
|
|
|
func (m *StoreSnapshot) XXX_Size() int {
|
|
|
|
return m.Size()
|
|
|
|
}
|
|
|
|
func (m *StoreSnapshot) XXX_DiscardUnknown() {
|
|
|
|
xxx_messageInfo_StoreSnapshot.DiscardUnknown(m)
|
|
|
|
}
|
|
|
|
|
|
|
|
var xxx_messageInfo_StoreSnapshot proto.InternalMessageInfo
|
2017-04-17 18:08:24 -04:00
|
|
|
|
|
|
|
// ClusterSnapshot stores cluster membership information in snapshots.
|
|
|
|
type ClusterSnapshot struct {
|
2020-02-12 12:00:03 -05:00
|
|
|
Members []*RaftMember `protobuf:"bytes,1,rep,name=members,proto3" json:"members,omitempty"`
|
|
|
|
Removed []uint64 `protobuf:"varint,2,rep,name=removed,proto3" json:"removed,omitempty"`
|
2017-04-17 18:08:24 -04:00
|
|
|
}
|
|
|
|
|
2020-02-12 12:00:03 -05:00
|
|
|
func (m *ClusterSnapshot) Reset() { *m = ClusterSnapshot{} }
|
|
|
|
func (*ClusterSnapshot) ProtoMessage() {}
|
|
|
|
func (*ClusterSnapshot) Descriptor() ([]byte, []int) {
|
|
|
|
return fileDescriptor_c5cad0b62cecd9af, []int{1}
|
|
|
|
}
|
|
|
|
func (m *ClusterSnapshot) XXX_Unmarshal(b []byte) error {
|
|
|
|
return m.Unmarshal(b)
|
|
|
|
}
|
|
|
|
func (m *ClusterSnapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
|
|
if deterministic {
|
|
|
|
return xxx_messageInfo_ClusterSnapshot.Marshal(b, m, deterministic)
|
|
|
|
} else {
|
|
|
|
b = b[:cap(b)]
|
2021-06-21 11:11:02 -04:00
|
|
|
n, err := m.MarshalToSizedBuffer(b)
|
2020-02-12 12:00:03 -05:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return b[:n], nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
func (m *ClusterSnapshot) XXX_Merge(src proto.Message) {
|
|
|
|
xxx_messageInfo_ClusterSnapshot.Merge(m, src)
|
|
|
|
}
|
|
|
|
func (m *ClusterSnapshot) XXX_Size() int {
|
|
|
|
return m.Size()
|
|
|
|
}
|
|
|
|
func (m *ClusterSnapshot) XXX_DiscardUnknown() {
|
|
|
|
xxx_messageInfo_ClusterSnapshot.DiscardUnknown(m)
|
|
|
|
}
|
|
|
|
|
|
|
|
var xxx_messageInfo_ClusterSnapshot proto.InternalMessageInfo
|
2017-04-17 18:08:24 -04:00
|
|
|
|
|
|
|
type Snapshot struct {
|
|
|
|
Version Snapshot_Version `protobuf:"varint,1,opt,name=version,proto3,enum=docker.swarmkit.v1.Snapshot_Version" json:"version,omitempty"`
|
2020-02-12 12:00:03 -05:00
|
|
|
Membership ClusterSnapshot `protobuf:"bytes,2,opt,name=membership,proto3" json:"membership"`
|
|
|
|
Store StoreSnapshot `protobuf:"bytes,3,opt,name=store,proto3" json:"store"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *Snapshot) Reset() { *m = Snapshot{} }
|
|
|
|
func (*Snapshot) ProtoMessage() {}
|
|
|
|
func (*Snapshot) Descriptor() ([]byte, []int) {
|
|
|
|
return fileDescriptor_c5cad0b62cecd9af, []int{2}
|
|
|
|
}
|
|
|
|
func (m *Snapshot) XXX_Unmarshal(b []byte) error {
|
|
|
|
return m.Unmarshal(b)
|
|
|
|
}
|
|
|
|
func (m *Snapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
|
|
if deterministic {
|
|
|
|
return xxx_messageInfo_Snapshot.Marshal(b, m, deterministic)
|
|
|
|
} else {
|
|
|
|
b = b[:cap(b)]
|
2021-06-21 11:11:02 -04:00
|
|
|
n, err := m.MarshalToSizedBuffer(b)
|
2020-02-12 12:00:03 -05:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return b[:n], nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
func (m *Snapshot) XXX_Merge(src proto.Message) {
|
|
|
|
xxx_messageInfo_Snapshot.Merge(m, src)
|
|
|
|
}
|
|
|
|
func (m *Snapshot) XXX_Size() int {
|
|
|
|
return m.Size()
|
|
|
|
}
|
|
|
|
func (m *Snapshot) XXX_DiscardUnknown() {
|
|
|
|
xxx_messageInfo_Snapshot.DiscardUnknown(m)
|
2017-04-17 18:08:24 -04:00
|
|
|
}
|
|
|
|
|
2020-02-12 12:00:03 -05:00
|
|
|
var xxx_messageInfo_Snapshot proto.InternalMessageInfo
|
2017-04-17 18:08:24 -04:00
|
|
|
|
|
|
|
func init() {
|
2020-02-12 12:00:03 -05:00
|
|
|
proto.RegisterEnum("docker.swarmkit.v1.Snapshot_Version", Snapshot_Version_name, Snapshot_Version_value)
|
2017-04-17 18:08:24 -04:00
|
|
|
proto.RegisterType((*StoreSnapshot)(nil), "docker.swarmkit.v1.StoreSnapshot")
|
|
|
|
proto.RegisterType((*ClusterSnapshot)(nil), "docker.swarmkit.v1.ClusterSnapshot")
|
|
|
|
proto.RegisterType((*Snapshot)(nil), "docker.swarmkit.v1.Snapshot")
|
2020-02-12 12:00:03 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
proto.RegisterFile("github.com/docker/swarmkit/api/snapshot.proto", fileDescriptor_c5cad0b62cecd9af)
|
|
|
|
}
|
|
|
|
|
|
|
|
var fileDescriptor_c5cad0b62cecd9af = []byte{
|
|
|
|
// 507 bytes of a gzipped FileDescriptorProto
|
|
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x93, 0xcf, 0x6f, 0xd3, 0x30,
|
|
|
|
0x14, 0xc7, 0x93, 0xfe, 0x4a, 0xe7, 0x09, 0x18, 0x16, 0x07, 0xab, 0x0c, 0x53, 0xca, 0x0e, 0x45,
|
|
|
|
0x82, 0x14, 0x0a, 0x12, 0x08, 0x69, 0x1c, 0x3a, 0x71, 0xe0, 0xc0, 0x0e, 0x2e, 0x9a, 0xb8, 0xa6,
|
|
|
|
0xa9, 0xdb, 0x86, 0x90, 0xb8, 0xf2, 0x73, 0x3b, 0x8e, 0xf0, 0x1f, 0xf0, 0x67, 0xf5, 0xb8, 0xe3,
|
|
|
|
0x4e, 0x88, 0xb5, 0x07, 0xfe, 0x0d, 0x64, 0x3b, 0x09, 0x95, 0x48, 0xb7, 0x5b, 0x64, 0x7d, 0x3e,
|
|
|
|
0xef, 0x7d, 0xed, 0xbc, 0x87, 0x9e, 0x4d, 0x23, 0x35, 0x5b, 0x8c, 0xfc, 0x50, 0x24, 0xbd, 0xb1,
|
|
|
|
0x08, 0x63, 0x2e, 0x7b, 0x70, 0x1e, 0xc8, 0x24, 0x8e, 0x54, 0x2f, 0x98, 0x47, 0x3d, 0x48, 0x83,
|
|
|
|
0x39, 0xcc, 0x84, 0xf2, 0xe7, 0x52, 0x28, 0x81, 0xb1, 0x65, 0xfc, 0x9c, 0xf1, 0x97, 0x2f, 0x5a,
|
|
|
|
0x4f, 0x6f, 0x28, 0x21, 0x46, 0x5f, 0x78, 0xa8, 0xc0, 0x56, 0x68, 0x3d, 0xb9, 0x81, 0x96, 0xc1,
|
|
|
|
0x24, 0x6b, 0xd6, 0xba, 0x37, 0x15, 0x53, 0x61, 0x3e, 0x7b, 0xfa, 0xcb, 0x9e, 0x76, 0x7e, 0xd4,
|
|
|
|
0xd0, 0xad, 0xa1, 0x12, 0x92, 0x0f, 0xb3, 0x68, 0xd8, 0x47, 0xf5, 0x54, 0x8c, 0x39, 0x10, 0xb7,
|
|
|
|
0x5d, 0xed, 0xee, 0xf7, 0x89, 0xff, 0x7f, 0x48, 0xff, 0x54, 0x8c, 0x39, 0xb3, 0x18, 0x7e, 0x8d,
|
|
|
|
0x9a, 0xc0, 0xe5, 0x32, 0x0a, 0x39, 0x90, 0x8a, 0x51, 0xee, 0x97, 0x29, 0x43, 0xcb, 0xb0, 0x02,
|
|
|
|
0xd6, 0x62, 0xca, 0xd5, 0xb9, 0x90, 0x31, 0x90, 0xea, 0x6e, 0xf1, 0xd4, 0x32, 0xac, 0x80, 0x75,
|
|
|
|
0x42, 0x15, 0x40, 0x0c, 0xa4, 0xb6, 0x3b, 0xe1, 0xa7, 0x00, 0x62, 0x66, 0x31, 0xdd, 0x28, 0xfc,
|
|
|
|
0xba, 0x00, 0xc5, 0x25, 0x90, 0xfa, 0xee, 0x46, 0x27, 0x96, 0x61, 0x05, 0x8c, 0x5f, 0x21, 0x0f,
|
|
|
|
0x78, 0x28, 0xb9, 0x02, 0xd2, 0x30, 0x5e, 0xab, 0xfc, 0x66, 0x1a, 0x61, 0x39, 0x8a, 0xdf, 0xa2,
|
|
|
|
0x3d, 0xc9, 0x41, 0x2c, 0xa4, 0x7e, 0x11, 0xcf, 0x78, 0x87, 0x65, 0x1e, 0xcb, 0x20, 0xf6, 0x0f,
|
|
|
|
0xc7, 0xc7, 0x08, 0xf1, 0x6f, 0x8a, 0xa7, 0x10, 0x89, 0x14, 0x48, 0xd3, 0xc8, 0x0f, 0xca, 0xe4,
|
|
|
|
0xf7, 0x39, 0xc5, 0xb6, 0x04, 0x1d, 0x38, 0x14, 0xe9, 0x24, 0x9a, 0x02, 0xd9, 0xdb, 0x1d, 0xf8,
|
|
|
|
0xc4, 0x20, 0x2c, 0x47, 0x3b, 0x11, 0xba, 0x93, 0xdd, 0xbd, 0x18, 0x82, 0x37, 0xc8, 0x4b, 0x78,
|
|
|
|
0x32, 0xd2, 0x2f, 0x66, 0xc7, 0x80, 0x96, 0xde, 0x20, 0x98, 0xa8, 0x8f, 0x06, 0x63, 0x39, 0x8e,
|
|
|
|
0x0f, 0x91, 0x27, 0x79, 0x22, 0x96, 0x7c, 0x6c, 0xa6, 0xa1, 0x36, 0xa8, 0x1c, 0x38, 0x2c, 0x3f,
|
|
|
|
0xea, 0xfc, 0x71, 0x51, 0xb3, 0x68, 0xf2, 0x0e, 0x79, 0x4b, 0x2e, 0x75, 0x72, 0xe2, 0xb6, 0xdd,
|
|
|
|
0xee, 0xed, 0xfe, 0x51, 0xe9, 0xf3, 0xe6, 0x3b, 0x73, 0x66, 0x59, 0x96, 0x4b, 0xf8, 0x03, 0x42,
|
|
|
|
0x59, 0xd7, 0x59, 0x34, 0x27, 0x95, 0xb6, 0xdb, 0xdd, 0xef, 0x3f, 0xbe, 0xe6, 0xcf, 0xe6, 0x95,
|
|
|
|
0x06, 0xb5, 0xd5, 0xaf, 0x87, 0x0e, 0xdb, 0x92, 0xf1, 0x31, 0xaa, 0x83, 0xde, 0x02, 0x52, 0x35,
|
|
|
|
0x55, 0x1e, 0x95, 0x06, 0xd9, 0x5e, 0x93, 0xac, 0x86, 0xb5, 0x3a, 0x77, 0x91, 0x97, 0xa5, 0xc3,
|
|
|
|
0x0d, 0x54, 0x39, 0x7b, 0x7e, 0xe0, 0x0c, 0x8e, 0x56, 0x57, 0xd4, 0xb9, 0xbc, 0xa2, 0xce, 0xf7,
|
|
|
|
0x35, 0x75, 0x57, 0x6b, 0xea, 0x5e, 0xac, 0xa9, 0xfb, 0x7b, 0x4d, 0xdd, 0x9f, 0x1b, 0xea, 0x5c,
|
|
|
|
0x6c, 0xa8, 0x73, 0xb9, 0xa1, 0xce, 0xe7, 0xca, 0xa8, 0x61, 0xf6, 0xf0, 0xe5, 0xdf, 0x00, 0x00,
|
|
|
|
0x00, 0xff, 0xff, 0x97, 0x4e, 0xfd, 0x2a, 0x3b, 0x04, 0x00, 0x00,
|
2017-04-17 18:08:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
func (m *StoreSnapshot) Copy() *StoreSnapshot {
|
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
o := &StoreSnapshot{}
|
|
|
|
o.CopyFrom(m)
|
|
|
|
return o
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *StoreSnapshot) CopyFrom(src interface{}) {
|
|
|
|
|
|
|
|
o := src.(*StoreSnapshot)
|
|
|
|
*m = *o
|
|
|
|
if o.Nodes != nil {
|
|
|
|
m.Nodes = make([]*Node, len(o.Nodes))
|
|
|
|
for i := range m.Nodes {
|
|
|
|
m.Nodes[i] = &Node{}
|
2020-02-12 12:00:03 -05:00
|
|
|
github_com_docker_swarmkit_api_deepcopy.Copy(m.Nodes[i], o.Nodes[i])
|
2017-04-17 18:08:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if o.Services != nil {
|
|
|
|
m.Services = make([]*Service, len(o.Services))
|
|
|
|
for i := range m.Services {
|
|
|
|
m.Services[i] = &Service{}
|
2020-02-12 12:00:03 -05:00
|
|
|
github_com_docker_swarmkit_api_deepcopy.Copy(m.Services[i], o.Services[i])
|
2017-04-17 18:08:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if o.Networks != nil {
|
|
|
|
m.Networks = make([]*Network, len(o.Networks))
|
|
|
|
for i := range m.Networks {
|
|
|
|
m.Networks[i] = &Network{}
|
2020-02-12 12:00:03 -05:00
|
|
|
github_com_docker_swarmkit_api_deepcopy.Copy(m.Networks[i], o.Networks[i])
|
2017-04-17 18:08:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if o.Tasks != nil {
|
|
|
|
m.Tasks = make([]*Task, len(o.Tasks))
|
|
|
|
for i := range m.Tasks {
|
|
|
|
m.Tasks[i] = &Task{}
|
2020-02-12 12:00:03 -05:00
|
|
|
github_com_docker_swarmkit_api_deepcopy.Copy(m.Tasks[i], o.Tasks[i])
|
2017-04-17 18:08:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if o.Clusters != nil {
|
|
|
|
m.Clusters = make([]*Cluster, len(o.Clusters))
|
|
|
|
for i := range m.Clusters {
|
|
|
|
m.Clusters[i] = &Cluster{}
|
2020-02-12 12:00:03 -05:00
|
|
|
github_com_docker_swarmkit_api_deepcopy.Copy(m.Clusters[i], o.Clusters[i])
|
2017-04-17 18:08:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if o.Secrets != nil {
|
|
|
|
m.Secrets = make([]*Secret, len(o.Secrets))
|
|
|
|
for i := range m.Secrets {
|
|
|
|
m.Secrets[i] = &Secret{}
|
2020-02-12 12:00:03 -05:00
|
|
|
github_com_docker_swarmkit_api_deepcopy.Copy(m.Secrets[i], o.Secrets[i])
|
2017-04-17 18:08:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if o.Resources != nil {
|
|
|
|
m.Resources = make([]*Resource, len(o.Resources))
|
|
|
|
for i := range m.Resources {
|
|
|
|
m.Resources[i] = &Resource{}
|
2020-02-12 12:00:03 -05:00
|
|
|
github_com_docker_swarmkit_api_deepcopy.Copy(m.Resources[i], o.Resources[i])
|
2017-04-17 18:08:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if o.Extensions != nil {
|
|
|
|
m.Extensions = make([]*Extension, len(o.Extensions))
|
|
|
|
for i := range m.Extensions {
|
|
|
|
m.Extensions[i] = &Extension{}
|
2020-02-12 12:00:03 -05:00
|
|
|
github_com_docker_swarmkit_api_deepcopy.Copy(m.Extensions[i], o.Extensions[i])
|
2017-04-17 18:08:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if o.Configs != nil {
|
|
|
|
m.Configs = make([]*Config, len(o.Configs))
|
|
|
|
for i := range m.Configs {
|
|
|
|
m.Configs[i] = &Config{}
|
2020-02-12 12:00:03 -05:00
|
|
|
github_com_docker_swarmkit_api_deepcopy.Copy(m.Configs[i], o.Configs[i])
|
2017-04-17 18:08:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *ClusterSnapshot) Copy() *ClusterSnapshot {
|
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
o := &ClusterSnapshot{}
|
|
|
|
o.CopyFrom(m)
|
|
|
|
return o
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *ClusterSnapshot) CopyFrom(src interface{}) {
|
|
|
|
|
|
|
|
o := src.(*ClusterSnapshot)
|
|
|
|
*m = *o
|
|
|
|
if o.Members != nil {
|
|
|
|
m.Members = make([]*RaftMember, len(o.Members))
|
|
|
|
for i := range m.Members {
|
|
|
|
m.Members[i] = &RaftMember{}
|
2020-02-12 12:00:03 -05:00
|
|
|
github_com_docker_swarmkit_api_deepcopy.Copy(m.Members[i], o.Members[i])
|
2017-04-17 18:08:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if o.Removed != nil {
|
|
|
|
m.Removed = make([]uint64, len(o.Removed))
|
|
|
|
copy(m.Removed, o.Removed)
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *Snapshot) Copy() *Snapshot {
|
|
|
|
if m == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
o := &Snapshot{}
|
|
|
|
o.CopyFrom(m)
|
|
|
|
return o
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *Snapshot) CopyFrom(src interface{}) {
|
|
|
|
|
|
|
|
o := src.(*Snapshot)
|
|
|
|
*m = *o
|
2020-02-12 12:00:03 -05:00
|
|
|
github_com_docker_swarmkit_api_deepcopy.Copy(&m.Membership, &o.Membership)
|
|
|
|
github_com_docker_swarmkit_api_deepcopy.Copy(&m.Store, &o.Store)
|
2017-04-17 18:08:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
func (m *StoreSnapshot) Marshal() (dAtA []byte, err error) {
|
|
|
|
size := m.Size()
|
|
|
|
dAtA = make([]byte, size)
|
2021-06-21 11:11:02 -04:00
|
|
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
2017-04-17 18:08:24 -04:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return dAtA[:n], nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *StoreSnapshot) MarshalTo(dAtA []byte) (int, error) {
|
2021-06-21 11:11:02 -04:00
|
|
|
size := m.Size()
|
|
|
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *StoreSnapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
|
|
i := len(dAtA)
|
2017-04-17 18:08:24 -04:00
|
|
|
_ = i
|
|
|
|
var l int
|
|
|
|
_ = l
|
2021-06-21 11:11:02 -04:00
|
|
|
if len(m.Configs) > 0 {
|
|
|
|
for iNdEx := len(m.Configs) - 1; iNdEx >= 0; iNdEx-- {
|
|
|
|
{
|
|
|
|
size, err := m.Configs[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
|
|
|
i -= size
|
|
|
|
i = encodeVarintSnapshot(dAtA, i, uint64(size))
|
2017-04-17 18:08:24 -04:00
|
|
|
}
|
2021-06-21 11:11:02 -04:00
|
|
|
i--
|
|
|
|
dAtA[i] = 0x4a
|
2017-04-17 18:08:24 -04:00
|
|
|
}
|
|
|
|
}
|
2021-06-21 11:11:02 -04:00
|
|
|
if len(m.Extensions) > 0 {
|
|
|
|
for iNdEx := len(m.Extensions) - 1; iNdEx >= 0; iNdEx-- {
|
|
|
|
{
|
|
|
|
size, err := m.Extensions[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
|
|
|
i -= size
|
|
|
|
i = encodeVarintSnapshot(dAtA, i, uint64(size))
|
2017-04-17 18:08:24 -04:00
|
|
|
}
|
2021-06-21 11:11:02 -04:00
|
|
|
i--
|
|
|
|
dAtA[i] = 0x42
|
2017-04-17 18:08:24 -04:00
|
|
|
}
|
|
|
|
}
|
2021-06-21 11:11:02 -04:00
|
|
|
if len(m.Resources) > 0 {
|
|
|
|
for iNdEx := len(m.Resources) - 1; iNdEx >= 0; iNdEx-- {
|
|
|
|
{
|
|
|
|
size, err := m.Resources[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
|
|
|
i -= size
|
|
|
|
i = encodeVarintSnapshot(dAtA, i, uint64(size))
|
2017-04-17 18:08:24 -04:00
|
|
|
}
|
2021-06-21 11:11:02 -04:00
|
|
|
i--
|
|
|
|
dAtA[i] = 0x3a
|
2017-04-17 18:08:24 -04:00
|
|
|
}
|
|
|
|
}
|
2021-06-21 11:11:02 -04:00
|
|
|
if len(m.Secrets) > 0 {
|
|
|
|
for iNdEx := len(m.Secrets) - 1; iNdEx >= 0; iNdEx-- {
|
|
|
|
{
|
|
|
|
size, err := m.Secrets[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
|
|
|
i -= size
|
|
|
|
i = encodeVarintSnapshot(dAtA, i, uint64(size))
|
2017-04-17 18:08:24 -04:00
|
|
|
}
|
2021-06-21 11:11:02 -04:00
|
|
|
i--
|
|
|
|
dAtA[i] = 0x32
|
2017-04-17 18:08:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if len(m.Clusters) > 0 {
|
2021-06-21 11:11:02 -04:00
|
|
|
for iNdEx := len(m.Clusters) - 1; iNdEx >= 0; iNdEx-- {
|
|
|
|
{
|
|
|
|
size, err := m.Clusters[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
|
|
|
i -= size
|
|
|
|
i = encodeVarintSnapshot(dAtA, i, uint64(size))
|
2017-04-17 18:08:24 -04:00
|
|
|
}
|
2021-06-21 11:11:02 -04:00
|
|
|
i--
|
|
|
|
dAtA[i] = 0x2a
|
2017-04-17 18:08:24 -04:00
|
|
|
}
|
|
|
|
}
|
2021-06-21 11:11:02 -04:00
|
|
|
if len(m.Tasks) > 0 {
|
|
|
|
for iNdEx := len(m.Tasks) - 1; iNdEx >= 0; iNdEx-- {
|
|
|
|
{
|
|
|
|
size, err := m.Tasks[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
|
|
|
i -= size
|
|
|
|
i = encodeVarintSnapshot(dAtA, i, uint64(size))
|
2017-04-17 18:08:24 -04:00
|
|
|
}
|
2021-06-21 11:11:02 -04:00
|
|
|
i--
|
|
|
|
dAtA[i] = 0x22
|
2017-04-17 18:08:24 -04:00
|
|
|
}
|
|
|
|
}
|
2021-06-21 11:11:02 -04:00
|
|
|
if len(m.Networks) > 0 {
|
|
|
|
for iNdEx := len(m.Networks) - 1; iNdEx >= 0; iNdEx-- {
|
|
|
|
{
|
|
|
|
size, err := m.Networks[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
|
|
|
i -= size
|
|
|
|
i = encodeVarintSnapshot(dAtA, i, uint64(size))
|
2017-04-17 18:08:24 -04:00
|
|
|
}
|
2021-06-21 11:11:02 -04:00
|
|
|
i--
|
|
|
|
dAtA[i] = 0x1a
|
2017-04-17 18:08:24 -04:00
|
|
|
}
|
|
|
|
}
|
2021-06-21 11:11:02 -04:00
|
|
|
if len(m.Services) > 0 {
|
|
|
|
for iNdEx := len(m.Services) - 1; iNdEx >= 0; iNdEx-- {
|
|
|
|
{
|
|
|
|
size, err := m.Services[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
|
|
|
i -= size
|
|
|
|
i = encodeVarintSnapshot(dAtA, i, uint64(size))
|
2017-04-17 18:08:24 -04:00
|
|
|
}
|
2021-06-21 11:11:02 -04:00
|
|
|
i--
|
|
|
|
dAtA[i] = 0x12
|
2017-04-17 18:08:24 -04:00
|
|
|
}
|
|
|
|
}
|
2021-06-21 11:11:02 -04:00
|
|
|
if len(m.Nodes) > 0 {
|
|
|
|
for iNdEx := len(m.Nodes) - 1; iNdEx >= 0; iNdEx-- {
|
|
|
|
{
|
|
|
|
size, err := m.Nodes[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
|
|
|
i -= size
|
|
|
|
i = encodeVarintSnapshot(dAtA, i, uint64(size))
|
2017-04-17 18:08:24 -04:00
|
|
|
}
|
2021-06-21 11:11:02 -04:00
|
|
|
i--
|
|
|
|
dAtA[i] = 0xa
|
2017-04-17 18:08:24 -04:00
|
|
|
}
|
|
|
|
}
|
2021-06-21 11:11:02 -04:00
|
|
|
return len(dAtA) - i, nil
|
2017-04-17 18:08:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
func (m *ClusterSnapshot) Marshal() (dAtA []byte, err error) {
|
|
|
|
size := m.Size()
|
|
|
|
dAtA = make([]byte, size)
|
2021-06-21 11:11:02 -04:00
|
|
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
2017-04-17 18:08:24 -04:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return dAtA[:n], nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *ClusterSnapshot) MarshalTo(dAtA []byte) (int, error) {
|
2021-06-21 11:11:02 -04:00
|
|
|
size := m.Size()
|
|
|
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *ClusterSnapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
|
|
i := len(dAtA)
|
2017-04-17 18:08:24 -04:00
|
|
|
_ = i
|
|
|
|
var l int
|
|
|
|
_ = l
|
|
|
|
if len(m.Removed) > 0 {
|
2021-06-21 11:11:02 -04:00
|
|
|
for iNdEx := len(m.Removed) - 1; iNdEx >= 0; iNdEx-- {
|
|
|
|
i = encodeVarintSnapshot(dAtA, i, uint64(m.Removed[iNdEx]))
|
|
|
|
i--
|
2017-05-16 13:03:55 -04:00
|
|
|
dAtA[i] = 0x10
|
2017-04-17 18:08:24 -04:00
|
|
|
}
|
|
|
|
}
|
2021-06-21 11:11:02 -04:00
|
|
|
if len(m.Members) > 0 {
|
|
|
|
for iNdEx := len(m.Members) - 1; iNdEx >= 0; iNdEx-- {
|
|
|
|
{
|
|
|
|
size, err := m.Members[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
|
|
|
i -= size
|
|
|
|
i = encodeVarintSnapshot(dAtA, i, uint64(size))
|
|
|
|
}
|
|
|
|
i--
|
|
|
|
dAtA[i] = 0xa
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return len(dAtA) - i, nil
|
2017-04-17 18:08:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
func (m *Snapshot) Marshal() (dAtA []byte, err error) {
|
|
|
|
size := m.Size()
|
|
|
|
dAtA = make([]byte, size)
|
2021-06-21 11:11:02 -04:00
|
|
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
2017-04-17 18:08:24 -04:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return dAtA[:n], nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *Snapshot) MarshalTo(dAtA []byte) (int, error) {
|
2021-06-21 11:11:02 -04:00
|
|
|
size := m.Size()
|
|
|
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *Snapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
|
|
i := len(dAtA)
|
2017-04-17 18:08:24 -04:00
|
|
|
_ = i
|
|
|
|
var l int
|
|
|
|
_ = l
|
2021-06-21 11:11:02 -04:00
|
|
|
{
|
|
|
|
size, err := m.Store.MarshalToSizedBuffer(dAtA[:i])
|
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
|
|
|
i -= size
|
|
|
|
i = encodeVarintSnapshot(dAtA, i, uint64(size))
|
2017-04-17 18:08:24 -04:00
|
|
|
}
|
2021-06-21 11:11:02 -04:00
|
|
|
i--
|
2017-04-17 18:08:24 -04:00
|
|
|
dAtA[i] = 0x1a
|
2021-06-21 11:11:02 -04:00
|
|
|
{
|
|
|
|
size, err := m.Membership.MarshalToSizedBuffer(dAtA[:i])
|
|
|
|
if err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
|
|
|
i -= size
|
|
|
|
i = encodeVarintSnapshot(dAtA, i, uint64(size))
|
|
|
|
}
|
|
|
|
i--
|
|
|
|
dAtA[i] = 0x12
|
|
|
|
if m.Version != 0 {
|
|
|
|
i = encodeVarintSnapshot(dAtA, i, uint64(m.Version))
|
|
|
|
i--
|
|
|
|
dAtA[i] = 0x8
|
2017-04-17 18:08:24 -04:00
|
|
|
}
|
2021-06-21 11:11:02 -04:00
|
|
|
return len(dAtA) - i, nil
|
2017-04-17 18:08:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
func encodeVarintSnapshot(dAtA []byte, offset int, v uint64) int {
|
2021-06-21 11:11:02 -04:00
|
|
|
offset -= sovSnapshot(v)
|
|
|
|
base := offset
|
2017-04-17 18:08:24 -04:00
|
|
|
for v >= 1<<7 {
|
|
|
|
dAtA[offset] = uint8(v&0x7f | 0x80)
|
|
|
|
v >>= 7
|
|
|
|
offset++
|
|
|
|
}
|
|
|
|
dAtA[offset] = uint8(v)
|
2021-06-21 11:11:02 -04:00
|
|
|
return base
|
2017-04-17 18:08:24 -04:00
|
|
|
}
|
|
|
|
func (m *StoreSnapshot) Size() (n int) {
|
2020-02-12 12:00:03 -05:00
|
|
|
if m == nil {
|
|
|
|
return 0
|
|
|
|
}
|
2017-04-17 18:08:24 -04:00
|
|
|
var l int
|
|
|
|
_ = l
|
|
|
|
if len(m.Nodes) > 0 {
|
|
|
|
for _, e := range m.Nodes {
|
|
|
|
l = e.Size()
|
|
|
|
n += 1 + l + sovSnapshot(uint64(l))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if len(m.Services) > 0 {
|
|
|
|
for _, e := range m.Services {
|
|
|
|
l = e.Size()
|
|
|
|
n += 1 + l + sovSnapshot(uint64(l))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if len(m.Networks) > 0 {
|
|
|
|
for _, e := range m.Networks {
|
|
|
|
l = e.Size()
|
|
|
|
n += 1 + l + sovSnapshot(uint64(l))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if len(m.Tasks) > 0 {
|
|
|
|
for _, e := range m.Tasks {
|
|
|
|
l = e.Size()
|
|
|
|
n += 1 + l + sovSnapshot(uint64(l))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if len(m.Clusters) > 0 {
|
|
|
|
for _, e := range m.Clusters {
|
|
|
|
l = e.Size()
|
|
|
|
n += 1 + l + sovSnapshot(uint64(l))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if len(m.Secrets) > 0 {
|
|
|
|
for _, e := range m.Secrets {
|
|
|
|
l = e.Size()
|
|
|
|
n += 1 + l + sovSnapshot(uint64(l))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if len(m.Resources) > 0 {
|
|
|
|
for _, e := range m.Resources {
|
|
|
|
l = e.Size()
|
|
|
|
n += 1 + l + sovSnapshot(uint64(l))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if len(m.Extensions) > 0 {
|
|
|
|
for _, e := range m.Extensions {
|
|
|
|
l = e.Size()
|
|
|
|
n += 1 + l + sovSnapshot(uint64(l))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if len(m.Configs) > 0 {
|
|
|
|
for _, e := range m.Configs {
|
|
|
|
l = e.Size()
|
|
|
|
n += 1 + l + sovSnapshot(uint64(l))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return n
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *ClusterSnapshot) Size() (n int) {
|
2020-02-12 12:00:03 -05:00
|
|
|
if m == nil {
|
|
|
|
return 0
|
|
|
|
}
|
2017-04-17 18:08:24 -04:00
|
|
|
var l int
|
|
|
|
_ = l
|
|
|
|
if len(m.Members) > 0 {
|
|
|
|
for _, e := range m.Members {
|
|
|
|
l = e.Size()
|
|
|
|
n += 1 + l + sovSnapshot(uint64(l))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if len(m.Removed) > 0 {
|
|
|
|
for _, e := range m.Removed {
|
2017-05-16 13:03:55 -04:00
|
|
|
n += 1 + sovSnapshot(uint64(e))
|
2017-04-17 18:08:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return n
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *Snapshot) Size() (n int) {
|
2020-02-12 12:00:03 -05:00
|
|
|
if m == nil {
|
|
|
|
return 0
|
|
|
|
}
|
2017-04-17 18:08:24 -04:00
|
|
|
var l int
|
|
|
|
_ = l
|
|
|
|
if m.Version != 0 {
|
|
|
|
n += 1 + sovSnapshot(uint64(m.Version))
|
|
|
|
}
|
|
|
|
l = m.Membership.Size()
|
|
|
|
n += 1 + l + sovSnapshot(uint64(l))
|
|
|
|
l = m.Store.Size()
|
|
|
|
n += 1 + l + sovSnapshot(uint64(l))
|
|
|
|
return n
|
|
|
|
}
|
|
|
|
|
|
|
|
func sovSnapshot(x uint64) (n int) {
|
2021-06-21 11:11:02 -04:00
|
|
|
return (math_bits.Len64(x|1) + 6) / 7
|
2017-04-17 18:08:24 -04:00
|
|
|
}
|
|
|
|
func sozSnapshot(x uint64) (n int) {
|
|
|
|
return sovSnapshot(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
|
|
|
}
|
|
|
|
func (this *StoreSnapshot) String() string {
|
|
|
|
if this == nil {
|
|
|
|
return "nil"
|
|
|
|
}
|
2021-06-21 11:11:02 -04:00
|
|
|
repeatedStringForNodes := "[]*Node{"
|
|
|
|
for _, f := range this.Nodes {
|
|
|
|
repeatedStringForNodes += strings.Replace(fmt.Sprintf("%v", f), "Node", "Node", 1) + ","
|
|
|
|
}
|
|
|
|
repeatedStringForNodes += "}"
|
|
|
|
repeatedStringForServices := "[]*Service{"
|
|
|
|
for _, f := range this.Services {
|
|
|
|
repeatedStringForServices += strings.Replace(fmt.Sprintf("%v", f), "Service", "Service", 1) + ","
|
|
|
|
}
|
|
|
|
repeatedStringForServices += "}"
|
|
|
|
repeatedStringForNetworks := "[]*Network{"
|
|
|
|
for _, f := range this.Networks {
|
|
|
|
repeatedStringForNetworks += strings.Replace(fmt.Sprintf("%v", f), "Network", "Network", 1) + ","
|
|
|
|
}
|
|
|
|
repeatedStringForNetworks += "}"
|
|
|
|
repeatedStringForTasks := "[]*Task{"
|
|
|
|
for _, f := range this.Tasks {
|
|
|
|
repeatedStringForTasks += strings.Replace(fmt.Sprintf("%v", f), "Task", "Task", 1) + ","
|
|
|
|
}
|
|
|
|
repeatedStringForTasks += "}"
|
|
|
|
repeatedStringForClusters := "[]*Cluster{"
|
|
|
|
for _, f := range this.Clusters {
|
|
|
|
repeatedStringForClusters += strings.Replace(fmt.Sprintf("%v", f), "Cluster", "Cluster", 1) + ","
|
|
|
|
}
|
|
|
|
repeatedStringForClusters += "}"
|
|
|
|
repeatedStringForSecrets := "[]*Secret{"
|
|
|
|
for _, f := range this.Secrets {
|
|
|
|
repeatedStringForSecrets += strings.Replace(fmt.Sprintf("%v", f), "Secret", "Secret", 1) + ","
|
|
|
|
}
|
|
|
|
repeatedStringForSecrets += "}"
|
|
|
|
repeatedStringForResources := "[]*Resource{"
|
|
|
|
for _, f := range this.Resources {
|
|
|
|
repeatedStringForResources += strings.Replace(fmt.Sprintf("%v", f), "Resource", "Resource", 1) + ","
|
|
|
|
}
|
|
|
|
repeatedStringForResources += "}"
|
|
|
|
repeatedStringForExtensions := "[]*Extension{"
|
|
|
|
for _, f := range this.Extensions {
|
|
|
|
repeatedStringForExtensions += strings.Replace(fmt.Sprintf("%v", f), "Extension", "Extension", 1) + ","
|
|
|
|
}
|
|
|
|
repeatedStringForExtensions += "}"
|
|
|
|
repeatedStringForConfigs := "[]*Config{"
|
|
|
|
for _, f := range this.Configs {
|
|
|
|
repeatedStringForConfigs += strings.Replace(fmt.Sprintf("%v", f), "Config", "Config", 1) + ","
|
|
|
|
}
|
|
|
|
repeatedStringForConfigs += "}"
|
2017-04-17 18:08:24 -04:00
|
|
|
s := strings.Join([]string{`&StoreSnapshot{`,
|
2021-06-21 11:11:02 -04:00
|
|
|
`Nodes:` + repeatedStringForNodes + `,`,
|
|
|
|
`Services:` + repeatedStringForServices + `,`,
|
|
|
|
`Networks:` + repeatedStringForNetworks + `,`,
|
|
|
|
`Tasks:` + repeatedStringForTasks + `,`,
|
|
|
|
`Clusters:` + repeatedStringForClusters + `,`,
|
|
|
|
`Secrets:` + repeatedStringForSecrets + `,`,
|
|
|
|
`Resources:` + repeatedStringForResources + `,`,
|
|
|
|
`Extensions:` + repeatedStringForExtensions + `,`,
|
|
|
|
`Configs:` + repeatedStringForConfigs + `,`,
|
2017-04-17 18:08:24 -04:00
|
|
|
`}`,
|
|
|
|
}, "")
|
|
|
|
return s
|
|
|
|
}
|
|
|
|
func (this *ClusterSnapshot) String() string {
|
|
|
|
if this == nil {
|
|
|
|
return "nil"
|
|
|
|
}
|
2021-06-21 11:11:02 -04:00
|
|
|
repeatedStringForMembers := "[]*RaftMember{"
|
|
|
|
for _, f := range this.Members {
|
|
|
|
repeatedStringForMembers += strings.Replace(fmt.Sprintf("%v", f), "RaftMember", "RaftMember", 1) + ","
|
|
|
|
}
|
|
|
|
repeatedStringForMembers += "}"
|
2017-04-17 18:08:24 -04:00
|
|
|
s := strings.Join([]string{`&ClusterSnapshot{`,
|
2021-06-21 11:11:02 -04:00
|
|
|
`Members:` + repeatedStringForMembers + `,`,
|
2017-04-17 18:08:24 -04:00
|
|
|
`Removed:` + fmt.Sprintf("%v", this.Removed) + `,`,
|
|
|
|
`}`,
|
|
|
|
}, "")
|
|
|
|
return s
|
|
|
|
}
|
|
|
|
func (this *Snapshot) String() string {
|
|
|
|
if this == nil {
|
|
|
|
return "nil"
|
|
|
|
}
|
|
|
|
s := strings.Join([]string{`&Snapshot{`,
|
|
|
|
`Version:` + fmt.Sprintf("%v", this.Version) + `,`,
|
|
|
|
`Membership:` + strings.Replace(strings.Replace(this.Membership.String(), "ClusterSnapshot", "ClusterSnapshot", 1), `&`, ``, 1) + `,`,
|
|
|
|
`Store:` + strings.Replace(strings.Replace(this.Store.String(), "StoreSnapshot", "StoreSnapshot", 1), `&`, ``, 1) + `,`,
|
|
|
|
`}`,
|
|
|
|
}, "")
|
|
|
|
return s
|
|
|
|
}
|
|
|
|
func valueToStringSnapshot(v interface{}) string {
|
|
|
|
rv := reflect.ValueOf(v)
|
|
|
|
if rv.IsNil() {
|
|
|
|
return "nil"
|
|
|
|
}
|
|
|
|
pv := reflect.Indirect(rv).Interface()
|
|
|
|
return fmt.Sprintf("*%v", pv)
|
|
|
|
}
|
|
|
|
func (m *StoreSnapshot) Unmarshal(dAtA []byte) error {
|
|
|
|
l := len(dAtA)
|
|
|
|
iNdEx := 0
|
|
|
|
for iNdEx < l {
|
|
|
|
preIndex := iNdEx
|
|
|
|
var wire uint64
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowSnapshot
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
2020-02-12 12:00:03 -05:00
|
|
|
wire |= uint64(b&0x7F) << shift
|
2017-04-17 18:08:24 -04:00
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fieldNum := int32(wire >> 3)
|
|
|
|
wireType := int(wire & 0x7)
|
|
|
|
if wireType == 4 {
|
|
|
|
return fmt.Errorf("proto: StoreSnapshot: wiretype end group for non-group")
|
|
|
|
}
|
|
|
|
if fieldNum <= 0 {
|
|
|
|
return fmt.Errorf("proto: StoreSnapshot: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
|
|
}
|
|
|
|
switch fieldNum {
|
|
|
|
case 1:
|
|
|
|
if wireType != 2 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Nodes", wireType)
|
|
|
|
}
|
|
|
|
var msglen int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowSnapshot
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
2020-02-12 12:00:03 -05:00
|
|
|
msglen |= int(b&0x7F) << shift
|
2017-04-17 18:08:24 -04:00
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if msglen < 0 {
|
|
|
|
return ErrInvalidLengthSnapshot
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + msglen
|
2020-02-12 12:00:03 -05:00
|
|
|
if postIndex < 0 {
|
|
|
|
return ErrInvalidLengthSnapshot
|
|
|
|
}
|
2017-04-17 18:08:24 -04:00
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
m.Nodes = append(m.Nodes, &Node{})
|
|
|
|
if err := m.Nodes[len(m.Nodes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
iNdEx = postIndex
|
|
|
|
case 2:
|
|
|
|
if wireType != 2 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Services", wireType)
|
|
|
|
}
|
|
|
|
var msglen int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowSnapshot
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
2020-02-12 12:00:03 -05:00
|
|
|
msglen |= int(b&0x7F) << shift
|
2017-04-17 18:08:24 -04:00
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if msglen < 0 {
|
|
|
|
return ErrInvalidLengthSnapshot
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + msglen
|
2020-02-12 12:00:03 -05:00
|
|
|
if postIndex < 0 {
|
|
|
|
return ErrInvalidLengthSnapshot
|
|
|
|
}
|
2017-04-17 18:08:24 -04:00
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
m.Services = append(m.Services, &Service{})
|
|
|
|
if err := m.Services[len(m.Services)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
iNdEx = postIndex
|
|
|
|
case 3:
|
|
|
|
if wireType != 2 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Networks", wireType)
|
|
|
|
}
|
|
|
|
var msglen int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowSnapshot
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
2020-02-12 12:00:03 -05:00
|
|
|
msglen |= int(b&0x7F) << shift
|
2017-04-17 18:08:24 -04:00
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if msglen < 0 {
|
|
|
|
return ErrInvalidLengthSnapshot
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + msglen
|
2020-02-12 12:00:03 -05:00
|
|
|
if postIndex < 0 {
|
|
|
|
return ErrInvalidLengthSnapshot
|
|
|
|
}
|
2017-04-17 18:08:24 -04:00
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
m.Networks = append(m.Networks, &Network{})
|
|
|
|
if err := m.Networks[len(m.Networks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
iNdEx = postIndex
|
|
|
|
case 4:
|
|
|
|
if wireType != 2 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Tasks", wireType)
|
|
|
|
}
|
|
|
|
var msglen int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowSnapshot
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
2020-02-12 12:00:03 -05:00
|
|
|
msglen |= int(b&0x7F) << shift
|
2017-04-17 18:08:24 -04:00
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if msglen < 0 {
|
|
|
|
return ErrInvalidLengthSnapshot
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + msglen
|
2020-02-12 12:00:03 -05:00
|
|
|
if postIndex < 0 {
|
|
|
|
return ErrInvalidLengthSnapshot
|
|
|
|
}
|
2017-04-17 18:08:24 -04:00
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
m.Tasks = append(m.Tasks, &Task{})
|
|
|
|
if err := m.Tasks[len(m.Tasks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
iNdEx = postIndex
|
|
|
|
case 5:
|
|
|
|
if wireType != 2 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Clusters", wireType)
|
|
|
|
}
|
|
|
|
var msglen int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowSnapshot
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
2020-02-12 12:00:03 -05:00
|
|
|
msglen |= int(b&0x7F) << shift
|
2017-04-17 18:08:24 -04:00
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if msglen < 0 {
|
|
|
|
return ErrInvalidLengthSnapshot
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + msglen
|
2020-02-12 12:00:03 -05:00
|
|
|
if postIndex < 0 {
|
|
|
|
return ErrInvalidLengthSnapshot
|
|
|
|
}
|
2017-04-17 18:08:24 -04:00
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
m.Clusters = append(m.Clusters, &Cluster{})
|
|
|
|
if err := m.Clusters[len(m.Clusters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
iNdEx = postIndex
|
|
|
|
case 6:
|
|
|
|
if wireType != 2 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Secrets", wireType)
|
|
|
|
}
|
|
|
|
var msglen int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowSnapshot
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
2020-02-12 12:00:03 -05:00
|
|
|
msglen |= int(b&0x7F) << shift
|
2017-04-17 18:08:24 -04:00
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if msglen < 0 {
|
|
|
|
return ErrInvalidLengthSnapshot
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + msglen
|
2020-02-12 12:00:03 -05:00
|
|
|
if postIndex < 0 {
|
|
|
|
return ErrInvalidLengthSnapshot
|
|
|
|
}
|
2017-04-17 18:08:24 -04:00
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
m.Secrets = append(m.Secrets, &Secret{})
|
|
|
|
if err := m.Secrets[len(m.Secrets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
iNdEx = postIndex
|
|
|
|
case 7:
|
|
|
|
if wireType != 2 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType)
|
|
|
|
}
|
|
|
|
var msglen int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowSnapshot
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
2020-02-12 12:00:03 -05:00
|
|
|
msglen |= int(b&0x7F) << shift
|
2017-04-17 18:08:24 -04:00
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if msglen < 0 {
|
|
|
|
return ErrInvalidLengthSnapshot
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + msglen
|
2020-02-12 12:00:03 -05:00
|
|
|
if postIndex < 0 {
|
|
|
|
return ErrInvalidLengthSnapshot
|
|
|
|
}
|
2017-04-17 18:08:24 -04:00
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
m.Resources = append(m.Resources, &Resource{})
|
|
|
|
if err := m.Resources[len(m.Resources)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
iNdEx = postIndex
|
|
|
|
case 8:
|
|
|
|
if wireType != 2 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Extensions", wireType)
|
|
|
|
}
|
|
|
|
var msglen int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowSnapshot
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
2020-02-12 12:00:03 -05:00
|
|
|
msglen |= int(b&0x7F) << shift
|
2017-04-17 18:08:24 -04:00
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if msglen < 0 {
|
|
|
|
return ErrInvalidLengthSnapshot
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + msglen
|
2020-02-12 12:00:03 -05:00
|
|
|
if postIndex < 0 {
|
|
|
|
return ErrInvalidLengthSnapshot
|
|
|
|
}
|
2017-04-17 18:08:24 -04:00
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
m.Extensions = append(m.Extensions, &Extension{})
|
|
|
|
if err := m.Extensions[len(m.Extensions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
iNdEx = postIndex
|
|
|
|
case 9:
|
|
|
|
if wireType != 2 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Configs", wireType)
|
|
|
|
}
|
|
|
|
var msglen int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowSnapshot
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
2020-02-12 12:00:03 -05:00
|
|
|
msglen |= int(b&0x7F) << shift
|
2017-04-17 18:08:24 -04:00
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if msglen < 0 {
|
|
|
|
return ErrInvalidLengthSnapshot
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + msglen
|
2020-02-12 12:00:03 -05:00
|
|
|
if postIndex < 0 {
|
|
|
|
return ErrInvalidLengthSnapshot
|
|
|
|
}
|
2017-04-17 18:08:24 -04:00
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
m.Configs = append(m.Configs, &Config{})
|
|
|
|
if err := m.Configs[len(m.Configs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
iNdEx = postIndex
|
|
|
|
default:
|
|
|
|
iNdEx = preIndex
|
|
|
|
skippy, err := skipSnapshot(dAtA[iNdEx:])
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2021-06-21 11:11:02 -04:00
|
|
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
2020-02-12 12:00:03 -05:00
|
|
|
return ErrInvalidLengthSnapshot
|
|
|
|
}
|
2017-04-17 18:08:24 -04:00
|
|
|
if (iNdEx + skippy) > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
iNdEx += skippy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if iNdEx > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
func (m *ClusterSnapshot) Unmarshal(dAtA []byte) error {
|
|
|
|
l := len(dAtA)
|
|
|
|
iNdEx := 0
|
|
|
|
for iNdEx < l {
|
|
|
|
preIndex := iNdEx
|
|
|
|
var wire uint64
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowSnapshot
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
2020-02-12 12:00:03 -05:00
|
|
|
wire |= uint64(b&0x7F) << shift
|
2017-04-17 18:08:24 -04:00
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fieldNum := int32(wire >> 3)
|
|
|
|
wireType := int(wire & 0x7)
|
|
|
|
if wireType == 4 {
|
|
|
|
return fmt.Errorf("proto: ClusterSnapshot: wiretype end group for non-group")
|
|
|
|
}
|
|
|
|
if fieldNum <= 0 {
|
|
|
|
return fmt.Errorf("proto: ClusterSnapshot: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
|
|
}
|
|
|
|
switch fieldNum {
|
|
|
|
case 1:
|
|
|
|
if wireType != 2 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Members", wireType)
|
|
|
|
}
|
|
|
|
var msglen int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowSnapshot
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
2020-02-12 12:00:03 -05:00
|
|
|
msglen |= int(b&0x7F) << shift
|
2017-04-17 18:08:24 -04:00
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if msglen < 0 {
|
|
|
|
return ErrInvalidLengthSnapshot
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + msglen
|
2020-02-12 12:00:03 -05:00
|
|
|
if postIndex < 0 {
|
|
|
|
return ErrInvalidLengthSnapshot
|
|
|
|
}
|
2017-04-17 18:08:24 -04:00
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
m.Members = append(m.Members, &RaftMember{})
|
|
|
|
if err := m.Members[len(m.Members)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
iNdEx = postIndex
|
|
|
|
case 2:
|
2017-05-16 13:03:55 -04:00
|
|
|
if wireType == 0 {
|
|
|
|
var v uint64
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowSnapshot
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
2020-02-12 12:00:03 -05:00
|
|
|
v |= uint64(b&0x7F) << shift
|
2017-05-16 13:03:55 -04:00
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
m.Removed = append(m.Removed, v)
|
|
|
|
} else if wireType == 2 {
|
2017-04-17 18:08:24 -04:00
|
|
|
var packedLen int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowSnapshot
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
2020-02-12 12:00:03 -05:00
|
|
|
packedLen |= int(b&0x7F) << shift
|
2017-04-17 18:08:24 -04:00
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if packedLen < 0 {
|
|
|
|
return ErrInvalidLengthSnapshot
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + packedLen
|
2020-02-12 12:00:03 -05:00
|
|
|
if postIndex < 0 {
|
|
|
|
return ErrInvalidLengthSnapshot
|
|
|
|
}
|
2017-04-17 18:08:24 -04:00
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
2020-02-12 12:00:03 -05:00
|
|
|
var elementCount int
|
|
|
|
var count int
|
|
|
|
for _, integer := range dAtA[iNdEx:postIndex] {
|
|
|
|
if integer < 128 {
|
|
|
|
count++
|
|
|
|
}
|
|
|
|
}
|
|
|
|
elementCount = count
|
|
|
|
if elementCount != 0 && len(m.Removed) == 0 {
|
|
|
|
m.Removed = make([]uint64, 0, elementCount)
|
|
|
|
}
|
2017-04-17 18:08:24 -04:00
|
|
|
for iNdEx < postIndex {
|
|
|
|
var v uint64
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowSnapshot
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
2020-02-12 12:00:03 -05:00
|
|
|
v |= uint64(b&0x7F) << shift
|
2017-04-17 18:08:24 -04:00
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
m.Removed = append(m.Removed, v)
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Removed", wireType)
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
iNdEx = preIndex
|
|
|
|
skippy, err := skipSnapshot(dAtA[iNdEx:])
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2021-06-21 11:11:02 -04:00
|
|
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
2020-02-12 12:00:03 -05:00
|
|
|
return ErrInvalidLengthSnapshot
|
|
|
|
}
|
2017-04-17 18:08:24 -04:00
|
|
|
if (iNdEx + skippy) > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
iNdEx += skippy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if iNdEx > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
func (m *Snapshot) Unmarshal(dAtA []byte) error {
|
|
|
|
l := len(dAtA)
|
|
|
|
iNdEx := 0
|
|
|
|
for iNdEx < l {
|
|
|
|
preIndex := iNdEx
|
|
|
|
var wire uint64
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowSnapshot
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
2020-02-12 12:00:03 -05:00
|
|
|
wire |= uint64(b&0x7F) << shift
|
2017-04-17 18:08:24 -04:00
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fieldNum := int32(wire >> 3)
|
|
|
|
wireType := int(wire & 0x7)
|
|
|
|
if wireType == 4 {
|
|
|
|
return fmt.Errorf("proto: Snapshot: wiretype end group for non-group")
|
|
|
|
}
|
|
|
|
if fieldNum <= 0 {
|
|
|
|
return fmt.Errorf("proto: Snapshot: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
|
|
}
|
|
|
|
switch fieldNum {
|
|
|
|
case 1:
|
|
|
|
if wireType != 0 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType)
|
|
|
|
}
|
|
|
|
m.Version = 0
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowSnapshot
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
2020-02-12 12:00:03 -05:00
|
|
|
m.Version |= Snapshot_Version(b&0x7F) << shift
|
2017-04-17 18:08:24 -04:00
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case 2:
|
|
|
|
if wireType != 2 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Membership", wireType)
|
|
|
|
}
|
|
|
|
var msglen int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowSnapshot
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
2020-02-12 12:00:03 -05:00
|
|
|
msglen |= int(b&0x7F) << shift
|
2017-04-17 18:08:24 -04:00
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if msglen < 0 {
|
|
|
|
return ErrInvalidLengthSnapshot
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + msglen
|
2020-02-12 12:00:03 -05:00
|
|
|
if postIndex < 0 {
|
|
|
|
return ErrInvalidLengthSnapshot
|
|
|
|
}
|
2017-04-17 18:08:24 -04:00
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
if err := m.Membership.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
iNdEx = postIndex
|
|
|
|
case 3:
|
|
|
|
if wireType != 2 {
|
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Store", wireType)
|
|
|
|
}
|
|
|
|
var msglen int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return ErrIntOverflowSnapshot
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
2020-02-12 12:00:03 -05:00
|
|
|
msglen |= int(b&0x7F) << shift
|
2017-04-17 18:08:24 -04:00
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if msglen < 0 {
|
|
|
|
return ErrInvalidLengthSnapshot
|
|
|
|
}
|
|
|
|
postIndex := iNdEx + msglen
|
2020-02-12 12:00:03 -05:00
|
|
|
if postIndex < 0 {
|
|
|
|
return ErrInvalidLengthSnapshot
|
|
|
|
}
|
2017-04-17 18:08:24 -04:00
|
|
|
if postIndex > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
if err := m.Store.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
iNdEx = postIndex
|
|
|
|
default:
|
|
|
|
iNdEx = preIndex
|
|
|
|
skippy, err := skipSnapshot(dAtA[iNdEx:])
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2021-06-21 11:11:02 -04:00
|
|
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
2020-02-12 12:00:03 -05:00
|
|
|
return ErrInvalidLengthSnapshot
|
|
|
|
}
|
2017-04-17 18:08:24 -04:00
|
|
|
if (iNdEx + skippy) > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
iNdEx += skippy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if iNdEx > l {
|
|
|
|
return io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
func skipSnapshot(dAtA []byte) (n int, err error) {
|
|
|
|
l := len(dAtA)
|
|
|
|
iNdEx := 0
|
2021-06-21 11:11:02 -04:00
|
|
|
depth := 0
|
2017-04-17 18:08:24 -04:00
|
|
|
for iNdEx < l {
|
|
|
|
var wire uint64
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return 0, ErrIntOverflowSnapshot
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return 0, io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
wire |= (uint64(b) & 0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
wireType := int(wire & 0x7)
|
|
|
|
switch wireType {
|
|
|
|
case 0:
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return 0, ErrIntOverflowSnapshot
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return 0, io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
iNdEx++
|
|
|
|
if dAtA[iNdEx-1] < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case 1:
|
|
|
|
iNdEx += 8
|
|
|
|
case 2:
|
|
|
|
var length int
|
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
|
if shift >= 64 {
|
|
|
|
return 0, ErrIntOverflowSnapshot
|
|
|
|
}
|
|
|
|
if iNdEx >= l {
|
|
|
|
return 0, io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
b := dAtA[iNdEx]
|
|
|
|
iNdEx++
|
|
|
|
length |= (int(b) & 0x7F) << shift
|
|
|
|
if b < 0x80 {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if length < 0 {
|
|
|
|
return 0, ErrInvalidLengthSnapshot
|
|
|
|
}
|
2020-02-12 12:00:03 -05:00
|
|
|
iNdEx += length
|
2017-04-17 18:08:24 -04:00
|
|
|
case 3:
|
2021-06-21 11:11:02 -04:00
|
|
|
depth++
|
2017-04-17 18:08:24 -04:00
|
|
|
case 4:
|
2021-06-21 11:11:02 -04:00
|
|
|
if depth == 0 {
|
|
|
|
return 0, ErrUnexpectedEndOfGroupSnapshot
|
|
|
|
}
|
|
|
|
depth--
|
2017-04-17 18:08:24 -04:00
|
|
|
case 5:
|
|
|
|
iNdEx += 4
|
|
|
|
default:
|
|
|
|
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
|
|
|
}
|
2021-06-21 11:11:02 -04:00
|
|
|
if iNdEx < 0 {
|
|
|
|
return 0, ErrInvalidLengthSnapshot
|
|
|
|
}
|
|
|
|
if depth == 0 {
|
|
|
|
return iNdEx, nil
|
|
|
|
}
|
2017-04-17 18:08:24 -04:00
|
|
|
}
|
2021-06-21 11:11:02 -04:00
|
|
|
return 0, io.ErrUnexpectedEOF
|
2017-04-17 18:08:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
var (
|
2021-06-21 11:11:02 -04:00
|
|
|
ErrInvalidLengthSnapshot = fmt.Errorf("proto: negative length found during unmarshaling")
|
|
|
|
ErrIntOverflowSnapshot = fmt.Errorf("proto: integer overflow")
|
|
|
|
ErrUnexpectedEndOfGroupSnapshot = fmt.Errorf("proto: unexpected end of group")
|
2017-04-17 18:08:24 -04:00
|
|
|
)
|