diff --git a/vendor.conf b/vendor.conf index 9937745fe5..6922c49e54 100755 --- a/vendor.conf +++ b/vendor.conf @@ -20,7 +20,7 @@ github.com/docker/go-connections 7395e3f8aa162843a74ed6d48e79 github.com/docker/go-events e31b211e4f1cd09aa76fe4ac244571fab96ae47f github.com/docker/go-metrics b619b3592b65de4f087d9f16863a7e6ff905973c # v0.0.1 github.com/docker/go-units 519db1ee28dcc9fd2474ae59fca29a810482bfb1 # v0.4.0 -github.com/docker/swarmkit 17d8d4e4d8bdec33d386e6362d3537fa9493ba00 +github.com/docker/swarmkit 2dcf70aafdc9ea55af3aaaeca440638cde0ecda6 # master github.com/evanphx/json-patch 72bf35d0ff611848c1dc9df0f976c81192392fa5 # v4.1.0 github.com/fvbommel/sortorder 26fad50c6b32a3064c09ed089865c16f2f3615f6 # v1.0.2 github.com/gofrs/flock 6caa7350c26b838538005fae7dbee4e69d9398db # v0.7.3 diff --git a/vendor/github.com/docker/swarmkit/api/ca.pb.go b/vendor/github.com/docker/swarmkit/api/ca.pb.go index d5a7fd9f4d..e37dbc97a2 100644 --- a/vendor/github.com/docker/swarmkit/api/ca.pb.go +++ b/vendor/github.com/docker/swarmkit/api/ca.pb.go @@ -18,6 +18,7 @@ import ( status "google.golang.org/grpc/status" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" rafttime "time" @@ -32,7 +33,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type NodeCertificateStatusRequest struct { NodeID string `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` @@ -51,7 +52,7 @@ func (m *NodeCertificateStatusRequest) XXX_Marshal(b []byte, deterministic bool) return xxx_messageInfo_NodeCertificateStatusRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -88,7 +89,7 @@ func (m *NodeCertificateStatusResponse) XXX_Marshal(b []byte, deterministic bool return xxx_messageInfo_NodeCertificateStatusResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -132,7 +133,7 @@ func (m *IssueNodeCertificateRequest) XXX_Marshal(b []byte, deterministic bool) return xxx_messageInfo_IssueNodeCertificateRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -169,7 +170,7 @@ func (m *IssueNodeCertificateResponse) XXX_Marshal(b []byte, deterministic bool) return xxx_messageInfo_IssueNodeCertificateResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -204,7 +205,7 @@ func (m *GetRootCACertificateRequest) XXX_Marshal(b []byte, deterministic bool) return xxx_messageInfo_GetRootCACertificateRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -240,7 +241,7 @@ func (m *GetRootCACertificateResponse) XXX_Marshal(b []byte, deterministic bool) return xxx_messageInfo_GetRootCACertificateResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -275,7 +276,7 @@ func (m *GetUnlockKeyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_GetUnlockKeyRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -312,7 +313,7 @@ func (m *GetUnlockKeyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_GetUnlockKeyResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -621,6 +622,17 @@ type CAServer interface { GetUnlockKey(context.Context, *GetUnlockKeyRequest) (*GetUnlockKeyResponse, error) } +// UnimplementedCAServer can be embedded to have forward compatible implementations. +type UnimplementedCAServer struct { +} + +func (*UnimplementedCAServer) GetRootCACertificate(ctx context.Context, req *GetRootCACertificateRequest) (*GetRootCACertificateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetRootCACertificate not implemented") +} +func (*UnimplementedCAServer) GetUnlockKey(ctx context.Context, req *GetUnlockKeyRequest) (*GetUnlockKeyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetUnlockKey not implemented") +} + func RegisterCAServer(s *grpc.Server, srv CAServer) { s.RegisterService(&_CA_serviceDesc, srv) } @@ -718,6 +730,17 @@ type NodeCAServer interface { NodeCertificateStatus(context.Context, *NodeCertificateStatusRequest) (*NodeCertificateStatusResponse, error) } +// UnimplementedNodeCAServer can be embedded to have forward compatible implementations. +type UnimplementedNodeCAServer struct { +} + +func (*UnimplementedNodeCAServer) IssueNodeCertificate(ctx context.Context, req *IssueNodeCertificateRequest) (*IssueNodeCertificateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method IssueNodeCertificate not implemented") +} +func (*UnimplementedNodeCAServer) NodeCertificateStatus(ctx context.Context, req *NodeCertificateStatusRequest) (*NodeCertificateStatusResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method NodeCertificateStatus not implemented") +} + func RegisterNodeCAServer(s *grpc.Server, srv NodeCAServer) { s.RegisterService(&_NodeCA_serviceDesc, srv) } @@ -778,7 +801,7 @@ var _NodeCA_serviceDesc = grpc.ServiceDesc{ func (m *NodeCertificateStatusRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -786,23 +809,29 @@ func (m *NodeCertificateStatusRequest) Marshal() (dAtA []byte, err error) { } func (m *NodeCertificateStatusRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NodeCertificateStatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.NodeID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.NodeID) + copy(dAtA[i:], m.NodeID) i = encodeVarintCa(dAtA, i, uint64(len(m.NodeID))) - i += copy(dAtA[i:], m.NodeID) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *NodeCertificateStatusResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -810,37 +839,46 @@ func (m *NodeCertificateStatusResponse) Marshal() (dAtA []byte, err error) { } func (m *NodeCertificateStatusResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NodeCertificateStatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Status != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintCa(dAtA, i, uint64(m.Status.Size())) - n1, err := m.Status.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 - } if m.Certificate != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintCa(dAtA, i, uint64(m.Certificate.Size())) - n2, err := m.Certificate.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Certificate.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCa(dAtA, i, uint64(size)) } - i += n2 + i-- + dAtA[i] = 0x12 } - return i, nil + if m.Status != nil { + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCa(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *IssueNodeCertificateRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -848,39 +886,46 @@ func (m *IssueNodeCertificateRequest) Marshal() (dAtA []byte, err error) { } func (m *IssueNodeCertificateRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IssueNodeCertificateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Role != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintCa(dAtA, i, uint64(m.Role)) - } - if len(m.CSR) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintCa(dAtA, i, uint64(len(m.CSR))) - i += copy(dAtA[i:], m.CSR) + if m.Availability != 0 { + i = encodeVarintCa(dAtA, i, uint64(m.Availability)) + i-- + dAtA[i] = 0x20 } if len(m.Token) > 0 { - dAtA[i] = 0x1a - i++ + i -= len(m.Token) + copy(dAtA[i:], m.Token) i = encodeVarintCa(dAtA, i, uint64(len(m.Token))) - i += copy(dAtA[i:], m.Token) + i-- + dAtA[i] = 0x1a } - if m.Availability != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintCa(dAtA, i, uint64(m.Availability)) + if len(m.CSR) > 0 { + i -= len(m.CSR) + copy(dAtA[i:], m.CSR) + i = encodeVarintCa(dAtA, i, uint64(len(m.CSR))) + i-- + dAtA[i] = 0x12 } - return i, nil + if m.Role != 0 { + i = encodeVarintCa(dAtA, i, uint64(m.Role)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *IssueNodeCertificateResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -888,28 +933,34 @@ func (m *IssueNodeCertificateResponse) Marshal() (dAtA []byte, err error) { } func (m *IssueNodeCertificateResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IssueNodeCertificateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.NodeID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintCa(dAtA, i, uint64(len(m.NodeID))) - i += copy(dAtA[i:], m.NodeID) - } if m.NodeMembership != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintCa(dAtA, i, uint64(m.NodeMembership)) + i-- + dAtA[i] = 0x10 } - return i, nil + if len(m.NodeID) > 0 { + i -= len(m.NodeID) + copy(dAtA[i:], m.NodeID) + i = encodeVarintCa(dAtA, i, uint64(len(m.NodeID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *GetRootCACertificateRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -917,17 +968,22 @@ func (m *GetRootCACertificateRequest) Marshal() (dAtA []byte, err error) { } func (m *GetRootCACertificateRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetRootCACertificateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + return len(dAtA) - i, nil } func (m *GetRootCACertificateResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -935,23 +991,29 @@ func (m *GetRootCACertificateResponse) Marshal() (dAtA []byte, err error) { } func (m *GetRootCACertificateResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetRootCACertificateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Certificate) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.Certificate) + copy(dAtA[i:], m.Certificate) i = encodeVarintCa(dAtA, i, uint64(len(m.Certificate))) - i += copy(dAtA[i:], m.Certificate) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetUnlockKeyRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -959,17 +1021,22 @@ func (m *GetUnlockKeyRequest) Marshal() (dAtA []byte, err error) { } func (m *GetUnlockKeyRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetUnlockKeyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + return len(dAtA) - i, nil } func (m *GetUnlockKeyResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -977,35 +1044,45 @@ func (m *GetUnlockKeyResponse) Marshal() (dAtA []byte, err error) { } func (m *GetUnlockKeyResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetUnlockKeyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.UnlockKey) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintCa(dAtA, i, uint64(len(m.UnlockKey))) - i += copy(dAtA[i:], m.UnlockKey) + { + size, err := m.Version.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCa(dAtA, i, uint64(size)) } + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintCa(dAtA, i, uint64(m.Version.Size())) - n3, err := m.Version.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.UnlockKey) > 0 { + i -= len(m.UnlockKey) + copy(dAtA[i:], m.UnlockKey) + i = encodeVarintCa(dAtA, i, uint64(len(m.UnlockKey))) + i-- + dAtA[i] = 0xa } - i += n3 - return i, nil + return len(dAtA) - i, nil } func encodeVarintCa(dAtA []byte, offset int, v uint64) int { + offset -= sovCa(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } type raftProxyCAServer struct { @@ -1408,14 +1485,7 @@ func (m *GetUnlockKeyResponse) Size() (n int) { } func sovCa(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozCa(x uint64) (n int) { return sovCa(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -1499,7 +1569,7 @@ func (this *GetUnlockKeyResponse) String() string { } s := strings.Join([]string{`&GetUnlockKeyResponse{`, `UnlockKey:` + fmt.Sprintf("%v", this.UnlockKey) + `,`, - `Version:` + strings.Replace(strings.Replace(this.Version.String(), "Version", "Version", 1), `&`, ``, 1) + `,`, + `Version:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Version), "Version", "Version", 1), `&`, ``, 1) + `,`, `}`, }, "") return s @@ -1579,10 +1649,7 @@ func (m *NodeCertificateStatusRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthCa - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthCa } if (iNdEx + skippy) > l { @@ -1704,10 +1771,7 @@ func (m *NodeCertificateStatusResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthCa - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthCa } if (iNdEx + skippy) > l { @@ -1861,10 +1925,7 @@ func (m *IssueNodeCertificateRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthCa - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthCa } if (iNdEx + skippy) > l { @@ -1965,10 +2026,7 @@ func (m *IssueNodeCertificateResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthCa - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthCa } if (iNdEx + skippy) > l { @@ -2018,10 +2076,7 @@ func (m *GetRootCACertificateRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthCa - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthCa } if (iNdEx + skippy) > l { @@ -2105,10 +2160,7 @@ func (m *GetRootCACertificateResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthCa - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthCa } if (iNdEx + skippy) > l { @@ -2158,10 +2210,7 @@ func (m *GetUnlockKeyRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthCa - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthCa } if (iNdEx + skippy) > l { @@ -2278,10 +2327,7 @@ func (m *GetUnlockKeyResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthCa - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthCa } if (iNdEx + skippy) > l { @@ -2299,6 +2345,7 @@ func (m *GetUnlockKeyResponse) Unmarshal(dAtA []byte) error { func skipCa(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -2330,10 +2377,8 @@ func skipCa(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -2354,55 +2399,30 @@ func skipCa(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthCa } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthCa - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCa - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipCa(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthCa - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupCa + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthCa + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthCa = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowCa = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthCa = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowCa = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupCa = fmt.Errorf("proto: unexpected end of group") ) diff --git a/vendor/github.com/docker/swarmkit/api/control.pb.go b/vendor/github.com/docker/swarmkit/api/control.pb.go index 8c106ff16b..9268b44c2b 100644 --- a/vendor/github.com/docker/swarmkit/api/control.pb.go +++ b/vendor/github.com/docker/swarmkit/api/control.pb.go @@ -20,6 +20,7 @@ import ( status "google.golang.org/grpc/status" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" rafttime "time" @@ -34,7 +35,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type UpdateServiceRequest_Rollback int32 @@ -82,7 +83,7 @@ func (m *GetNodeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return xxx_messageInfo_GetNodeRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -118,7 +119,7 @@ func (m *GetNodeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return xxx_messageInfo_GetNodeResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -154,7 +155,7 @@ func (m *ListNodesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_ListNodesRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -200,7 +201,7 @@ func (m *ListNodesRequest_Filters) XXX_Marshal(b []byte, deterministic bool) ([] return xxx_messageInfo_ListNodesRequest_Filters.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -236,7 +237,7 @@ func (m *ListNodesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_ListNodesResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -277,7 +278,7 @@ func (m *UpdateNodeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_UpdateNodeRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -313,7 +314,7 @@ func (m *UpdateNodeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_UpdateNodeResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -351,7 +352,7 @@ func (m *RemoveNodeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_RemoveNodeRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -386,7 +387,7 @@ func (m *RemoveNodeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_RemoveNodeResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -422,7 +423,7 @@ func (m *GetTaskRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return xxx_messageInfo_GetTaskRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -458,7 +459,7 @@ func (m *GetTaskResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return xxx_messageInfo_GetTaskResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -494,7 +495,7 @@ func (m *RemoveTaskRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_RemoveTaskRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -529,7 +530,7 @@ func (m *RemoveTaskResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_RemoveTaskResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -565,7 +566,7 @@ func (m *ListTasksRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_ListTasksRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -614,7 +615,7 @@ func (m *ListTasksRequest_Filters) XXX_Marshal(b []byte, deterministic bool) ([] return xxx_messageInfo_ListTasksRequest_Filters.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -650,7 +651,7 @@ func (m *ListTasksResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_ListTasksResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -686,7 +687,7 @@ func (m *CreateServiceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_CreateServiceRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -722,7 +723,7 @@ func (m *CreateServiceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_CreateServiceResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -759,7 +760,7 @@ func (m *GetServiceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_GetServiceRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -795,7 +796,7 @@ func (m *GetServiceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_GetServiceResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -837,7 +838,7 @@ func (m *UpdateServiceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_UpdateServiceRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -873,7 +874,7 @@ func (m *UpdateServiceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_UpdateServiceResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -909,7 +910,7 @@ func (m *RemoveServiceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_RemoveServiceRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -944,7 +945,7 @@ func (m *RemoveServiceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_RemoveServiceResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -980,7 +981,7 @@ func (m *ListServicesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_ListServicesRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1021,7 +1022,7 @@ func (m *ListServicesRequest_Filters) XXX_Marshal(b []byte, deterministic bool) return xxx_messageInfo_ListServicesRequest_Filters.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1057,7 +1058,7 @@ func (m *ListServicesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_ListServicesResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1097,7 +1098,7 @@ func (m *ListServiceStatusesRequest) XXX_Marshal(b []byte, deterministic bool) ( return xxx_messageInfo_ListServiceStatusesRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1137,7 +1138,7 @@ func (m *ListServiceStatusesResponse) XXX_Marshal(b []byte, deterministic bool) return xxx_messageInfo_ListServiceStatusesResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1190,7 +1191,7 @@ func (m *ListServiceStatusesResponse_ServiceStatus) XXX_Marshal(b []byte, determ return xxx_messageInfo_ListServiceStatusesResponse_ServiceStatus.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1226,7 +1227,7 @@ func (m *CreateNetworkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_CreateNetworkRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1262,7 +1263,7 @@ func (m *CreateNetworkResponse) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_CreateNetworkResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1299,7 +1300,7 @@ func (m *GetNetworkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_GetNetworkRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1335,7 +1336,7 @@ func (m *GetNetworkResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_GetNetworkResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1372,7 +1373,7 @@ func (m *RemoveNetworkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_RemoveNetworkRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1407,7 +1408,7 @@ func (m *RemoveNetworkResponse) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_RemoveNetworkResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1443,7 +1444,7 @@ func (m *ListNetworksRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_ListNetworksRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1483,7 +1484,7 @@ func (m *ListNetworksRequest_Filters) XXX_Marshal(b []byte, deterministic bool) return xxx_messageInfo_ListNetworksRequest_Filters.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1519,7 +1520,7 @@ func (m *ListNetworksResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_ListNetworksResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1555,7 +1556,7 @@ func (m *GetClusterRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_GetClusterRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1591,7 +1592,7 @@ func (m *GetClusterResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_GetClusterResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1627,7 +1628,7 @@ func (m *ListClustersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_ListClustersRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1667,7 +1668,7 @@ func (m *ListClustersRequest_Filters) XXX_Marshal(b []byte, deterministic bool) return xxx_messageInfo_ListClustersRequest_Filters.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1703,7 +1704,7 @@ func (m *ListClustersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_ListClustersResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1745,7 +1746,7 @@ func (m *KeyRotation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_KeyRotation.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1788,7 +1789,7 @@ func (m *UpdateClusterRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_UpdateClusterRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1824,7 +1825,7 @@ func (m *UpdateClusterResponse) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_UpdateClusterResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1861,7 +1862,7 @@ func (m *GetSecretRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_GetSecretRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1900,7 +1901,7 @@ func (m *GetSecretResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_GetSecretResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1942,7 +1943,7 @@ func (m *UpdateSecretRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_UpdateSecretRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1978,7 +1979,7 @@ func (m *UpdateSecretResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_UpdateSecretResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2016,7 +2017,7 @@ func (m *ListSecretsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_ListSecretsRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2055,7 +2056,7 @@ func (m *ListSecretsRequest_Filters) XXX_Marshal(b []byte, deterministic bool) ( return xxx_messageInfo_ListSecretsRequest_Filters.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2095,7 +2096,7 @@ func (m *ListSecretsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_ListSecretsResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2133,7 +2134,7 @@ func (m *CreateSecretRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_CreateSecretRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2172,7 +2173,7 @@ func (m *CreateSecretResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_CreateSecretResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2210,7 +2211,7 @@ func (m *RemoveSecretRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_RemoveSecretRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2247,7 +2248,7 @@ func (m *RemoveSecretResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_RemoveSecretResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2284,7 +2285,7 @@ func (m *GetConfigRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_GetConfigRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2322,7 +2323,7 @@ func (m *GetConfigResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_GetConfigResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2364,7 +2365,7 @@ func (m *UpdateConfigRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_UpdateConfigRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2400,7 +2401,7 @@ func (m *UpdateConfigResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_UpdateConfigResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2438,7 +2439,7 @@ func (m *ListConfigsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_ListConfigsRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2477,7 +2478,7 @@ func (m *ListConfigsRequest_Filters) XXX_Marshal(b []byte, deterministic bool) ( return xxx_messageInfo_ListConfigsRequest_Filters.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2515,7 +2516,7 @@ func (m *ListConfigsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_ListConfigsResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2553,7 +2554,7 @@ func (m *CreateConfigRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_CreateConfigRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2591,7 +2592,7 @@ func (m *CreateConfigResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_CreateConfigResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2629,7 +2630,7 @@ func (m *RemoveConfigRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_RemoveConfigRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2666,7 +2667,7 @@ func (m *RemoveConfigResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_RemoveConfigResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2705,7 +2706,7 @@ func (m *CreateExtensionRequest) XXX_Marshal(b []byte, deterministic bool) ([]by return xxx_messageInfo_CreateExtensionRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2743,7 +2744,7 @@ func (m *CreateExtensionResponse) XXX_Marshal(b []byte, deterministic bool) ([]b return xxx_messageInfo_CreateExtensionResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2781,7 +2782,7 @@ func (m *RemoveExtensionRequest) XXX_Marshal(b []byte, deterministic bool) ([]by return xxx_messageInfo_RemoveExtensionRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2818,7 +2819,7 @@ func (m *RemoveExtensionResponse) XXX_Marshal(b []byte, deterministic bool) ([]b return xxx_messageInfo_RemoveExtensionResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2855,7 +2856,7 @@ func (m *GetExtensionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_GetExtensionRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2893,7 +2894,7 @@ func (m *GetExtensionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_GetExtensionResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2933,7 +2934,7 @@ func (m *CreateResourceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_CreateResourceRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2971,7 +2972,7 @@ func (m *CreateResourceResponse) XXX_Marshal(b []byte, deterministic bool) ([]by return xxx_messageInfo_CreateResourceResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -3009,7 +3010,7 @@ func (m *RemoveResourceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_RemoveResourceRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -3046,7 +3047,7 @@ func (m *RemoveResourceResponse) XXX_Marshal(b []byte, deterministic bool) ([]by return xxx_messageInfo_RemoveResourceResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -3091,7 +3092,7 @@ func (m *UpdateResourceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_UpdateResourceRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -3127,7 +3128,7 @@ func (m *UpdateResourceResponse) XXX_Marshal(b []byte, deterministic bool) ([]by return xxx_messageInfo_UpdateResourceResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -3164,7 +3165,7 @@ func (m *GetResourceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_GetResourceRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -3202,7 +3203,7 @@ func (m *GetResourceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_GetResourceResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -3240,7 +3241,7 @@ func (m *ListResourcesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_ListResourcesRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -3280,7 +3281,7 @@ func (m *ListResourcesRequest_Filters) XXX_Marshal(b []byte, deterministic bool) return xxx_messageInfo_ListResourcesRequest_Filters.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -3318,7 +3319,7 @@ func (m *ListResourcesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_ListResourcesResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -6304,6 +6305,125 @@ type ControlServer interface { RemoveResource(context.Context, *RemoveResourceRequest) (*RemoveResourceResponse, error) } +// UnimplementedControlServer can be embedded to have forward compatible implementations. +type UnimplementedControlServer struct { +} + +func (*UnimplementedControlServer) GetNode(ctx context.Context, req *GetNodeRequest) (*GetNodeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetNode not implemented") +} +func (*UnimplementedControlServer) ListNodes(ctx context.Context, req *ListNodesRequest) (*ListNodesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListNodes not implemented") +} +func (*UnimplementedControlServer) UpdateNode(ctx context.Context, req *UpdateNodeRequest) (*UpdateNodeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateNode not implemented") +} +func (*UnimplementedControlServer) RemoveNode(ctx context.Context, req *RemoveNodeRequest) (*RemoveNodeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveNode not implemented") +} +func (*UnimplementedControlServer) GetTask(ctx context.Context, req *GetTaskRequest) (*GetTaskResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetTask not implemented") +} +func (*UnimplementedControlServer) ListTasks(ctx context.Context, req *ListTasksRequest) (*ListTasksResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListTasks not implemented") +} +func (*UnimplementedControlServer) RemoveTask(ctx context.Context, req *RemoveTaskRequest) (*RemoveTaskResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveTask not implemented") +} +func (*UnimplementedControlServer) GetService(ctx context.Context, req *GetServiceRequest) (*GetServiceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetService not implemented") +} +func (*UnimplementedControlServer) ListServices(ctx context.Context, req *ListServicesRequest) (*ListServicesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListServices not implemented") +} +func (*UnimplementedControlServer) CreateService(ctx context.Context, req *CreateServiceRequest) (*CreateServiceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateService not implemented") +} +func (*UnimplementedControlServer) UpdateService(ctx context.Context, req *UpdateServiceRequest) (*UpdateServiceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateService not implemented") +} +func (*UnimplementedControlServer) RemoveService(ctx context.Context, req *RemoveServiceRequest) (*RemoveServiceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveService not implemented") +} +func (*UnimplementedControlServer) ListServiceStatuses(ctx context.Context, req *ListServiceStatusesRequest) (*ListServiceStatusesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListServiceStatuses not implemented") +} +func (*UnimplementedControlServer) GetNetwork(ctx context.Context, req *GetNetworkRequest) (*GetNetworkResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetNetwork not implemented") +} +func (*UnimplementedControlServer) ListNetworks(ctx context.Context, req *ListNetworksRequest) (*ListNetworksResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListNetworks not implemented") +} +func (*UnimplementedControlServer) CreateNetwork(ctx context.Context, req *CreateNetworkRequest) (*CreateNetworkResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateNetwork not implemented") +} +func (*UnimplementedControlServer) RemoveNetwork(ctx context.Context, req *RemoveNetworkRequest) (*RemoveNetworkResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveNetwork not implemented") +} +func (*UnimplementedControlServer) GetCluster(ctx context.Context, req *GetClusterRequest) (*GetClusterResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetCluster not implemented") +} +func (*UnimplementedControlServer) ListClusters(ctx context.Context, req *ListClustersRequest) (*ListClustersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListClusters not implemented") +} +func (*UnimplementedControlServer) UpdateCluster(ctx context.Context, req *UpdateClusterRequest) (*UpdateClusterResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateCluster not implemented") +} +func (*UnimplementedControlServer) GetSecret(ctx context.Context, req *GetSecretRequest) (*GetSecretResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetSecret not implemented") +} +func (*UnimplementedControlServer) UpdateSecret(ctx context.Context, req *UpdateSecretRequest) (*UpdateSecretResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateSecret not implemented") +} +func (*UnimplementedControlServer) ListSecrets(ctx context.Context, req *ListSecretsRequest) (*ListSecretsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListSecrets not implemented") +} +func (*UnimplementedControlServer) CreateSecret(ctx context.Context, req *CreateSecretRequest) (*CreateSecretResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateSecret not implemented") +} +func (*UnimplementedControlServer) RemoveSecret(ctx context.Context, req *RemoveSecretRequest) (*RemoveSecretResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveSecret not implemented") +} +func (*UnimplementedControlServer) GetConfig(ctx context.Context, req *GetConfigRequest) (*GetConfigResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetConfig not implemented") +} +func (*UnimplementedControlServer) UpdateConfig(ctx context.Context, req *UpdateConfigRequest) (*UpdateConfigResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateConfig not implemented") +} +func (*UnimplementedControlServer) ListConfigs(ctx context.Context, req *ListConfigsRequest) (*ListConfigsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListConfigs not implemented") +} +func (*UnimplementedControlServer) CreateConfig(ctx context.Context, req *CreateConfigRequest) (*CreateConfigResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateConfig not implemented") +} +func (*UnimplementedControlServer) RemoveConfig(ctx context.Context, req *RemoveConfigRequest) (*RemoveConfigResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveConfig not implemented") +} +func (*UnimplementedControlServer) GetExtension(ctx context.Context, req *GetExtensionRequest) (*GetExtensionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetExtension not implemented") +} +func (*UnimplementedControlServer) CreateExtension(ctx context.Context, req *CreateExtensionRequest) (*CreateExtensionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateExtension not implemented") +} +func (*UnimplementedControlServer) RemoveExtension(ctx context.Context, req *RemoveExtensionRequest) (*RemoveExtensionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveExtension not implemented") +} +func (*UnimplementedControlServer) GetResource(ctx context.Context, req *GetResourceRequest) (*GetResourceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetResource not implemented") +} +func (*UnimplementedControlServer) UpdateResource(ctx context.Context, req *UpdateResourceRequest) (*UpdateResourceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateResource not implemented") +} +func (*UnimplementedControlServer) ListResources(ctx context.Context, req *ListResourcesRequest) (*ListResourcesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListResources not implemented") +} +func (*UnimplementedControlServer) CreateResource(ctx context.Context, req *CreateResourceRequest) (*CreateResourceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateResource not implemented") +} +func (*UnimplementedControlServer) RemoveResource(ctx context.Context, req *RemoveResourceRequest) (*RemoveResourceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveResource not implemented") +} + func RegisterControlServer(s *grpc.Server, srv ControlServer) { s.RegisterService(&_Control_serviceDesc, srv) } @@ -7156,7 +7276,7 @@ var _Control_serviceDesc = grpc.ServiceDesc{ func (m *GetNodeRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7164,23 +7284,29 @@ func (m *GetNodeRequest) Marshal() (dAtA []byte, err error) { } func (m *GetNodeRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetNodeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.NodeID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.NodeID) + copy(dAtA[i:], m.NodeID) i = encodeVarintControl(dAtA, i, uint64(len(m.NodeID))) - i += copy(dAtA[i:], m.NodeID) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetNodeResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7188,27 +7314,34 @@ func (m *GetNodeResponse) Marshal() (dAtA []byte, err error) { } func (m *GetNodeResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetNodeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Node != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Node.Size())) - n1, err := m.Node.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Node.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n1 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ListNodesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7216,27 +7349,34 @@ func (m *ListNodesRequest) Marshal() (dAtA []byte, err error) { } func (m *ListNodesRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListNodesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Filters != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Filters.Size())) - n2, err := m.Filters.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Filters.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n2 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ListNodesRequest_Filters) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7244,110 +7384,101 @@ func (m *ListNodesRequest_Filters) Marshal() (dAtA []byte, err error) { } func (m *ListNodesRequest_Filters) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListNodesRequest_Filters) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Names) > 0 { - for _, s := range m.Names { - dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - if len(m.IDPrefixes) > 0 { - for _, s := range m.IDPrefixes { - dAtA[i] = 0x12 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - if len(m.Labels) > 0 { - for k, _ := range m.Labels { - dAtA[i] = 0x1a - i++ - v := m.Labels[k] - mapSize := 1 + len(k) + sovControl(uint64(len(k))) + 1 + len(v) + sovControl(uint64(len(v))) - i = encodeVarintControl(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ + if len(m.NodeLabels) > 0 { + for k := range m.NodeLabels { + v := m.NodeLabels[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) i = encodeVarintControl(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) - } - } - if len(m.Memberships) > 0 { - for _, num := range m.Memberships { - dAtA[i] = 0x20 - i++ - i = encodeVarintControl(dAtA, i, uint64(num)) - } - } - if len(m.Roles) > 0 { - for _, num := range m.Roles { - dAtA[i] = 0x28 - i++ - i = encodeVarintControl(dAtA, i, uint64(num)) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintControl(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintControl(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x3a } } if len(m.NamePrefixes) > 0 { - for _, s := range m.NamePrefixes { + for iNdEx := len(m.NamePrefixes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.NamePrefixes[iNdEx]) + copy(dAtA[i:], m.NamePrefixes[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.NamePrefixes[iNdEx]))) + i-- dAtA[i] = 0x32 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) } } - if len(m.NodeLabels) > 0 { - for k, _ := range m.NodeLabels { - dAtA[i] = 0x3a - i++ - v := m.NodeLabels[k] - mapSize := 1 + len(k) + sovControl(uint64(len(k))) + 1 + len(v) + sovControl(uint64(len(v))) - i = encodeVarintControl(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ + if len(m.Roles) > 0 { + for iNdEx := len(m.Roles) - 1; iNdEx >= 0; iNdEx-- { + i = encodeVarintControl(dAtA, i, uint64(m.Roles[iNdEx])) + i-- + dAtA[i] = 0x28 + } + } + if len(m.Memberships) > 0 { + for iNdEx := len(m.Memberships) - 1; iNdEx >= 0; iNdEx-- { + i = encodeVarintControl(dAtA, i, uint64(m.Memberships[iNdEx])) + i-- + dAtA[i] = 0x20 + } + } + if len(m.Labels) > 0 { + for k := range m.Labels { + v := m.Labels[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) i = encodeVarintControl(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintControl(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintControl(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1a } } - return i, nil + if len(m.IDPrefixes) > 0 { + for iNdEx := len(m.IDPrefixes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.IDPrefixes[iNdEx]) + copy(dAtA[i:], m.IDPrefixes[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.IDPrefixes[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Names) > 0 { + for iNdEx := len(m.Names) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Names[iNdEx]) + copy(dAtA[i:], m.Names[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.Names[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil } func (m *ListNodesResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7355,29 +7486,36 @@ func (m *ListNodesResponse) Marshal() (dAtA []byte, err error) { } func (m *ListNodesResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListNodesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Nodes) > 0 { - for _, msg := range m.Nodes { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + 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 = encodeVarintControl(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - return i, nil + return len(dAtA) - i, nil } func (m *UpdateNodeRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7385,43 +7523,53 @@ func (m *UpdateNodeRequest) Marshal() (dAtA []byte, err error) { } func (m *UpdateNodeRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateNodeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.NodeID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(m.NodeID))) - i += copy(dAtA[i:], m.NodeID) + if m.Spec != nil { + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a } if m.NodeVersion != nil { + { + size, err := m.NodeVersion.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintControl(dAtA, i, uint64(m.NodeVersion.Size())) - n3, err := m.NodeVersion.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n3 } - if m.Spec != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Spec.Size())) - n4, err := m.Spec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n4 + if len(m.NodeID) > 0 { + i -= len(m.NodeID) + copy(dAtA[i:], m.NodeID) + i = encodeVarintControl(dAtA, i, uint64(len(m.NodeID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *UpdateNodeResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7429,27 +7577,34 @@ func (m *UpdateNodeResponse) Marshal() (dAtA []byte, err error) { } func (m *UpdateNodeResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateNodeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Node != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Node.Size())) - n5, err := m.Node.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Node.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n5 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RemoveNodeRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7457,33 +7612,39 @@ func (m *RemoveNodeRequest) Marshal() (dAtA []byte, err error) { } func (m *RemoveNodeRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemoveNodeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.NodeID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(m.NodeID))) - i += copy(dAtA[i:], m.NodeID) - } if m.Force { - dAtA[i] = 0x10 - i++ + i-- if m.Force { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x10 } - return i, nil + if len(m.NodeID) > 0 { + i -= len(m.NodeID) + copy(dAtA[i:], m.NodeID) + i = encodeVarintControl(dAtA, i, uint64(len(m.NodeID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *RemoveNodeResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7491,17 +7652,22 @@ func (m *RemoveNodeResponse) Marshal() (dAtA []byte, err error) { } func (m *RemoveNodeResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemoveNodeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + return len(dAtA) - i, nil } func (m *GetTaskRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7509,23 +7675,29 @@ func (m *GetTaskRequest) Marshal() (dAtA []byte, err error) { } func (m *GetTaskRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetTaskRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.TaskID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.TaskID) + copy(dAtA[i:], m.TaskID) i = encodeVarintControl(dAtA, i, uint64(len(m.TaskID))) - i += copy(dAtA[i:], m.TaskID) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetTaskResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7533,27 +7705,34 @@ func (m *GetTaskResponse) Marshal() (dAtA []byte, err error) { } func (m *GetTaskResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetTaskResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Task != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Task.Size())) - n6, err := m.Task.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Task.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n6 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RemoveTaskRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7561,23 +7740,29 @@ func (m *RemoveTaskRequest) Marshal() (dAtA []byte, err error) { } func (m *RemoveTaskRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemoveTaskRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.TaskID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.TaskID) + copy(dAtA[i:], m.TaskID) i = encodeVarintControl(dAtA, i, uint64(len(m.TaskID))) - i += copy(dAtA[i:], m.TaskID) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RemoveTaskResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7585,17 +7770,22 @@ func (m *RemoveTaskResponse) Marshal() (dAtA []byte, err error) { } func (m *RemoveTaskResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemoveTaskResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + return len(dAtA) - i, nil } func (m *ListTasksRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7603,27 +7793,34 @@ func (m *ListTasksRequest) Marshal() (dAtA []byte, err error) { } func (m *ListTasksRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListTasksRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Filters != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Filters.Size())) - n7, err := m.Filters.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Filters.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n7 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ListTasksRequest_Filters) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7631,141 +7828,112 @@ func (m *ListTasksRequest_Filters) Marshal() (dAtA []byte, err error) { } func (m *ListTasksRequest_Filters) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListTasksRequest_Filters) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Names) > 0 { - for _, s := range m.Names { - dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - if len(m.IDPrefixes) > 0 { - for _, s := range m.IDPrefixes { - dAtA[i] = 0x12 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - if len(m.Labels) > 0 { - for k, _ := range m.Labels { - dAtA[i] = 0x1a - i++ - v := m.Labels[k] - mapSize := 1 + len(k) + sovControl(uint64(len(k))) + 1 + len(v) + sovControl(uint64(len(v))) - i = encodeVarintControl(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ - i = encodeVarintControl(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) - } - } - if len(m.ServiceIDs) > 0 { - for _, s := range m.ServiceIDs { - dAtA[i] = 0x22 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - if len(m.NodeIDs) > 0 { - for _, s := range m.NodeIDs { - dAtA[i] = 0x2a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - if len(m.DesiredStates) > 0 { - for _, num := range m.DesiredStates { - dAtA[i] = 0x30 - i++ - i = encodeVarintControl(dAtA, i, uint64(num)) - } - } - if len(m.NamePrefixes) > 0 { - for _, s := range m.NamePrefixes { - dAtA[i] = 0x3a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if len(m.Runtimes) > 0 { + for iNdEx := len(m.Runtimes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Runtimes[iNdEx]) + copy(dAtA[i:], m.Runtimes[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.Runtimes[iNdEx]))) + i-- + dAtA[i] = 0x4a } } if m.UpToDate { - dAtA[i] = 0x40 - i++ + i-- if m.UpToDate { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x40 } - if len(m.Runtimes) > 0 { - for _, s := range m.Runtimes { - dAtA[i] = 0x4a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if len(m.NamePrefixes) > 0 { + for iNdEx := len(m.NamePrefixes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.NamePrefixes[iNdEx]) + copy(dAtA[i:], m.NamePrefixes[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.NamePrefixes[iNdEx]))) + i-- + dAtA[i] = 0x3a } } - return i, nil + if len(m.DesiredStates) > 0 { + for iNdEx := len(m.DesiredStates) - 1; iNdEx >= 0; iNdEx-- { + i = encodeVarintControl(dAtA, i, uint64(m.DesiredStates[iNdEx])) + i-- + dAtA[i] = 0x30 + } + } + if len(m.NodeIDs) > 0 { + for iNdEx := len(m.NodeIDs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.NodeIDs[iNdEx]) + copy(dAtA[i:], m.NodeIDs[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.NodeIDs[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } + if len(m.ServiceIDs) > 0 { + for iNdEx := len(m.ServiceIDs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ServiceIDs[iNdEx]) + copy(dAtA[i:], m.ServiceIDs[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.ServiceIDs[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(m.Labels) > 0 { + for k := range m.Labels { + v := m.Labels[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintControl(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintControl(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintControl(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1a + } + } + if len(m.IDPrefixes) > 0 { + for iNdEx := len(m.IDPrefixes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.IDPrefixes[iNdEx]) + copy(dAtA[i:], m.IDPrefixes[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.IDPrefixes[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Names) > 0 { + for iNdEx := len(m.Names) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Names[iNdEx]) + copy(dAtA[i:], m.Names[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.Names[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil } func (m *ListTasksResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7773,29 +7941,36 @@ func (m *ListTasksResponse) Marshal() (dAtA []byte, err error) { } func (m *ListTasksResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListTasksResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Tasks) > 0 { - for _, msg := range m.Tasks { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + 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 = encodeVarintControl(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - return i, nil + return len(dAtA) - i, nil } func (m *CreateServiceRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7803,27 +7978,34 @@ func (m *CreateServiceRequest) Marshal() (dAtA []byte, err error) { } func (m *CreateServiceRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateServiceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Spec != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Spec.Size())) - n8, err := m.Spec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n8 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *CreateServiceResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7831,27 +8013,34 @@ func (m *CreateServiceResponse) Marshal() (dAtA []byte, err error) { } func (m *CreateServiceResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateServiceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Service != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Service.Size())) - n9, err := m.Service.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Service.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n9 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetServiceRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7859,33 +8048,39 @@ func (m *GetServiceRequest) Marshal() (dAtA []byte, err error) { } func (m *GetServiceRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetServiceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ServiceID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(m.ServiceID))) - i += copy(dAtA[i:], m.ServiceID) - } if m.InsertDefaults { - dAtA[i] = 0x10 - i++ + i-- if m.InsertDefaults { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x10 } - return i, nil + if len(m.ServiceID) > 0 { + i -= len(m.ServiceID) + copy(dAtA[i:], m.ServiceID) + i = encodeVarintControl(dAtA, i, uint64(len(m.ServiceID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *GetServiceResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7893,27 +8088,34 @@ func (m *GetServiceResponse) Marshal() (dAtA []byte, err error) { } func (m *GetServiceResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetServiceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Service != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Service.Size())) - n10, err := m.Service.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Service.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n10 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *UpdateServiceRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7921,48 +8123,58 @@ func (m *UpdateServiceRequest) Marshal() (dAtA []byte, err error) { } func (m *UpdateServiceRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateServiceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ServiceID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(m.ServiceID))) - i += copy(dAtA[i:], m.ServiceID) - } - if m.ServiceVersion != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintControl(dAtA, i, uint64(m.ServiceVersion.Size())) - n11, err := m.ServiceVersion.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n11 + if m.Rollback != 0 { + i = encodeVarintControl(dAtA, i, uint64(m.Rollback)) + i-- + dAtA[i] = 0x20 } if m.Spec != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Spec.Size())) - n12, err := m.Spec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n12 + i-- + dAtA[i] = 0x1a } - if m.Rollback != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Rollback)) + if m.ServiceVersion != nil { + { + size, err := m.ServiceVersion.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.ServiceID) > 0 { + i -= len(m.ServiceID) + copy(dAtA[i:], m.ServiceID) + i = encodeVarintControl(dAtA, i, uint64(len(m.ServiceID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *UpdateServiceResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7970,27 +8182,34 @@ func (m *UpdateServiceResponse) Marshal() (dAtA []byte, err error) { } func (m *UpdateServiceResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateServiceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Service != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Service.Size())) - n13, err := m.Service.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Service.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n13 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RemoveServiceRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7998,23 +8217,29 @@ func (m *RemoveServiceRequest) Marshal() (dAtA []byte, err error) { } func (m *RemoveServiceRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemoveServiceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.ServiceID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.ServiceID) + copy(dAtA[i:], m.ServiceID) i = encodeVarintControl(dAtA, i, uint64(len(m.ServiceID))) - i += copy(dAtA[i:], m.ServiceID) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RemoveServiceResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8022,17 +8247,22 @@ func (m *RemoveServiceResponse) Marshal() (dAtA []byte, err error) { } func (m *RemoveServiceResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemoveServiceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + return len(dAtA) - i, nil } func (m *ListServicesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8040,27 +8270,34 @@ func (m *ListServicesRequest) Marshal() (dAtA []byte, err error) { } func (m *ListServicesRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListServicesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Filters != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Filters.Size())) - n14, err := m.Filters.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Filters.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n14 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ListServicesRequest_Filters) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8068,94 +8305,77 @@ func (m *ListServicesRequest_Filters) Marshal() (dAtA []byte, err error) { } func (m *ListServicesRequest_Filters) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListServicesRequest_Filters) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Names) > 0 { - for _, s := range m.Names { - dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - if len(m.IDPrefixes) > 0 { - for _, s := range m.IDPrefixes { - dAtA[i] = 0x12 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - if len(m.Labels) > 0 { - for k, _ := range m.Labels { - dAtA[i] = 0x1a - i++ - v := m.Labels[k] - mapSize := 1 + len(k) + sovControl(uint64(len(k))) + 1 + len(v) + sovControl(uint64(len(v))) - i = encodeVarintControl(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ - i = encodeVarintControl(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + if len(m.Runtimes) > 0 { + for iNdEx := len(m.Runtimes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Runtimes[iNdEx]) + copy(dAtA[i:], m.Runtimes[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.Runtimes[iNdEx]))) + i-- + dAtA[i] = 0x2a } } if len(m.NamePrefixes) > 0 { - for _, s := range m.NamePrefixes { + for iNdEx := len(m.NamePrefixes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.NamePrefixes[iNdEx]) + copy(dAtA[i:], m.NamePrefixes[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.NamePrefixes[iNdEx]))) + i-- dAtA[i] = 0x22 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) } } - if len(m.Runtimes) > 0 { - for _, s := range m.Runtimes { - dAtA[i] = 0x2a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if len(m.Labels) > 0 { + for k := range m.Labels { + v := m.Labels[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintControl(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintControl(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintControl(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1a } } - return i, nil + if len(m.IDPrefixes) > 0 { + for iNdEx := len(m.IDPrefixes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.IDPrefixes[iNdEx]) + copy(dAtA[i:], m.IDPrefixes[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.IDPrefixes[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Names) > 0 { + for iNdEx := len(m.Names) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Names[iNdEx]) + copy(dAtA[i:], m.Names[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.Names[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil } func (m *ListServicesResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8163,29 +8383,36 @@ func (m *ListServicesResponse) Marshal() (dAtA []byte, err error) { } func (m *ListServicesResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListServicesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Services) > 0 { - for _, msg := range m.Services { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + 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 = encodeVarintControl(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - return i, nil + return len(dAtA) - i, nil } func (m *ListServiceStatusesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8193,32 +8420,31 @@ func (m *ListServiceStatusesRequest) Marshal() (dAtA []byte, err error) { } func (m *ListServiceStatusesRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListServiceStatusesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Services) > 0 { - for _, s := range m.Services { + for iNdEx := len(m.Services) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Services[iNdEx]) + copy(dAtA[i:], m.Services[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.Services[iNdEx]))) + i-- dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) } } - return i, nil + return len(dAtA) - i, nil } func (m *ListServiceStatusesResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8226,29 +8452,36 @@ func (m *ListServiceStatusesResponse) Marshal() (dAtA []byte, err error) { } func (m *ListServiceStatusesResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListServiceStatusesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Statuses) > 0 { - for _, msg := range m.Statuses { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Statuses) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Statuses[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - return i, nil + return len(dAtA) - i, nil } func (m *ListServiceStatusesResponse_ServiceStatus) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8256,38 +8489,44 @@ func (m *ListServiceStatusesResponse_ServiceStatus) Marshal() (dAtA []byte, err } func (m *ListServiceStatusesResponse_ServiceStatus) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListServiceStatusesResponse_ServiceStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ServiceID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(m.ServiceID))) - i += copy(dAtA[i:], m.ServiceID) - } - if m.DesiredTasks != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintControl(dAtA, i, uint64(m.DesiredTasks)) + if m.CompletedTasks != 0 { + i = encodeVarintControl(dAtA, i, uint64(m.CompletedTasks)) + i-- + dAtA[i] = 0x20 } if m.RunningTasks != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintControl(dAtA, i, uint64(m.RunningTasks)) + i-- + dAtA[i] = 0x18 } - if m.CompletedTasks != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintControl(dAtA, i, uint64(m.CompletedTasks)) + if m.DesiredTasks != 0 { + i = encodeVarintControl(dAtA, i, uint64(m.DesiredTasks)) + i-- + dAtA[i] = 0x10 } - return i, nil + if len(m.ServiceID) > 0 { + i -= len(m.ServiceID) + copy(dAtA[i:], m.ServiceID) + i = encodeVarintControl(dAtA, i, uint64(len(m.ServiceID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *CreateNetworkRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8295,27 +8534,34 @@ func (m *CreateNetworkRequest) Marshal() (dAtA []byte, err error) { } func (m *CreateNetworkRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateNetworkRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Spec != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Spec.Size())) - n15, err := m.Spec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n15 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *CreateNetworkResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8323,27 +8569,34 @@ func (m *CreateNetworkResponse) Marshal() (dAtA []byte, err error) { } func (m *CreateNetworkResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateNetworkResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Network != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Network.Size())) - n16, err := m.Network.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Network.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n16 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetNetworkRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8351,29 +8604,36 @@ func (m *GetNetworkRequest) Marshal() (dAtA []byte, err error) { } func (m *GetNetworkRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetNetworkRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } if len(m.NetworkID) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.NetworkID) + copy(dAtA[i:], m.NetworkID) i = encodeVarintControl(dAtA, i, uint64(len(m.NetworkID))) - i += copy(dAtA[i:], m.NetworkID) + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintControl(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *GetNetworkResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8381,27 +8641,34 @@ func (m *GetNetworkResponse) Marshal() (dAtA []byte, err error) { } func (m *GetNetworkResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetNetworkResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Network != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Network.Size())) - n17, err := m.Network.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Network.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n17 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RemoveNetworkRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8409,29 +8676,36 @@ func (m *RemoveNetworkRequest) Marshal() (dAtA []byte, err error) { } func (m *RemoveNetworkRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemoveNetworkRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } if len(m.NetworkID) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.NetworkID) + copy(dAtA[i:], m.NetworkID) i = encodeVarintControl(dAtA, i, uint64(len(m.NetworkID))) - i += copy(dAtA[i:], m.NetworkID) + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintControl(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *RemoveNetworkResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8439,17 +8713,22 @@ func (m *RemoveNetworkResponse) Marshal() (dAtA []byte, err error) { } func (m *RemoveNetworkResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemoveNetworkResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + return len(dAtA) - i, nil } func (m *ListNetworksRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8457,27 +8736,34 @@ func (m *ListNetworksRequest) Marshal() (dAtA []byte, err error) { } func (m *ListNetworksRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListNetworksRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Filters != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Filters.Size())) - n18, err := m.Filters.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Filters.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n18 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ListNetworksRequest_Filters) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8485,79 +8771,68 @@ func (m *ListNetworksRequest_Filters) Marshal() (dAtA []byte, err error) { } func (m *ListNetworksRequest_Filters) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListNetworksRequest_Filters) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Names) > 0 { - for _, s := range m.Names { - dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - if len(m.IDPrefixes) > 0 { - for _, s := range m.IDPrefixes { - dAtA[i] = 0x12 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if len(m.NamePrefixes) > 0 { + for iNdEx := len(m.NamePrefixes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.NamePrefixes[iNdEx]) + copy(dAtA[i:], m.NamePrefixes[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.NamePrefixes[iNdEx]))) + i-- + dAtA[i] = 0x22 } } if len(m.Labels) > 0 { - for k, _ := range m.Labels { - dAtA[i] = 0x1a - i++ + for k := range m.Labels { v := m.Labels[k] - mapSize := 1 + len(k) + sovControl(uint64(len(k))) + 1 + len(v) + sovControl(uint64(len(v))) - i = encodeVarintControl(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ + baseI := i + i -= len(v) + copy(dAtA[i:], v) i = encodeVarintControl(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintControl(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintControl(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1a } } - if len(m.NamePrefixes) > 0 { - for _, s := range m.NamePrefixes { - dAtA[i] = 0x22 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if len(m.IDPrefixes) > 0 { + for iNdEx := len(m.IDPrefixes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.IDPrefixes[iNdEx]) + copy(dAtA[i:], m.IDPrefixes[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.IDPrefixes[iNdEx]))) + i-- + dAtA[i] = 0x12 } } - return i, nil + if len(m.Names) > 0 { + for iNdEx := len(m.Names) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Names[iNdEx]) + copy(dAtA[i:], m.Names[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.Names[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil } func (m *ListNetworksResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8565,29 +8840,36 @@ func (m *ListNetworksResponse) Marshal() (dAtA []byte, err error) { } func (m *ListNetworksResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListNetworksResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Networks) > 0 { - for _, msg := range m.Networks { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + 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 = encodeVarintControl(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - return i, nil + return len(dAtA) - i, nil } func (m *GetClusterRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8595,23 +8877,29 @@ func (m *GetClusterRequest) Marshal() (dAtA []byte, err error) { } func (m *GetClusterRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetClusterRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.ClusterID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.ClusterID) + copy(dAtA[i:], m.ClusterID) i = encodeVarintControl(dAtA, i, uint64(len(m.ClusterID))) - i += copy(dAtA[i:], m.ClusterID) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetClusterResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8619,27 +8907,34 @@ func (m *GetClusterResponse) Marshal() (dAtA []byte, err error) { } func (m *GetClusterResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetClusterResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Cluster != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Cluster.Size())) - n19, err := m.Cluster.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Cluster.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n19 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ListClustersRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8647,27 +8942,34 @@ func (m *ListClustersRequest) Marshal() (dAtA []byte, err error) { } func (m *ListClustersRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListClustersRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Filters != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Filters.Size())) - n20, err := m.Filters.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Filters.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n20 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ListClustersRequest_Filters) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8675,79 +8977,68 @@ func (m *ListClustersRequest_Filters) Marshal() (dAtA []byte, err error) { } func (m *ListClustersRequest_Filters) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListClustersRequest_Filters) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Names) > 0 { - for _, s := range m.Names { - dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - if len(m.IDPrefixes) > 0 { - for _, s := range m.IDPrefixes { - dAtA[i] = 0x12 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if len(m.NamePrefixes) > 0 { + for iNdEx := len(m.NamePrefixes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.NamePrefixes[iNdEx]) + copy(dAtA[i:], m.NamePrefixes[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.NamePrefixes[iNdEx]))) + i-- + dAtA[i] = 0x22 } } if len(m.Labels) > 0 { - for k, _ := range m.Labels { - dAtA[i] = 0x1a - i++ + for k := range m.Labels { v := m.Labels[k] - mapSize := 1 + len(k) + sovControl(uint64(len(k))) + 1 + len(v) + sovControl(uint64(len(v))) - i = encodeVarintControl(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ + baseI := i + i -= len(v) + copy(dAtA[i:], v) i = encodeVarintControl(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintControl(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintControl(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1a } } - if len(m.NamePrefixes) > 0 { - for _, s := range m.NamePrefixes { - dAtA[i] = 0x22 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if len(m.IDPrefixes) > 0 { + for iNdEx := len(m.IDPrefixes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.IDPrefixes[iNdEx]) + copy(dAtA[i:], m.IDPrefixes[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.IDPrefixes[iNdEx]))) + i-- + dAtA[i] = 0x12 } } - return i, nil + if len(m.Names) > 0 { + for iNdEx := len(m.Names) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Names[iNdEx]) + copy(dAtA[i:], m.Names[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.Names[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil } func (m *ListClustersResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8755,29 +9046,36 @@ func (m *ListClustersResponse) Marshal() (dAtA []byte, err error) { } func (m *ListClustersResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListClustersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Clusters) > 0 { - for _, msg := range m.Clusters { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + 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 = encodeVarintControl(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - return i, nil + return len(dAtA) - i, nil } func (m *KeyRotation) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8785,47 +9083,52 @@ func (m *KeyRotation) Marshal() (dAtA []byte, err error) { } func (m *KeyRotation) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *KeyRotation) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.WorkerJoinToken { - dAtA[i] = 0x8 - i++ - if m.WorkerJoinToken { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.ManagerJoinToken { - dAtA[i] = 0x10 - i++ - if m.ManagerJoinToken { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } if m.ManagerUnlockKey { - dAtA[i] = 0x18 - i++ + i-- if m.ManagerUnlockKey { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x18 } - return i, nil + if m.ManagerJoinToken { + i-- + if m.ManagerJoinToken { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if m.WorkerJoinToken { + i-- + if m.WorkerJoinToken { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *UpdateClusterRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8833,51 +9136,63 @@ func (m *UpdateClusterRequest) Marshal() (dAtA []byte, err error) { } func (m *UpdateClusterRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateClusterRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ClusterID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(m.ClusterID))) - i += copy(dAtA[i:], m.ClusterID) + { + size, err := m.Rotation.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if m.Spec != nil { + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a } if m.ClusterVersion != nil { + { + size, err := m.ClusterVersion.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintControl(dAtA, i, uint64(m.ClusterVersion.Size())) - n21, err := m.ClusterVersion.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n21 } - if m.Spec != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Spec.Size())) - n22, err := m.Spec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n22 + if len(m.ClusterID) > 0 { + i -= len(m.ClusterID) + copy(dAtA[i:], m.ClusterID) + i = encodeVarintControl(dAtA, i, uint64(len(m.ClusterID))) + i-- + dAtA[i] = 0xa } - dAtA[i] = 0x22 - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Rotation.Size())) - n23, err := m.Rotation.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n23 - return i, nil + return len(dAtA) - i, nil } func (m *UpdateClusterResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8885,27 +9200,34 @@ func (m *UpdateClusterResponse) Marshal() (dAtA []byte, err error) { } func (m *UpdateClusterResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateClusterResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Cluster != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Cluster.Size())) - n24, err := m.Cluster.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Cluster.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n24 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetSecretRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8913,23 +9235,29 @@ func (m *GetSecretRequest) Marshal() (dAtA []byte, err error) { } func (m *GetSecretRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetSecretRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.SecretID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.SecretID) + copy(dAtA[i:], m.SecretID) i = encodeVarintControl(dAtA, i, uint64(len(m.SecretID))) - i += copy(dAtA[i:], m.SecretID) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetSecretResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8937,27 +9265,34 @@ func (m *GetSecretResponse) Marshal() (dAtA []byte, err error) { } func (m *GetSecretResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetSecretResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Secret != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Secret.Size())) - n25, err := m.Secret.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Secret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n25 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *UpdateSecretRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8965,43 +9300,53 @@ func (m *UpdateSecretRequest) Marshal() (dAtA []byte, err error) { } func (m *UpdateSecretRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateSecretRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.SecretID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(m.SecretID))) - i += copy(dAtA[i:], m.SecretID) + if m.Spec != nil { + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a } if m.SecretVersion != nil { + { + size, err := m.SecretVersion.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintControl(dAtA, i, uint64(m.SecretVersion.Size())) - n26, err := m.SecretVersion.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n26 } - if m.Spec != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Spec.Size())) - n27, err := m.Spec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n27 + if len(m.SecretID) > 0 { + i -= len(m.SecretID) + copy(dAtA[i:], m.SecretID) + i = encodeVarintControl(dAtA, i, uint64(len(m.SecretID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *UpdateSecretResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -9009,27 +9354,34 @@ func (m *UpdateSecretResponse) Marshal() (dAtA []byte, err error) { } func (m *UpdateSecretResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateSecretResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Secret != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Secret.Size())) - n28, err := m.Secret.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Secret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n28 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ListSecretsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -9037,27 +9389,34 @@ func (m *ListSecretsRequest) Marshal() (dAtA []byte, err error) { } func (m *ListSecretsRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListSecretsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Filters != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Filters.Size())) - n29, err := m.Filters.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Filters.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n29 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ListSecretsRequest_Filters) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -9065,79 +9424,68 @@ func (m *ListSecretsRequest_Filters) Marshal() (dAtA []byte, err error) { } func (m *ListSecretsRequest_Filters) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListSecretsRequest_Filters) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Names) > 0 { - for _, s := range m.Names { - dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - if len(m.IDPrefixes) > 0 { - for _, s := range m.IDPrefixes { - dAtA[i] = 0x12 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if len(m.NamePrefixes) > 0 { + for iNdEx := len(m.NamePrefixes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.NamePrefixes[iNdEx]) + copy(dAtA[i:], m.NamePrefixes[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.NamePrefixes[iNdEx]))) + i-- + dAtA[i] = 0x22 } } if len(m.Labels) > 0 { - for k, _ := range m.Labels { - dAtA[i] = 0x1a - i++ + for k := range m.Labels { v := m.Labels[k] - mapSize := 1 + len(k) + sovControl(uint64(len(k))) + 1 + len(v) + sovControl(uint64(len(v))) - i = encodeVarintControl(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ + baseI := i + i -= len(v) + copy(dAtA[i:], v) i = encodeVarintControl(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintControl(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintControl(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1a } } - if len(m.NamePrefixes) > 0 { - for _, s := range m.NamePrefixes { - dAtA[i] = 0x22 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if len(m.IDPrefixes) > 0 { + for iNdEx := len(m.IDPrefixes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.IDPrefixes[iNdEx]) + copy(dAtA[i:], m.IDPrefixes[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.IDPrefixes[iNdEx]))) + i-- + dAtA[i] = 0x12 } } - return i, nil + if len(m.Names) > 0 { + for iNdEx := len(m.Names) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Names[iNdEx]) + copy(dAtA[i:], m.Names[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.Names[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil } func (m *ListSecretsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -9145,29 +9493,36 @@ func (m *ListSecretsResponse) Marshal() (dAtA []byte, err error) { } func (m *ListSecretsResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListSecretsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Secrets) > 0 { - for _, msg := range m.Secrets { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + 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 = encodeVarintControl(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - return i, nil + return len(dAtA) - i, nil } func (m *CreateSecretRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -9175,27 +9530,34 @@ func (m *CreateSecretRequest) Marshal() (dAtA []byte, err error) { } func (m *CreateSecretRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateSecretRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Spec != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Spec.Size())) - n30, err := m.Spec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n30 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *CreateSecretResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -9203,27 +9565,34 @@ func (m *CreateSecretResponse) Marshal() (dAtA []byte, err error) { } func (m *CreateSecretResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateSecretResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Secret != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Secret.Size())) - n31, err := m.Secret.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Secret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n31 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RemoveSecretRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -9231,23 +9600,29 @@ func (m *RemoveSecretRequest) Marshal() (dAtA []byte, err error) { } func (m *RemoveSecretRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemoveSecretRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.SecretID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.SecretID) + copy(dAtA[i:], m.SecretID) i = encodeVarintControl(dAtA, i, uint64(len(m.SecretID))) - i += copy(dAtA[i:], m.SecretID) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RemoveSecretResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -9255,17 +9630,22 @@ func (m *RemoveSecretResponse) Marshal() (dAtA []byte, err error) { } func (m *RemoveSecretResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemoveSecretResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + return len(dAtA) - i, nil } func (m *GetConfigRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -9273,23 +9653,29 @@ func (m *GetConfigRequest) Marshal() (dAtA []byte, err error) { } func (m *GetConfigRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetConfigRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.ConfigID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.ConfigID) + copy(dAtA[i:], m.ConfigID) i = encodeVarintControl(dAtA, i, uint64(len(m.ConfigID))) - i += copy(dAtA[i:], m.ConfigID) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetConfigResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -9297,27 +9683,34 @@ func (m *GetConfigResponse) Marshal() (dAtA []byte, err error) { } func (m *GetConfigResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetConfigResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Config != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Config.Size())) - n32, err := m.Config.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Config.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n32 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *UpdateConfigRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -9325,43 +9718,53 @@ func (m *UpdateConfigRequest) Marshal() (dAtA []byte, err error) { } func (m *UpdateConfigRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateConfigRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ConfigID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(m.ConfigID))) - i += copy(dAtA[i:], m.ConfigID) + if m.Spec != nil { + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a } if m.ConfigVersion != nil { + { + size, err := m.ConfigVersion.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintControl(dAtA, i, uint64(m.ConfigVersion.Size())) - n33, err := m.ConfigVersion.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n33 } - if m.Spec != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Spec.Size())) - n34, err := m.Spec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n34 + if len(m.ConfigID) > 0 { + i -= len(m.ConfigID) + copy(dAtA[i:], m.ConfigID) + i = encodeVarintControl(dAtA, i, uint64(len(m.ConfigID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *UpdateConfigResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -9369,27 +9772,34 @@ func (m *UpdateConfigResponse) Marshal() (dAtA []byte, err error) { } func (m *UpdateConfigResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateConfigResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Config != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Config.Size())) - n35, err := m.Config.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Config.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n35 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ListConfigsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -9397,27 +9807,34 @@ func (m *ListConfigsRequest) Marshal() (dAtA []byte, err error) { } func (m *ListConfigsRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListConfigsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Filters != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Filters.Size())) - n36, err := m.Filters.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Filters.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n36 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ListConfigsRequest_Filters) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -9425,79 +9842,68 @@ func (m *ListConfigsRequest_Filters) Marshal() (dAtA []byte, err error) { } func (m *ListConfigsRequest_Filters) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListConfigsRequest_Filters) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Names) > 0 { - for _, s := range m.Names { - dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - if len(m.IDPrefixes) > 0 { - for _, s := range m.IDPrefixes { - dAtA[i] = 0x12 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if len(m.NamePrefixes) > 0 { + for iNdEx := len(m.NamePrefixes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.NamePrefixes[iNdEx]) + copy(dAtA[i:], m.NamePrefixes[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.NamePrefixes[iNdEx]))) + i-- + dAtA[i] = 0x22 } } if len(m.Labels) > 0 { - for k, _ := range m.Labels { - dAtA[i] = 0x1a - i++ + for k := range m.Labels { v := m.Labels[k] - mapSize := 1 + len(k) + sovControl(uint64(len(k))) + 1 + len(v) + sovControl(uint64(len(v))) - i = encodeVarintControl(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ + baseI := i + i -= len(v) + copy(dAtA[i:], v) i = encodeVarintControl(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintControl(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintControl(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1a } } - if len(m.NamePrefixes) > 0 { - for _, s := range m.NamePrefixes { - dAtA[i] = 0x22 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if len(m.IDPrefixes) > 0 { + for iNdEx := len(m.IDPrefixes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.IDPrefixes[iNdEx]) + copy(dAtA[i:], m.IDPrefixes[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.IDPrefixes[iNdEx]))) + i-- + dAtA[i] = 0x12 } } - return i, nil + if len(m.Names) > 0 { + for iNdEx := len(m.Names) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Names[iNdEx]) + copy(dAtA[i:], m.Names[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.Names[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil } func (m *ListConfigsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -9505,29 +9911,36 @@ func (m *ListConfigsResponse) Marshal() (dAtA []byte, err error) { } func (m *ListConfigsResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListConfigsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Configs) > 0 { - for _, msg := range m.Configs { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + 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 = encodeVarintControl(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - return i, nil + return len(dAtA) - i, nil } func (m *CreateConfigRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -9535,27 +9948,34 @@ func (m *CreateConfigRequest) Marshal() (dAtA []byte, err error) { } func (m *CreateConfigRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateConfigRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Spec != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Spec.Size())) - n37, err := m.Spec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n37 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *CreateConfigResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -9563,27 +9983,34 @@ func (m *CreateConfigResponse) Marshal() (dAtA []byte, err error) { } func (m *CreateConfigResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateConfigResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Config != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Config.Size())) - n38, err := m.Config.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Config.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n38 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RemoveConfigRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -9591,23 +10018,29 @@ func (m *RemoveConfigRequest) Marshal() (dAtA []byte, err error) { } func (m *RemoveConfigRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemoveConfigRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.ConfigID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.ConfigID) + copy(dAtA[i:], m.ConfigID) i = encodeVarintControl(dAtA, i, uint64(len(m.ConfigID))) - i += copy(dAtA[i:], m.ConfigID) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RemoveConfigResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -9615,17 +10048,22 @@ func (m *RemoveConfigResponse) Marshal() (dAtA []byte, err error) { } func (m *RemoveConfigResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemoveConfigResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + return len(dAtA) - i, nil } func (m *CreateExtensionRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -9633,33 +10071,41 @@ func (m *CreateExtensionRequest) Marshal() (dAtA []byte, err error) { } func (m *CreateExtensionRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateExtensionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Annotations != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Annotations.Size())) - n39, err := m.Annotations.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n39 - } if len(m.Description) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Description) + copy(dAtA[i:], m.Description) i = encodeVarintControl(dAtA, i, uint64(len(m.Description))) - i += copy(dAtA[i:], m.Description) + i-- + dAtA[i] = 0x12 } - return i, nil + if m.Annotations != nil { + { + size, err := m.Annotations.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *CreateExtensionResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -9667,27 +10113,34 @@ func (m *CreateExtensionResponse) Marshal() (dAtA []byte, err error) { } func (m *CreateExtensionResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateExtensionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Extension != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Extension.Size())) - n40, err := m.Extension.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Extension.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n40 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RemoveExtensionRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -9695,23 +10148,29 @@ func (m *RemoveExtensionRequest) Marshal() (dAtA []byte, err error) { } func (m *RemoveExtensionRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemoveExtensionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.ExtensionID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.ExtensionID) + copy(dAtA[i:], m.ExtensionID) i = encodeVarintControl(dAtA, i, uint64(len(m.ExtensionID))) - i += copy(dAtA[i:], m.ExtensionID) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RemoveExtensionResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -9719,17 +10178,22 @@ func (m *RemoveExtensionResponse) Marshal() (dAtA []byte, err error) { } func (m *RemoveExtensionResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemoveExtensionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + return len(dAtA) - i, nil } func (m *GetExtensionRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -9737,23 +10201,29 @@ func (m *GetExtensionRequest) Marshal() (dAtA []byte, err error) { } func (m *GetExtensionRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetExtensionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.ExtensionID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.ExtensionID) + copy(dAtA[i:], m.ExtensionID) i = encodeVarintControl(dAtA, i, uint64(len(m.ExtensionID))) - i += copy(dAtA[i:], m.ExtensionID) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetExtensionResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -9761,27 +10231,34 @@ func (m *GetExtensionResponse) Marshal() (dAtA []byte, err error) { } func (m *GetExtensionResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetExtensionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Extension != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Extension.Size())) - n41, err := m.Extension.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Extension.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n41 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *CreateResourceRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -9789,43 +10266,53 @@ func (m *CreateResourceRequest) Marshal() (dAtA []byte, err error) { } func (m *CreateResourceRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateResourceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Annotations != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Annotations.Size())) - n42, err := m.Annotations.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.Payload != nil { + { + size, err := m.Payload.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n42 + i-- + dAtA[i] = 0x1a } if len(m.Kind) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Kind) + copy(dAtA[i:], m.Kind) i = encodeVarintControl(dAtA, i, uint64(len(m.Kind))) - i += copy(dAtA[i:], m.Kind) + i-- + dAtA[i] = 0x12 } - if m.Payload != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Payload.Size())) - n43, err := m.Payload.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.Annotations != nil { + { + size, err := m.Annotations.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n43 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *CreateResourceResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -9833,27 +10320,34 @@ func (m *CreateResourceResponse) Marshal() (dAtA []byte, err error) { } func (m *CreateResourceResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateResourceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Resource != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Resource.Size())) - n44, err := m.Resource.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Resource.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n44 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RemoveResourceRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -9861,23 +10355,29 @@ func (m *RemoveResourceRequest) Marshal() (dAtA []byte, err error) { } func (m *RemoveResourceRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemoveResourceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.ResourceID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.ResourceID) + copy(dAtA[i:], m.ResourceID) i = encodeVarintControl(dAtA, i, uint64(len(m.ResourceID))) - i += copy(dAtA[i:], m.ResourceID) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RemoveResourceResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -9885,17 +10385,22 @@ func (m *RemoveResourceResponse) Marshal() (dAtA []byte, err error) { } func (m *RemoveResourceResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemoveResourceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + return len(dAtA) - i, nil } func (m *UpdateResourceRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -9903,53 +10408,65 @@ func (m *UpdateResourceRequest) Marshal() (dAtA []byte, err error) { } func (m *UpdateResourceRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateResourceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ResourceID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(m.ResourceID))) - i += copy(dAtA[i:], m.ResourceID) - } - if m.ResourceVersion != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintControl(dAtA, i, uint64(m.ResourceVersion.Size())) - n45, err := m.ResourceVersion.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.Payload != nil { + { + size, err := m.Payload.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n45 + i-- + dAtA[i] = 0x22 } if m.Annotations != nil { + { + size, err := m.Annotations.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x1a - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Annotations.Size())) - n46, err := m.Annotations.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n46 } - if m.Payload != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Payload.Size())) - n47, err := m.Payload.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.ResourceVersion != nil { + { + size, err := m.ResourceVersion.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n47 + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.ResourceID) > 0 { + i -= len(m.ResourceID) + copy(dAtA[i:], m.ResourceID) + i = encodeVarintControl(dAtA, i, uint64(len(m.ResourceID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *UpdateResourceResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -9957,27 +10474,34 @@ func (m *UpdateResourceResponse) Marshal() (dAtA []byte, err error) { } func (m *UpdateResourceResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateResourceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Resource != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Resource.Size())) - n48, err := m.Resource.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Resource.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n48 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetResourceRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -9985,23 +10509,29 @@ func (m *GetResourceRequest) Marshal() (dAtA []byte, err error) { } func (m *GetResourceRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetResourceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.ResourceID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.ResourceID) + copy(dAtA[i:], m.ResourceID) i = encodeVarintControl(dAtA, i, uint64(len(m.ResourceID))) - i += copy(dAtA[i:], m.ResourceID) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetResourceResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -10009,27 +10539,34 @@ func (m *GetResourceResponse) Marshal() (dAtA []byte, err error) { } func (m *GetResourceResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetResourceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Resource != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Resource.Size())) - n49, err := m.Resource.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Resource.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n49 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ListResourcesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -10037,27 +10574,34 @@ func (m *ListResourcesRequest) Marshal() (dAtA []byte, err error) { } func (m *ListResourcesRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListResourcesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Filters != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(m.Filters.Size())) - n50, err := m.Filters.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Filters.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintControl(dAtA, i, uint64(size)) } - i += n50 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ListResourcesRequest_Filters) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -10065,85 +10609,75 @@ func (m *ListResourcesRequest_Filters) Marshal() (dAtA []byte, err error) { } func (m *ListResourcesRequest_Filters) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListResourcesRequest_Filters) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Names) > 0 { - for _, s := range m.Names { - dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } + if len(m.Kind) > 0 { + i -= len(m.Kind) + copy(dAtA[i:], m.Kind) + i = encodeVarintControl(dAtA, i, uint64(len(m.Kind))) + i-- + dAtA[i] = 0x2a } - if len(m.IDPrefixes) > 0 { - for _, s := range m.IDPrefixes { - dAtA[i] = 0x12 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if len(m.NamePrefixes) > 0 { + for iNdEx := len(m.NamePrefixes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.NamePrefixes[iNdEx]) + copy(dAtA[i:], m.NamePrefixes[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.NamePrefixes[iNdEx]))) + i-- + dAtA[i] = 0x22 } } if len(m.Labels) > 0 { - for k, _ := range m.Labels { - dAtA[i] = 0x1a - i++ + for k := range m.Labels { v := m.Labels[k] - mapSize := 1 + len(k) + sovControl(uint64(len(k))) + 1 + len(v) + sovControl(uint64(len(v))) - i = encodeVarintControl(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ + baseI := i + i -= len(v) + copy(dAtA[i:], v) i = encodeVarintControl(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintControl(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintControl(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1a } } - if len(m.NamePrefixes) > 0 { - for _, s := range m.NamePrefixes { - dAtA[i] = 0x22 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if len(m.IDPrefixes) > 0 { + for iNdEx := len(m.IDPrefixes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.IDPrefixes[iNdEx]) + copy(dAtA[i:], m.IDPrefixes[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.IDPrefixes[iNdEx]))) + i-- + dAtA[i] = 0x12 } } - if len(m.Kind) > 0 { - dAtA[i] = 0x2a - i++ - i = encodeVarintControl(dAtA, i, uint64(len(m.Kind))) - i += copy(dAtA[i:], m.Kind) + if len(m.Names) > 0 { + for iNdEx := len(m.Names) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Names[iNdEx]) + copy(dAtA[i:], m.Names[iNdEx]) + i = encodeVarintControl(dAtA, i, uint64(len(m.Names[iNdEx]))) + i-- + dAtA[i] = 0xa + } } - return i, nil + return len(dAtA) - i, nil } func (m *ListResourcesResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -10151,33 +10685,42 @@ func (m *ListResourcesResponse) Marshal() (dAtA []byte, err error) { } func (m *ListResourcesResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListResourcesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Resources) > 0 { - for _, msg := range m.Resources { - dAtA[i] = 0xa - i++ - i = encodeVarintControl(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + 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 = encodeVarintControl(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - return i, nil + return len(dAtA) - i, nil } func encodeVarintControl(dAtA []byte, offset int, v uint64) int { + offset -= sovControl(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } type raftProxyControlServer struct { @@ -13016,14 +13559,7 @@ func (m *ListResourcesResponse) Size() (n int) { } func sovControl(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozControl(x uint64) (n int) { return sovControl(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -13098,8 +13634,13 @@ func (this *ListNodesResponse) String() string { if this == nil { return "nil" } + repeatedStringForNodes := "[]*Node{" + for _, f := range this.Nodes { + repeatedStringForNodes += strings.Replace(fmt.Sprintf("%v", f), "Node", "Node", 1) + "," + } + repeatedStringForNodes += "}" s := strings.Join([]string{`&ListNodesResponse{`, - `Nodes:` + strings.Replace(fmt.Sprintf("%v", this.Nodes), "Node", "Node", 1) + `,`, + `Nodes:` + repeatedStringForNodes + `,`, `}`, }, "") return s @@ -13227,8 +13768,13 @@ func (this *ListTasksResponse) String() string { if this == nil { return "nil" } + repeatedStringForTasks := "[]*Task{" + for _, f := range this.Tasks { + repeatedStringForTasks += strings.Replace(fmt.Sprintf("%v", f), "Task", "Task", 1) + "," + } + repeatedStringForTasks += "}" s := strings.Join([]string{`&ListTasksResponse{`, - `Tasks:` + strings.Replace(fmt.Sprintf("%v", this.Tasks), "Task", "Task", 1) + `,`, + `Tasks:` + repeatedStringForTasks + `,`, `}`, }, "") return s @@ -13354,8 +13900,13 @@ func (this *ListServicesResponse) String() string { if this == nil { return "nil" } + repeatedStringForServices := "[]*Service{" + for _, f := range this.Services { + repeatedStringForServices += strings.Replace(fmt.Sprintf("%v", f), "Service", "Service", 1) + "," + } + repeatedStringForServices += "}" s := strings.Join([]string{`&ListServicesResponse{`, - `Services:` + strings.Replace(fmt.Sprintf("%v", this.Services), "Service", "Service", 1) + `,`, + `Services:` + repeatedStringForServices + `,`, `}`, }, "") return s @@ -13374,8 +13925,13 @@ func (this *ListServiceStatusesResponse) String() string { if this == nil { return "nil" } + repeatedStringForStatuses := "[]*ListServiceStatusesResponse_ServiceStatus{" + for _, f := range this.Statuses { + repeatedStringForStatuses += strings.Replace(fmt.Sprintf("%v", f), "ListServiceStatusesResponse_ServiceStatus", "ListServiceStatusesResponse_ServiceStatus", 1) + "," + } + repeatedStringForStatuses += "}" s := strings.Join([]string{`&ListServiceStatusesResponse{`, - `Statuses:` + strings.Replace(fmt.Sprintf("%v", this.Statuses), "ListServiceStatusesResponse_ServiceStatus", "ListServiceStatusesResponse_ServiceStatus", 1) + `,`, + `Statuses:` + repeatedStringForStatuses + `,`, `}`, }, "") return s @@ -13491,8 +14047,13 @@ func (this *ListNetworksResponse) String() string { if this == nil { return "nil" } + repeatedStringForNetworks := "[]*Network{" + for _, f := range this.Networks { + repeatedStringForNetworks += strings.Replace(fmt.Sprintf("%v", f), "Network", "Network", 1) + "," + } + repeatedStringForNetworks += "}" s := strings.Join([]string{`&ListNetworksResponse{`, - `Networks:` + strings.Replace(fmt.Sprintf("%v", this.Networks), "Network", "Network", 1) + `,`, + `Networks:` + repeatedStringForNetworks + `,`, `}`, }, "") return s @@ -13554,8 +14115,13 @@ func (this *ListClustersResponse) String() string { if this == nil { return "nil" } + repeatedStringForClusters := "[]*Cluster{" + for _, f := range this.Clusters { + repeatedStringForClusters += strings.Replace(fmt.Sprintf("%v", f), "Cluster", "Cluster", 1) + "," + } + repeatedStringForClusters += "}" s := strings.Join([]string{`&ListClustersResponse{`, - `Clusters:` + strings.Replace(fmt.Sprintf("%v", this.Clusters), "Cluster", "Cluster", 1) + `,`, + `Clusters:` + repeatedStringForClusters + `,`, `}`, }, "") return s @@ -13674,8 +14240,13 @@ func (this *ListSecretsResponse) String() string { if this == nil { return "nil" } + repeatedStringForSecrets := "[]*Secret{" + for _, f := range this.Secrets { + repeatedStringForSecrets += strings.Replace(fmt.Sprintf("%v", f), "Secret", "Secret", 1) + "," + } + repeatedStringForSecrets += "}" s := strings.Join([]string{`&ListSecretsResponse{`, - `Secrets:` + strings.Replace(fmt.Sprintf("%v", this.Secrets), "Secret", "Secret", 1) + `,`, + `Secrets:` + repeatedStringForSecrets + `,`, `}`, }, "") return s @@ -13798,8 +14369,13 @@ func (this *ListConfigsResponse) String() string { if this == nil { return "nil" } + repeatedStringForConfigs := "[]*Config{" + for _, f := range this.Configs { + repeatedStringForConfigs += strings.Replace(fmt.Sprintf("%v", f), "Config", "Config", 1) + "," + } + repeatedStringForConfigs += "}" s := strings.Join([]string{`&ListConfigsResponse{`, - `Configs:` + strings.Replace(fmt.Sprintf("%v", this.Configs), "Config", "Config", 1) + `,`, + `Configs:` + repeatedStringForConfigs + `,`, `}`, }, "") return s @@ -14025,8 +14601,13 @@ func (this *ListResourcesResponse) String() string { if this == nil { return "nil" } + repeatedStringForResources := "[]*Resource{" + for _, f := range this.Resources { + repeatedStringForResources += strings.Replace(fmt.Sprintf("%v", f), "Resource", "Resource", 1) + "," + } + repeatedStringForResources += "}" s := strings.Join([]string{`&ListResourcesResponse{`, - `Resources:` + strings.Replace(fmt.Sprintf("%v", this.Resources), "Resource", "Resource", 1) + `,`, + `Resources:` + repeatedStringForResources + `,`, `}`, }, "") return s @@ -14106,10 +14687,7 @@ func (m *GetNodeRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -14195,10 +14773,7 @@ func (m *GetNodeResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -14284,10 +14859,7 @@ func (m *ListNodesRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -14511,7 +15083,7 @@ func (m *ListNodesRequest_Filters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > postIndex { @@ -14808,7 +15380,7 @@ func (m *ListNodesRequest_Filters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > postIndex { @@ -14825,10 +15397,7 @@ func (m *ListNodesRequest_Filters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -14912,10 +15481,7 @@ func (m *ListNodesResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -15069,10 +15635,7 @@ func (m *UpdateNodeRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -15158,10 +15721,7 @@ func (m *UpdateNodeResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -15263,10 +15823,7 @@ func (m *RemoveNodeRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -15316,10 +15873,7 @@ func (m *RemoveNodeResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -15401,10 +15955,7 @@ func (m *GetTaskRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -15490,10 +16041,7 @@ func (m *GetTaskResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -15575,10 +16123,7 @@ func (m *RemoveTaskRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -15628,10 +16173,7 @@ func (m *RemoveTaskResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -15717,10 +16259,7 @@ func (m *ListTasksRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -15944,7 +16483,7 @@ func (m *ListTasksRequest_Filters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > postIndex { @@ -16178,10 +16717,7 @@ func (m *ListTasksRequest_Filters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -16265,10 +16801,7 @@ func (m *ListTasksResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -16354,10 +16887,7 @@ func (m *CreateServiceRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -16443,10 +16973,7 @@ func (m *CreateServiceResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -16548,10 +17075,7 @@ func (m *GetServiceRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -16637,10 +17161,7 @@ func (m *GetServiceResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -16813,10 +17334,7 @@ func (m *UpdateServiceRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -16902,10 +17420,7 @@ func (m *UpdateServiceResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -16987,10 +17502,7 @@ func (m *RemoveServiceRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -17040,10 +17552,7 @@ func (m *RemoveServiceResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -17129,10 +17638,7 @@ func (m *ListServicesRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -17356,7 +17862,7 @@ func (m *ListServicesRequest_Filters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > postIndex { @@ -17437,10 +17943,7 @@ func (m *ListServicesRequest_Filters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -17524,10 +18027,7 @@ func (m *ListServicesResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -17609,10 +18109,7 @@ func (m *ListServiceStatusesRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -17696,10 +18193,7 @@ func (m *ListServiceStatusesResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -17838,10 +18332,7 @@ func (m *ListServiceStatusesResponse_ServiceStatus) Unmarshal(dAtA []byte) error if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -17927,10 +18418,7 @@ func (m *CreateNetworkRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -18016,10 +18504,7 @@ func (m *CreateNetworkResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -18133,10 +18618,7 @@ func (m *GetNetworkRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -18222,10 +18704,7 @@ func (m *GetNetworkResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -18339,10 +18818,7 @@ func (m *RemoveNetworkRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -18392,10 +18868,7 @@ func (m *RemoveNetworkResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -18481,10 +18954,7 @@ func (m *ListNetworksRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -18708,7 +19178,7 @@ func (m *ListNetworksRequest_Filters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > postIndex { @@ -18757,10 +19227,7 @@ func (m *ListNetworksRequest_Filters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -18844,10 +19311,7 @@ func (m *ListNetworksResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -18929,10 +19393,7 @@ func (m *GetClusterRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -19018,10 +19479,7 @@ func (m *GetClusterResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -19107,10 +19565,7 @@ func (m *ListClustersRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -19334,7 +19789,7 @@ func (m *ListClustersRequest_Filters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > postIndex { @@ -19383,10 +19838,7 @@ func (m *ListClustersRequest_Filters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -19470,10 +19922,7 @@ func (m *ListClustersResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -19583,10 +20032,7 @@ func (m *KeyRotation) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -19773,10 +20219,7 @@ func (m *UpdateClusterRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -19862,10 +20305,7 @@ func (m *UpdateClusterResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -19947,10 +20387,7 @@ func (m *GetSecretRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -20036,10 +20473,7 @@ func (m *GetSecretResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -20193,10 +20627,7 @@ func (m *UpdateSecretRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -20282,10 +20713,7 @@ func (m *UpdateSecretResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -20371,10 +20799,7 @@ func (m *ListSecretsRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -20598,7 +21023,7 @@ func (m *ListSecretsRequest_Filters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > postIndex { @@ -20647,10 +21072,7 @@ func (m *ListSecretsRequest_Filters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -20734,10 +21156,7 @@ func (m *ListSecretsResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -20823,10 +21242,7 @@ func (m *CreateSecretRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -20912,10 +21328,7 @@ func (m *CreateSecretResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -20997,10 +21410,7 @@ func (m *RemoveSecretRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -21050,10 +21460,7 @@ func (m *RemoveSecretResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -21135,10 +21542,7 @@ func (m *GetConfigRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -21224,10 +21628,7 @@ func (m *GetConfigResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -21381,10 +21782,7 @@ func (m *UpdateConfigRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -21470,10 +21868,7 @@ func (m *UpdateConfigResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -21559,10 +21954,7 @@ func (m *ListConfigsRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -21786,7 +22178,7 @@ func (m *ListConfigsRequest_Filters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > postIndex { @@ -21835,10 +22227,7 @@ func (m *ListConfigsRequest_Filters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -21922,10 +22311,7 @@ func (m *ListConfigsResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -22011,10 +22397,7 @@ func (m *CreateConfigRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -22100,10 +22483,7 @@ func (m *CreateConfigResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -22185,10 +22565,7 @@ func (m *RemoveConfigRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -22238,10 +22615,7 @@ func (m *RemoveConfigResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -22359,10 +22733,7 @@ func (m *CreateExtensionRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -22448,10 +22819,7 @@ func (m *CreateExtensionResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -22533,10 +22901,7 @@ func (m *RemoveExtensionRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -22586,10 +22951,7 @@ func (m *RemoveExtensionResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -22671,10 +23033,7 @@ func (m *GetExtensionRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -22760,10 +23119,7 @@ func (m *GetExtensionResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -22917,10 +23273,7 @@ func (m *CreateResourceRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -23006,10 +23359,7 @@ func (m *CreateResourceResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -23091,10 +23441,7 @@ func (m *RemoveResourceRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -23144,10 +23491,7 @@ func (m *RemoveResourceResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -23337,10 +23681,7 @@ func (m *UpdateResourceRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -23426,10 +23767,7 @@ func (m *UpdateResourceResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -23511,10 +23849,7 @@ func (m *GetResourceRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -23600,10 +23935,7 @@ func (m *GetResourceResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -23689,10 +24021,7 @@ func (m *ListResourcesRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -23916,7 +24245,7 @@ func (m *ListResourcesRequest_Filters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > postIndex { @@ -23997,10 +24326,7 @@ func (m *ListResourcesRequest_Filters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -24084,10 +24410,7 @@ func (m *ListResourcesResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthControl - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthControl } if (iNdEx + skippy) > l { @@ -24105,6 +24428,7 @@ func (m *ListResourcesResponse) Unmarshal(dAtA []byte) error { func skipControl(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -24136,10 +24460,8 @@ func skipControl(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -24160,55 +24482,30 @@ func skipControl(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthControl } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthControl - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowControl - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipControl(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthControl - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupControl + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthControl + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthControl = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowControl = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthControl = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowControl = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupControl = fmt.Errorf("proto: unexpected end of group") ) diff --git a/vendor/github.com/docker/swarmkit/api/dispatcher.pb.go b/vendor/github.com/docker/swarmkit/api/dispatcher.pb.go index 3d76cbf8a7..96b13a1218 100644 --- a/vendor/github.com/docker/swarmkit/api/dispatcher.pb.go +++ b/vendor/github.com/docker/swarmkit/api/dispatcher.pb.go @@ -20,6 +20,7 @@ import ( status "google.golang.org/grpc/status" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" rafttime "time" @@ -36,7 +37,7 @@ var _ = time.Kitchen // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type AssignmentChange_AssignmentAction int32 @@ -113,7 +114,7 @@ func (m *SessionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return xxx_messageInfo_SessionRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -203,7 +204,7 @@ func (m *SessionMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return xxx_messageInfo_SessionMessage.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -240,7 +241,7 @@ func (m *HeartbeatRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_HeartbeatRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -278,7 +279,7 @@ func (m *HeartbeatResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_HeartbeatResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -317,7 +318,7 @@ func (m *UpdateTaskStatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]b return xxx_messageInfo_UpdateTaskStatusRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -356,7 +357,7 @@ func (m *UpdateTaskStatusRequest_TaskStatusUpdate) XXX_Marshal(b []byte, determi return xxx_messageInfo_UpdateTaskStatusRequest_TaskStatusUpdate.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -391,7 +392,7 @@ func (m *UpdateTaskStatusResponse) XXX_Marshal(b []byte, deterministic bool) ([] return xxx_messageInfo_UpdateTaskStatusResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -427,7 +428,7 @@ func (m *TasksRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_TasksRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -465,7 +466,7 @@ func (m *TasksMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_TasksMessage.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -501,7 +502,7 @@ func (m *AssignmentsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_AssignmentsRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -541,7 +542,7 @@ func (m *Assignment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Assignment.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -567,13 +568,13 @@ type isAssignment_Item interface { } type Assignment_Task struct { - Task *Task `protobuf:"bytes,1,opt,name=task,proto3,oneof"` + Task *Task `protobuf:"bytes,1,opt,name=task,proto3,oneof" json:"task,omitempty"` } type Assignment_Secret struct { - Secret *Secret `protobuf:"bytes,2,opt,name=secret,proto3,oneof"` + Secret *Secret `protobuf:"bytes,2,opt,name=secret,proto3,oneof" json:"secret,omitempty"` } type Assignment_Config struct { - Config *Config `protobuf:"bytes,3,opt,name=config,proto3,oneof"` + Config *Config `protobuf:"bytes,3,opt,name=config,proto3,oneof" json:"config,omitempty"` } func (*Assignment_Task) isAssignment_Item() {} @@ -608,99 +609,15 @@ func (m *Assignment) GetConfig() *Config { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*Assignment) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _Assignment_OneofMarshaler, _Assignment_OneofUnmarshaler, _Assignment_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*Assignment) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*Assignment_Task)(nil), (*Assignment_Secret)(nil), (*Assignment_Config)(nil), } } -func _Assignment_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*Assignment) - // item - switch x := m.Item.(type) { - case *Assignment_Task: - _ = b.EncodeVarint(1<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Task); err != nil { - return err - } - case *Assignment_Secret: - _ = b.EncodeVarint(2<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Secret); err != nil { - return err - } - case *Assignment_Config: - _ = b.EncodeVarint(3<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Config); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("Assignment.Item has unexpected type %T", x) - } - return nil -} - -func _Assignment_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*Assignment) - switch tag { - case 1: // item.task - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Task) - err := b.DecodeMessage(msg) - m.Item = &Assignment_Task{msg} - return true, err - case 2: // item.secret - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Secret) - err := b.DecodeMessage(msg) - m.Item = &Assignment_Secret{msg} - return true, err - case 3: // item.config - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Config) - err := b.DecodeMessage(msg) - m.Item = &Assignment_Config{msg} - return true, err - default: - return false, nil - } -} - -func _Assignment_OneofSizer(msg proto.Message) (n int) { - m := msg.(*Assignment) - // item - switch x := m.Item.(type) { - case *Assignment_Task: - s := proto.Size(x.Task) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *Assignment_Secret: - s := proto.Size(x.Secret) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *Assignment_Config: - s := proto.Size(x.Config) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - type AssignmentChange struct { Assignment *Assignment `protobuf:"bytes,1,opt,name=assignment,proto3" json:"assignment,omitempty"` Action AssignmentChange_AssignmentAction `protobuf:"varint,2,opt,name=action,proto3,enum=docker.swarmkit.v1.AssignmentChange_AssignmentAction" json:"action,omitempty"` @@ -719,7 +636,7 @@ func (m *AssignmentChange) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_AssignmentChange.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -767,7 +684,7 @@ func (m *AssignmentsMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_AssignmentsMessage.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1401,6 +1318,26 @@ type DispatcherServer interface { Assignments(*AssignmentsRequest, Dispatcher_AssignmentsServer) error } +// UnimplementedDispatcherServer can be embedded to have forward compatible implementations. +type UnimplementedDispatcherServer struct { +} + +func (*UnimplementedDispatcherServer) Session(req *SessionRequest, srv Dispatcher_SessionServer) error { + return status.Errorf(codes.Unimplemented, "method Session not implemented") +} +func (*UnimplementedDispatcherServer) Heartbeat(ctx context.Context, req *HeartbeatRequest) (*HeartbeatResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Heartbeat not implemented") +} +func (*UnimplementedDispatcherServer) UpdateTaskStatus(ctx context.Context, req *UpdateTaskStatusRequest) (*UpdateTaskStatusResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateTaskStatus not implemented") +} +func (*UnimplementedDispatcherServer) Tasks(req *TasksRequest, srv Dispatcher_TasksServer) error { + return status.Errorf(codes.Unimplemented, "method Tasks not implemented") +} +func (*UnimplementedDispatcherServer) Assignments(req *AssignmentsRequest, srv Dispatcher_AssignmentsServer) error { + return status.Errorf(codes.Unimplemented, "method Assignments not implemented") +} + func RegisterDispatcherServer(s *grpc.Server, srv DispatcherServer) { s.RegisterService(&_Dispatcher_serviceDesc, srv) } @@ -1540,7 +1477,7 @@ var _Dispatcher_serviceDesc = grpc.ServiceDesc{ func (m *SessionRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1548,33 +1485,41 @@ func (m *SessionRequest) Marshal() (dAtA []byte, err error) { } func (m *SessionRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SessionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Description != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintDispatcher(dAtA, i, uint64(m.Description.Size())) - n1, err := m.Description.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 - } if len(m.SessionID) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.SessionID) + copy(dAtA[i:], m.SessionID) i = encodeVarintDispatcher(dAtA, i, uint64(len(m.SessionID))) - i += copy(dAtA[i:], m.SessionID) + i-- + dAtA[i] = 0x12 } - return i, nil + if m.Description != nil { + { + size, err := m.Description.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDispatcher(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *SessionMessage) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1582,63 +1527,76 @@ func (m *SessionMessage) Marshal() (dAtA []byte, err error) { } func (m *SessionMessage) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SessionMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.SessionID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintDispatcher(dAtA, i, uint64(len(m.SessionID))) - i += copy(dAtA[i:], m.SessionID) - } - if m.Node != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintDispatcher(dAtA, i, uint64(m.Node.Size())) - n2, err := m.Node.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n2 - } - if len(m.Managers) > 0 { - for _, msg := range m.Managers { - dAtA[i] = 0x1a - i++ - i = encodeVarintDispatcher(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } + if len(m.RootCA) > 0 { + i -= len(m.RootCA) + copy(dAtA[i:], m.RootCA) + i = encodeVarintDispatcher(dAtA, i, uint64(len(m.RootCA))) + i-- + dAtA[i] = 0x2a } if len(m.NetworkBootstrapKeys) > 0 { - for _, msg := range m.NetworkBootstrapKeys { + for iNdEx := len(m.NetworkBootstrapKeys) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.NetworkBootstrapKeys[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDispatcher(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x22 - i++ - i = encodeVarintDispatcher(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + } + } + if len(m.Managers) > 0 { + for iNdEx := len(m.Managers) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Managers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDispatcher(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if m.Node != nil { + { + size, err := m.Node.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintDispatcher(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x12 } - if len(m.RootCA) > 0 { - dAtA[i] = 0x2a - i++ - i = encodeVarintDispatcher(dAtA, i, uint64(len(m.RootCA))) - i += copy(dAtA[i:], m.RootCA) + if len(m.SessionID) > 0 { + i -= len(m.SessionID) + copy(dAtA[i:], m.SessionID) + i = encodeVarintDispatcher(dAtA, i, uint64(len(m.SessionID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *HeartbeatRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1646,23 +1604,29 @@ func (m *HeartbeatRequest) Marshal() (dAtA []byte, err error) { } func (m *HeartbeatRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HeartbeatRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.SessionID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.SessionID) + copy(dAtA[i:], m.SessionID) i = encodeVarintDispatcher(dAtA, i, uint64(len(m.SessionID))) - i += copy(dAtA[i:], m.SessionID) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *HeartbeatResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1670,25 +1634,30 @@ func (m *HeartbeatResponse) Marshal() (dAtA []byte, err error) { } func (m *HeartbeatResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HeartbeatResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintDispatcher(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(m.Period))) - n3, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Period, dAtA[i:]) - if err != nil { - return 0, err + n3, err3 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Period, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.Period):]) + if err3 != nil { + return 0, err3 } - i += n3 - return i, nil + i -= n3 + i = encodeVarintDispatcher(dAtA, i, uint64(n3)) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *UpdateTaskStatusRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1696,35 +1665,43 @@ func (m *UpdateTaskStatusRequest) Marshal() (dAtA []byte, err error) { } func (m *UpdateTaskStatusRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateTaskStatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.SessionID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintDispatcher(dAtA, i, uint64(len(m.SessionID))) - i += copy(dAtA[i:], m.SessionID) - } if len(m.Updates) > 0 { - for _, msg := range m.Updates { - dAtA[i] = 0x1a - i++ - i = encodeVarintDispatcher(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Updates) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Updates[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDispatcher(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x1a } } - return i, nil + if len(m.SessionID) > 0 { + i -= len(m.SessionID) + copy(dAtA[i:], m.SessionID) + i = encodeVarintDispatcher(dAtA, i, uint64(len(m.SessionID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *UpdateTaskStatusRequest_TaskStatusUpdate) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1732,33 +1709,41 @@ func (m *UpdateTaskStatusRequest_TaskStatusUpdate) Marshal() (dAtA []byte, err e } func (m *UpdateTaskStatusRequest_TaskStatusUpdate) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateTaskStatusRequest_TaskStatusUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.TaskID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintDispatcher(dAtA, i, uint64(len(m.TaskID))) - i += copy(dAtA[i:], m.TaskID) - } if m.Status != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintDispatcher(dAtA, i, uint64(m.Status.Size())) - n4, err := m.Status.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDispatcher(dAtA, i, uint64(size)) } - i += n4 + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.TaskID) > 0 { + i -= len(m.TaskID) + copy(dAtA[i:], m.TaskID) + i = encodeVarintDispatcher(dAtA, i, uint64(len(m.TaskID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *UpdateTaskStatusResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1766,17 +1751,22 @@ func (m *UpdateTaskStatusResponse) Marshal() (dAtA []byte, err error) { } func (m *UpdateTaskStatusResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateTaskStatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + return len(dAtA) - i, nil } func (m *TasksRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1784,23 +1774,29 @@ func (m *TasksRequest) Marshal() (dAtA []byte, err error) { } func (m *TasksRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TasksRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.SessionID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.SessionID) + copy(dAtA[i:], m.SessionID) i = encodeVarintDispatcher(dAtA, i, uint64(len(m.SessionID))) - i += copy(dAtA[i:], m.SessionID) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *TasksMessage) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1808,29 +1804,36 @@ func (m *TasksMessage) Marshal() (dAtA []byte, err error) { } func (m *TasksMessage) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TasksMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Tasks) > 0 { - for _, msg := range m.Tasks { - dAtA[i] = 0xa - i++ - i = encodeVarintDispatcher(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + 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 = encodeVarintDispatcher(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - return i, nil + return len(dAtA) - i, nil } func (m *AssignmentsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1838,23 +1841,29 @@ func (m *AssignmentsRequest) Marshal() (dAtA []byte, err error) { } func (m *AssignmentsRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AssignmentsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.SessionID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.SessionID) + copy(dAtA[i:], m.SessionID) i = encodeVarintDispatcher(dAtA, i, uint64(len(m.SessionID))) - i += copy(dAtA[i:], m.SessionID) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Assignment) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1862,66 +1871,94 @@ func (m *Assignment) Marshal() (dAtA []byte, err error) { } func (m *Assignment) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Assignment) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Item != nil { - nn5, err := m.Item.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.Item.Size() + i -= size + if _, err := m.Item.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn5 } - return i, nil + return len(dAtA) - i, nil } func (m *Assignment_Task) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Assignment_Task) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Task != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintDispatcher(dAtA, i, uint64(m.Task.Size())) - n6, err := m.Task.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Task.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDispatcher(dAtA, i, uint64(size)) } - i += n6 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Assignment_Secret) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Assignment_Secret) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Secret != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintDispatcher(dAtA, i, uint64(m.Secret.Size())) - n7, err := m.Secret.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Secret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDispatcher(dAtA, i, uint64(size)) } - i += n7 + i-- + dAtA[i] = 0x12 } - return i, nil + return len(dAtA) - i, nil } func (m *Assignment_Config) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Assignment_Config) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Config != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintDispatcher(dAtA, i, uint64(m.Config.Size())) - n8, err := m.Config.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Config.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDispatcher(dAtA, i, uint64(size)) } - i += n8 + i-- + dAtA[i] = 0x1a } - return i, nil + return len(dAtA) - i, nil } func (m *AssignmentChange) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1929,32 +1966,39 @@ func (m *AssignmentChange) Marshal() (dAtA []byte, err error) { } func (m *AssignmentChange) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AssignmentChange) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Assignment != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintDispatcher(dAtA, i, uint64(m.Assignment.Size())) - n9, err := m.Assignment.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n9 - } if m.Action != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintDispatcher(dAtA, i, uint64(m.Action)) + i-- + dAtA[i] = 0x10 } - return i, nil + if m.Assignment != nil { + { + size, err := m.Assignment.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDispatcher(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *AssignmentsMessage) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1962,50 +2006,61 @@ func (m *AssignmentsMessage) Marshal() (dAtA []byte, err error) { } func (m *AssignmentsMessage) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AssignmentsMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Type != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintDispatcher(dAtA, i, uint64(m.Type)) - } - if len(m.AppliesTo) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintDispatcher(dAtA, i, uint64(len(m.AppliesTo))) - i += copy(dAtA[i:], m.AppliesTo) - } - if len(m.ResultsIn) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintDispatcher(dAtA, i, uint64(len(m.ResultsIn))) - i += copy(dAtA[i:], m.ResultsIn) - } if len(m.Changes) > 0 { - for _, msg := range m.Changes { - dAtA[i] = 0x22 - i++ - i = encodeVarintDispatcher(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Changes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Changes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDispatcher(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x22 } } - return i, nil + if len(m.ResultsIn) > 0 { + i -= len(m.ResultsIn) + copy(dAtA[i:], m.ResultsIn) + i = encodeVarintDispatcher(dAtA, i, uint64(len(m.ResultsIn))) + i-- + dAtA[i] = 0x1a + } + if len(m.AppliesTo) > 0 { + i -= len(m.AppliesTo) + copy(dAtA[i:], m.AppliesTo) + i = encodeVarintDispatcher(dAtA, i, uint64(len(m.AppliesTo))) + i-- + dAtA[i] = 0x12 + } + if m.Type != 0 { + i = encodeVarintDispatcher(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func encodeVarintDispatcher(dAtA []byte, offset int, v uint64) int { + offset -= sovDispatcher(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } type raftProxyDispatcherServer struct { @@ -2554,14 +2609,7 @@ func (m *AssignmentsMessage) Size() (n int) { } func sovDispatcher(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozDispatcher(x uint64) (n int) { return sovDispatcher(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -2581,11 +2629,21 @@ func (this *SessionMessage) String() string { if this == nil { return "nil" } + repeatedStringForManagers := "[]*WeightedPeer{" + for _, f := range this.Managers { + repeatedStringForManagers += strings.Replace(fmt.Sprintf("%v", f), "WeightedPeer", "WeightedPeer", 1) + "," + } + repeatedStringForManagers += "}" + repeatedStringForNetworkBootstrapKeys := "[]*EncryptionKey{" + for _, f := range this.NetworkBootstrapKeys { + repeatedStringForNetworkBootstrapKeys += strings.Replace(fmt.Sprintf("%v", f), "EncryptionKey", "EncryptionKey", 1) + "," + } + repeatedStringForNetworkBootstrapKeys += "}" s := strings.Join([]string{`&SessionMessage{`, `SessionID:` + fmt.Sprintf("%v", this.SessionID) + `,`, `Node:` + strings.Replace(fmt.Sprintf("%v", this.Node), "Node", "Node", 1) + `,`, - `Managers:` + strings.Replace(fmt.Sprintf("%v", this.Managers), "WeightedPeer", "WeightedPeer", 1) + `,`, - `NetworkBootstrapKeys:` + strings.Replace(fmt.Sprintf("%v", this.NetworkBootstrapKeys), "EncryptionKey", "EncryptionKey", 1) + `,`, + `Managers:` + repeatedStringForManagers + `,`, + `NetworkBootstrapKeys:` + repeatedStringForNetworkBootstrapKeys + `,`, `RootCA:` + fmt.Sprintf("%v", this.RootCA) + `,`, `}`, }, "") @@ -2606,7 +2664,7 @@ func (this *HeartbeatResponse) String() string { return "nil" } s := strings.Join([]string{`&HeartbeatResponse{`, - `Period:` + strings.Replace(strings.Replace(this.Period.String(), "Duration", "types.Duration", 1), `&`, ``, 1) + `,`, + `Period:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Period), "Duration", "types.Duration", 1), `&`, ``, 1) + `,`, `}`, }, "") return s @@ -2615,9 +2673,14 @@ func (this *UpdateTaskStatusRequest) String() string { if this == nil { return "nil" } + repeatedStringForUpdates := "[]*UpdateTaskStatusRequest_TaskStatusUpdate{" + for _, f := range this.Updates { + repeatedStringForUpdates += strings.Replace(fmt.Sprintf("%v", f), "UpdateTaskStatusRequest_TaskStatusUpdate", "UpdateTaskStatusRequest_TaskStatusUpdate", 1) + "," + } + repeatedStringForUpdates += "}" s := strings.Join([]string{`&UpdateTaskStatusRequest{`, `SessionID:` + fmt.Sprintf("%v", this.SessionID) + `,`, - `Updates:` + strings.Replace(fmt.Sprintf("%v", this.Updates), "UpdateTaskStatusRequest_TaskStatusUpdate", "UpdateTaskStatusRequest_TaskStatusUpdate", 1) + `,`, + `Updates:` + repeatedStringForUpdates + `,`, `}`, }, "") return s @@ -2656,8 +2719,13 @@ func (this *TasksMessage) String() string { if this == nil { return "nil" } + repeatedStringForTasks := "[]*Task{" + for _, f := range this.Tasks { + repeatedStringForTasks += strings.Replace(fmt.Sprintf("%v", f), "Task", "Task", 1) + "," + } + repeatedStringForTasks += "}" s := strings.Join([]string{`&TasksMessage{`, - `Tasks:` + strings.Replace(fmt.Sprintf("%v", this.Tasks), "Task", "Task", 1) + `,`, + `Tasks:` + repeatedStringForTasks + `,`, `}`, }, "") return s @@ -2717,7 +2785,7 @@ func (this *AssignmentChange) String() string { return "nil" } s := strings.Join([]string{`&AssignmentChange{`, - `Assignment:` + strings.Replace(fmt.Sprintf("%v", this.Assignment), "Assignment", "Assignment", 1) + `,`, + `Assignment:` + strings.Replace(this.Assignment.String(), "Assignment", "Assignment", 1) + `,`, `Action:` + fmt.Sprintf("%v", this.Action) + `,`, `}`, }, "") @@ -2727,11 +2795,16 @@ func (this *AssignmentsMessage) String() string { if this == nil { return "nil" } + repeatedStringForChanges := "[]*AssignmentChange{" + for _, f := range this.Changes { + repeatedStringForChanges += strings.Replace(f.String(), "AssignmentChange", "AssignmentChange", 1) + "," + } + repeatedStringForChanges += "}" s := strings.Join([]string{`&AssignmentsMessage{`, `Type:` + fmt.Sprintf("%v", this.Type) + `,`, `AppliesTo:` + fmt.Sprintf("%v", this.AppliesTo) + `,`, `ResultsIn:` + fmt.Sprintf("%v", this.ResultsIn) + `,`, - `Changes:` + strings.Replace(fmt.Sprintf("%v", this.Changes), "AssignmentChange", "AssignmentChange", 1) + `,`, + `Changes:` + repeatedStringForChanges + `,`, `}`, }, "") return s @@ -2847,10 +2920,7 @@ func (m *SessionRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthDispatcher - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthDispatcher } if (iNdEx + skippy) > l { @@ -3070,10 +3140,7 @@ func (m *SessionMessage) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthDispatcher - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthDispatcher } if (iNdEx + skippy) > l { @@ -3155,10 +3222,7 @@ func (m *HeartbeatRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthDispatcher - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthDispatcher } if (iNdEx + skippy) > l { @@ -3241,10 +3305,7 @@ func (m *HeartbeatResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthDispatcher - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthDispatcher } if (iNdEx + skippy) > l { @@ -3360,10 +3421,7 @@ func (m *UpdateTaskStatusRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthDispatcher - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthDispatcher } if (iNdEx + skippy) > l { @@ -3481,10 +3539,7 @@ func (m *UpdateTaskStatusRequest_TaskStatusUpdate) Unmarshal(dAtA []byte) error if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthDispatcher - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthDispatcher } if (iNdEx + skippy) > l { @@ -3534,10 +3589,7 @@ func (m *UpdateTaskStatusResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthDispatcher - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthDispatcher } if (iNdEx + skippy) > l { @@ -3619,10 +3671,7 @@ func (m *TasksRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthDispatcher - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthDispatcher } if (iNdEx + skippy) > l { @@ -3706,10 +3755,7 @@ func (m *TasksMessage) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthDispatcher - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthDispatcher } if (iNdEx + skippy) > l { @@ -3791,10 +3837,7 @@ func (m *AssignmentsRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthDispatcher - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthDispatcher } if (iNdEx + skippy) > l { @@ -3949,10 +3992,7 @@ func (m *Assignment) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthDispatcher - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthDispatcher } if (iNdEx + skippy) > l { @@ -4057,10 +4097,7 @@ func (m *AssignmentChange) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthDispatcher - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthDispatcher } if (iNdEx + skippy) > l { @@ -4227,10 +4264,7 @@ func (m *AssignmentsMessage) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthDispatcher - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthDispatcher } if (iNdEx + skippy) > l { @@ -4248,6 +4282,7 @@ func (m *AssignmentsMessage) Unmarshal(dAtA []byte) error { func skipDispatcher(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -4279,10 +4314,8 @@ func skipDispatcher(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -4303,55 +4336,30 @@ func skipDispatcher(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthDispatcher } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthDispatcher - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDispatcher - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipDispatcher(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthDispatcher - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupDispatcher + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthDispatcher + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthDispatcher = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowDispatcher = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthDispatcher = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowDispatcher = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupDispatcher = fmt.Errorf("proto: unexpected end of group") ) diff --git a/vendor/github.com/docker/swarmkit/api/health.pb.go b/vendor/github.com/docker/swarmkit/api/health.pb.go index 48c3d243c8..3ca506a031 100644 --- a/vendor/github.com/docker/swarmkit/api/health.pb.go +++ b/vendor/github.com/docker/swarmkit/api/health.pb.go @@ -17,6 +17,7 @@ import ( status "google.golang.org/grpc/status" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" rafttime "time" @@ -31,7 +32,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type HealthCheckResponse_ServingStatus int32 @@ -78,7 +79,7 @@ func (m *HealthCheckRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_HealthCheckRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -114,7 +115,7 @@ func (m *HealthCheckResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_HealthCheckResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -255,6 +256,14 @@ type HealthServer interface { Check(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) } +// UnimplementedHealthServer can be embedded to have forward compatible implementations. +type UnimplementedHealthServer struct { +} + +func (*UnimplementedHealthServer) Check(ctx context.Context, req *HealthCheckRequest) (*HealthCheckResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Check not implemented") +} + func RegisterHealthServer(s *grpc.Server, srv HealthServer) { s.RegisterService(&_Health_serviceDesc, srv) } @@ -293,7 +302,7 @@ var _Health_serviceDesc = grpc.ServiceDesc{ func (m *HealthCheckRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -301,23 +310,29 @@ func (m *HealthCheckRequest) Marshal() (dAtA []byte, err error) { } func (m *HealthCheckRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HealthCheckRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Service) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.Service) + copy(dAtA[i:], m.Service) i = encodeVarintHealth(dAtA, i, uint64(len(m.Service))) - i += copy(dAtA[i:], m.Service) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *HealthCheckResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -325,26 +340,33 @@ func (m *HealthCheckResponse) Marshal() (dAtA []byte, err error) { } func (m *HealthCheckResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HealthCheckResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Status != 0 { - dAtA[i] = 0x8 - i++ i = encodeVarintHealth(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func encodeVarintHealth(dAtA []byte, offset int, v uint64) int { + offset -= sovHealth(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } type raftProxyHealthServer struct { @@ -480,14 +502,7 @@ func (m *HealthCheckResponse) Size() (n int) { } func sovHealth(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozHealth(x uint64) (n int) { return sovHealth(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -587,10 +602,7 @@ func (m *HealthCheckRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthHealth - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthHealth } if (iNdEx + skippy) > l { @@ -659,10 +671,7 @@ func (m *HealthCheckResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthHealth - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthHealth } if (iNdEx + skippy) > l { @@ -680,6 +689,7 @@ func (m *HealthCheckResponse) Unmarshal(dAtA []byte) error { func skipHealth(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -711,10 +721,8 @@ func skipHealth(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -735,55 +743,30 @@ func skipHealth(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthHealth } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthHealth - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowHealth - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipHealth(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthHealth - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupHealth + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthHealth + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthHealth = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowHealth = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthHealth = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowHealth = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupHealth = fmt.Errorf("proto: unexpected end of group") ) diff --git a/vendor/github.com/docker/swarmkit/api/logbroker.pb.go b/vendor/github.com/docker/swarmkit/api/logbroker.pb.go index 17eecbedc1..1b95b226c7 100644 --- a/vendor/github.com/docker/swarmkit/api/logbroker.pb.go +++ b/vendor/github.com/docker/swarmkit/api/logbroker.pb.go @@ -19,6 +19,7 @@ import ( status "google.golang.org/grpc/status" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" rafttime "time" @@ -33,7 +34,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // LogStream defines the stream from which the log message came. type LogStream int32 @@ -106,7 +107,7 @@ func (m *LogSubscriptionOptions) XXX_Marshal(b []byte, deterministic bool) ([]by return xxx_messageInfo_LogSubscriptionOptions.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -149,7 +150,7 @@ func (m *LogSelector) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_LogSelector.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -188,7 +189,7 @@ func (m *LogContext) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_LogContext.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -226,7 +227,7 @@ func (m *LogAttr) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_LogAttr.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -274,7 +275,7 @@ func (m *LogMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_LogMessage.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -312,7 +313,7 @@ func (m *SubscribeLogsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_SubscribeLogsRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -348,7 +349,7 @@ func (m *SubscribeLogsMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_SubscribeLogsMessage.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -385,7 +386,7 @@ func (m *ListenSubscriptionsRequest) XXX_Marshal(b []byte, deterministic bool) ( return xxx_messageInfo_ListenSubscriptionsRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -433,7 +434,7 @@ func (m *SubscriptionMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_SubscriptionMessage.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -478,7 +479,7 @@ func (m *PublishLogsMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_PublishLogsMessage.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -513,7 +514,7 @@ func (m *PublishLogsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_PublishLogsResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -963,6 +964,14 @@ type LogsServer interface { SubscribeLogs(*SubscribeLogsRequest, Logs_SubscribeLogsServer) error } +// UnimplementedLogsServer can be embedded to have forward compatible implementations. +type UnimplementedLogsServer struct { +} + +func (*UnimplementedLogsServer) SubscribeLogs(req *SubscribeLogsRequest, srv Logs_SubscribeLogsServer) error { + return status.Errorf(codes.Unimplemented, "method SubscribeLogs not implemented") +} + func RegisterLogsServer(s *grpc.Server, srv LogsServer) { s.RegisterService(&_Logs_serviceDesc, srv) } @@ -1104,6 +1113,17 @@ type LogBrokerServer interface { PublishLogs(LogBroker_PublishLogsServer) error } +// UnimplementedLogBrokerServer can be embedded to have forward compatible implementations. +type UnimplementedLogBrokerServer struct { +} + +func (*UnimplementedLogBrokerServer) ListenSubscriptions(req *ListenSubscriptionsRequest, srv LogBroker_ListenSubscriptionsServer) error { + return status.Errorf(codes.Unimplemented, "method ListenSubscriptions not implemented") +} +func (*UnimplementedLogBrokerServer) PublishLogs(srv LogBroker_PublishLogsServer) error { + return status.Errorf(codes.Unimplemented, "method PublishLogs not implemented") +} + func RegisterLogBrokerServer(s *grpc.Server, srv LogBrokerServer) { s.RegisterService(&_LogBroker_serviceDesc, srv) } @@ -1177,7 +1197,7 @@ var _LogBroker_serviceDesc = grpc.ServiceDesc{ func (m *LogSubscriptionOptions) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1185,49 +1205,56 @@ func (m *LogSubscriptionOptions) Marshal() (dAtA []byte, err error) { } func (m *LogSubscriptionOptions) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LogSubscriptionOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Streams) > 0 { - for _, num := range m.Streams { - dAtA[i] = 0x8 - i++ - i = encodeVarintLogbroker(dAtA, i, uint64(num)) + if m.Since != nil { + { + size, err := m.Since.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLogbroker(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x22 + } + if m.Tail != 0 { + i = encodeVarintLogbroker(dAtA, i, uint64(m.Tail)) + i-- + dAtA[i] = 0x18 } if m.Follow { - dAtA[i] = 0x10 - i++ + i-- if m.Follow { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x10 } - if m.Tail != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintLogbroker(dAtA, i, uint64(m.Tail)) - } - if m.Since != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintLogbroker(dAtA, i, uint64(m.Since.Size())) - n1, err := m.Since.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.Streams) > 0 { + for iNdEx := len(m.Streams) - 1; iNdEx >= 0; iNdEx-- { + i = encodeVarintLogbroker(dAtA, i, uint64(m.Streams[iNdEx])) + i-- + dAtA[i] = 0x8 } - i += n1 } - return i, nil + return len(dAtA) - i, nil } func (m *LogSelector) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1235,62 +1262,49 @@ func (m *LogSelector) Marshal() (dAtA []byte, err error) { } func (m *LogSelector) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LogSelector) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ServiceIDs) > 0 { - for _, s := range m.ServiceIDs { - dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if len(m.TaskIDs) > 0 { + for iNdEx := len(m.TaskIDs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.TaskIDs[iNdEx]) + copy(dAtA[i:], m.TaskIDs[iNdEx]) + i = encodeVarintLogbroker(dAtA, i, uint64(len(m.TaskIDs[iNdEx]))) + i-- + dAtA[i] = 0x1a } } if len(m.NodeIDs) > 0 { - for _, s := range m.NodeIDs { + for iNdEx := len(m.NodeIDs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.NodeIDs[iNdEx]) + copy(dAtA[i:], m.NodeIDs[iNdEx]) + i = encodeVarintLogbroker(dAtA, i, uint64(len(m.NodeIDs[iNdEx]))) + i-- dAtA[i] = 0x12 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) } } - if len(m.TaskIDs) > 0 { - for _, s := range m.TaskIDs { - dAtA[i] = 0x1a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if len(m.ServiceIDs) > 0 { + for iNdEx := len(m.ServiceIDs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ServiceIDs[iNdEx]) + copy(dAtA[i:], m.ServiceIDs[iNdEx]) + i = encodeVarintLogbroker(dAtA, i, uint64(len(m.ServiceIDs[iNdEx]))) + i-- + dAtA[i] = 0xa } } - return i, nil + return len(dAtA) - i, nil } func (m *LogContext) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1298,35 +1312,43 @@ func (m *LogContext) Marshal() (dAtA []byte, err error) { } func (m *LogContext) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LogContext) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ServiceID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintLogbroker(dAtA, i, uint64(len(m.ServiceID))) - i += copy(dAtA[i:], m.ServiceID) + if len(m.TaskID) > 0 { + i -= len(m.TaskID) + copy(dAtA[i:], m.TaskID) + i = encodeVarintLogbroker(dAtA, i, uint64(len(m.TaskID))) + i-- + dAtA[i] = 0x1a } if len(m.NodeID) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.NodeID) + copy(dAtA[i:], m.NodeID) i = encodeVarintLogbroker(dAtA, i, uint64(len(m.NodeID))) - i += copy(dAtA[i:], m.NodeID) + i-- + dAtA[i] = 0x12 } - if len(m.TaskID) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintLogbroker(dAtA, i, uint64(len(m.TaskID))) - i += copy(dAtA[i:], m.TaskID) + if len(m.ServiceID) > 0 { + i -= len(m.ServiceID) + copy(dAtA[i:], m.ServiceID) + i = encodeVarintLogbroker(dAtA, i, uint64(len(m.ServiceID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *LogAttr) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1334,29 +1356,36 @@ func (m *LogAttr) Marshal() (dAtA []byte, err error) { } func (m *LogAttr) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LogAttr) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Key) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintLogbroker(dAtA, i, uint64(len(m.Key))) - i += copy(dAtA[i:], m.Key) - } if len(m.Value) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Value) + copy(dAtA[i:], m.Value) i = encodeVarintLogbroker(dAtA, i, uint64(len(m.Value))) - i += copy(dAtA[i:], m.Value) + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintLogbroker(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *LogMessage) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1364,58 +1393,70 @@ func (m *LogMessage) Marshal() (dAtA []byte, err error) { } func (m *LogMessage) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LogMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintLogbroker(dAtA, i, uint64(m.Context.Size())) - n2, err := m.Context.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n2 - if m.Timestamp != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintLogbroker(dAtA, i, uint64(m.Timestamp.Size())) - n3, err := m.Timestamp.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.Attrs) > 0 { + for iNdEx := len(m.Attrs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Attrs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLogbroker(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a } - i += n3 - } - if m.Stream != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintLogbroker(dAtA, i, uint64(m.Stream)) } if len(m.Data) > 0 { - dAtA[i] = 0x22 - i++ + i -= len(m.Data) + copy(dAtA[i:], m.Data) i = encodeVarintLogbroker(dAtA, i, uint64(len(m.Data))) - i += copy(dAtA[i:], m.Data) + i-- + dAtA[i] = 0x22 } - if len(m.Attrs) > 0 { - for _, msg := range m.Attrs { - dAtA[i] = 0x2a - i++ - i = encodeVarintLogbroker(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + if m.Stream != 0 { + i = encodeVarintLogbroker(dAtA, i, uint64(m.Stream)) + i-- + dAtA[i] = 0x18 + } + if m.Timestamp != nil { + { + size, err := m.Timestamp.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintLogbroker(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x12 } - return i, nil + { + size, err := m.Context.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLogbroker(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *SubscribeLogsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1423,37 +1464,46 @@ func (m *SubscribeLogsRequest) Marshal() (dAtA []byte, err error) { } func (m *SubscribeLogsRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SubscribeLogsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Selector != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintLogbroker(dAtA, i, uint64(m.Selector.Size())) - n4, err := m.Selector.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n4 - } if m.Options != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintLogbroker(dAtA, i, uint64(m.Options.Size())) - n5, err := m.Options.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Options.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLogbroker(dAtA, i, uint64(size)) } - i += n5 + i-- + dAtA[i] = 0x12 } - return i, nil + if m.Selector != nil { + { + size, err := m.Selector.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLogbroker(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *SubscribeLogsMessage) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1461,29 +1511,36 @@ func (m *SubscribeLogsMessage) Marshal() (dAtA []byte, err error) { } func (m *SubscribeLogsMessage) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SubscribeLogsMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Messages) > 0 { - for _, msg := range m.Messages { - dAtA[i] = 0xa - i++ - i = encodeVarintLogbroker(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Messages) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Messages[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLogbroker(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - return i, nil + return len(dAtA) - i, nil } func (m *ListenSubscriptionsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1491,17 +1548,22 @@ func (m *ListenSubscriptionsRequest) Marshal() (dAtA []byte, err error) { } func (m *ListenSubscriptionsRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListenSubscriptionsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + return len(dAtA) - i, nil } func (m *SubscriptionMessage) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1509,53 +1571,63 @@ func (m *SubscriptionMessage) Marshal() (dAtA []byte, err error) { } func (m *SubscriptionMessage) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SubscriptionMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintLogbroker(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) - } - if m.Selector != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintLogbroker(dAtA, i, uint64(m.Selector.Size())) - n6, err := m.Selector.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n6 - } - if m.Options != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintLogbroker(dAtA, i, uint64(m.Options.Size())) - n7, err := m.Options.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n7 - } if m.Close { - dAtA[i] = 0x20 - i++ + i-- if m.Close { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x20 } - return i, nil + if m.Options != nil { + { + size, err := m.Options.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLogbroker(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Selector != nil { + { + size, err := m.Selector.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLogbroker(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintLogbroker(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *PublishLogsMessage) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1563,45 +1635,53 @@ func (m *PublishLogsMessage) Marshal() (dAtA []byte, err error) { } func (m *PublishLogsMessage) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PublishLogsMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.SubscriptionID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintLogbroker(dAtA, i, uint64(len(m.SubscriptionID))) - i += copy(dAtA[i:], m.SubscriptionID) - } - if len(m.Messages) > 0 { - for _, msg := range m.Messages { - dAtA[i] = 0x12 - i++ - i = encodeVarintLogbroker(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } if m.Close { - dAtA[i] = 0x18 - i++ + i-- if m.Close { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x18 } - return i, nil + if len(m.Messages) > 0 { + for iNdEx := len(m.Messages) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Messages[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLogbroker(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.SubscriptionID) > 0 { + i -= len(m.SubscriptionID) + copy(dAtA[i:], m.SubscriptionID) + i = encodeVarintLogbroker(dAtA, i, uint64(len(m.SubscriptionID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *PublishLogsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1609,21 +1689,28 @@ func (m *PublishLogsResponse) Marshal() (dAtA []byte, err error) { } func (m *PublishLogsResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PublishLogsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + return len(dAtA) - i, nil } func encodeVarintLogbroker(dAtA []byte, offset int, v uint64) int { + offset -= sovLogbroker(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } type raftProxyLogsServer struct { @@ -2143,14 +2230,7 @@ func (m *PublishLogsResponse) Size() (n int) { } func sovLogbroker(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozLogbroker(x uint64) (n int) { return sovLogbroker(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -2207,12 +2287,17 @@ func (this *LogMessage) String() string { if this == nil { return "nil" } + repeatedStringForAttrs := "[]LogAttr{" + for _, f := range this.Attrs { + repeatedStringForAttrs += strings.Replace(strings.Replace(f.String(), "LogAttr", "LogAttr", 1), `&`, ``, 1) + "," + } + repeatedStringForAttrs += "}" s := strings.Join([]string{`&LogMessage{`, `Context:` + strings.Replace(strings.Replace(this.Context.String(), "LogContext", "LogContext", 1), `&`, ``, 1) + `,`, `Timestamp:` + strings.Replace(fmt.Sprintf("%v", this.Timestamp), "Timestamp", "types.Timestamp", 1) + `,`, `Stream:` + fmt.Sprintf("%v", this.Stream) + `,`, `Data:` + fmt.Sprintf("%v", this.Data) + `,`, - `Attrs:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Attrs), "LogAttr", "LogAttr", 1), `&`, ``, 1) + `,`, + `Attrs:` + repeatedStringForAttrs + `,`, `}`, }, "") return s @@ -2222,8 +2307,8 @@ func (this *SubscribeLogsRequest) String() string { return "nil" } s := strings.Join([]string{`&SubscribeLogsRequest{`, - `Selector:` + strings.Replace(fmt.Sprintf("%v", this.Selector), "LogSelector", "LogSelector", 1) + `,`, - `Options:` + strings.Replace(fmt.Sprintf("%v", this.Options), "LogSubscriptionOptions", "LogSubscriptionOptions", 1) + `,`, + `Selector:` + strings.Replace(this.Selector.String(), "LogSelector", "LogSelector", 1) + `,`, + `Options:` + strings.Replace(this.Options.String(), "LogSubscriptionOptions", "LogSubscriptionOptions", 1) + `,`, `}`, }, "") return s @@ -2232,8 +2317,13 @@ func (this *SubscribeLogsMessage) String() string { if this == nil { return "nil" } + repeatedStringForMessages := "[]LogMessage{" + for _, f := range this.Messages { + repeatedStringForMessages += strings.Replace(strings.Replace(f.String(), "LogMessage", "LogMessage", 1), `&`, ``, 1) + "," + } + repeatedStringForMessages += "}" s := strings.Join([]string{`&SubscribeLogsMessage{`, - `Messages:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Messages), "LogMessage", "LogMessage", 1), `&`, ``, 1) + `,`, + `Messages:` + repeatedStringForMessages + `,`, `}`, }, "") return s @@ -2253,8 +2343,8 @@ func (this *SubscriptionMessage) String() string { } s := strings.Join([]string{`&SubscriptionMessage{`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`, - `Selector:` + strings.Replace(fmt.Sprintf("%v", this.Selector), "LogSelector", "LogSelector", 1) + `,`, - `Options:` + strings.Replace(fmt.Sprintf("%v", this.Options), "LogSubscriptionOptions", "LogSubscriptionOptions", 1) + `,`, + `Selector:` + strings.Replace(this.Selector.String(), "LogSelector", "LogSelector", 1) + `,`, + `Options:` + strings.Replace(this.Options.String(), "LogSubscriptionOptions", "LogSubscriptionOptions", 1) + `,`, `Close:` + fmt.Sprintf("%v", this.Close) + `,`, `}`, }, "") @@ -2264,9 +2354,14 @@ func (this *PublishLogsMessage) String() string { if this == nil { return "nil" } + repeatedStringForMessages := "[]LogMessage{" + for _, f := range this.Messages { + repeatedStringForMessages += strings.Replace(strings.Replace(f.String(), "LogMessage", "LogMessage", 1), `&`, ``, 1) + "," + } + repeatedStringForMessages += "}" s := strings.Join([]string{`&PublishLogsMessage{`, `SubscriptionID:` + fmt.Sprintf("%v", this.SubscriptionID) + `,`, - `Messages:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Messages), "LogMessage", "LogMessage", 1), `&`, ``, 1) + `,`, + `Messages:` + repeatedStringForMessages + `,`, `Close:` + fmt.Sprintf("%v", this.Close) + `,`, `}`, }, "") @@ -2468,10 +2563,7 @@ func (m *LogSubscriptionOptions) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthLogbroker - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthLogbroker } if (iNdEx + skippy) > l { @@ -2617,10 +2709,7 @@ func (m *LogSelector) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthLogbroker - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthLogbroker } if (iNdEx + skippy) > l { @@ -2766,10 +2855,7 @@ func (m *LogContext) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthLogbroker - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthLogbroker } if (iNdEx + skippy) > l { @@ -2883,10 +2969,7 @@ func (m *LogAttr) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthLogbroker - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthLogbroker } if (iNdEx + skippy) > l { @@ -3092,10 +3175,7 @@ func (m *LogMessage) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthLogbroker - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthLogbroker } if (iNdEx + skippy) > l { @@ -3217,10 +3297,7 @@ func (m *SubscribeLogsRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthLogbroker - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthLogbroker } if (iNdEx + skippy) > l { @@ -3304,10 +3381,7 @@ func (m *SubscribeLogsMessage) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthLogbroker - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthLogbroker } if (iNdEx + skippy) > l { @@ -3357,10 +3431,7 @@ func (m *ListenSubscriptionsRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthLogbroker - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthLogbroker } if (iNdEx + skippy) > l { @@ -3534,10 +3605,7 @@ func (m *SubscriptionMessage) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthLogbroker - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthLogbroker } if (iNdEx + skippy) > l { @@ -3673,10 +3741,7 @@ func (m *PublishLogsMessage) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthLogbroker - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthLogbroker } if (iNdEx + skippy) > l { @@ -3726,10 +3791,7 @@ func (m *PublishLogsResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthLogbroker - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthLogbroker } if (iNdEx + skippy) > l { @@ -3747,6 +3809,7 @@ func (m *PublishLogsResponse) Unmarshal(dAtA []byte) error { func skipLogbroker(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -3778,10 +3841,8 @@ func skipLogbroker(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -3802,55 +3863,30 @@ func skipLogbroker(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthLogbroker } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthLogbroker - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowLogbroker - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipLogbroker(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthLogbroker - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupLogbroker + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthLogbroker + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthLogbroker = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowLogbroker = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthLogbroker = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowLogbroker = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupLogbroker = fmt.Errorf("proto: unexpected end of group") ) diff --git a/vendor/github.com/docker/swarmkit/api/objects.pb.go b/vendor/github.com/docker/swarmkit/api/objects.pb.go index 41099f206a..743e6f9003 100644 --- a/vendor/github.com/docker/swarmkit/api/objects.pb.go +++ b/vendor/github.com/docker/swarmkit/api/objects.pb.go @@ -14,6 +14,7 @@ import ( types "github.com/gogo/protobuf/types" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" ) @@ -27,7 +28,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Meta contains metadata about objects. Every object contains a meta field. type Meta struct { @@ -52,7 +53,7 @@ func (m *Meta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Meta.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -124,7 +125,7 @@ func (m *Node) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Node.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -191,7 +192,7 @@ func (m *Service) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Service.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -236,7 +237,7 @@ func (m *Endpoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Endpoint.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -284,7 +285,7 @@ func (m *Endpoint_VirtualIP) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_Endpoint_VirtualIP.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -380,7 +381,7 @@ func (m *Task) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Task.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -428,7 +429,7 @@ func (m *NetworkAttachment) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_NetworkAttachment.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -484,7 +485,7 @@ func (m *Network) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Network.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -556,7 +557,7 @@ func (m *Cluster) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Cluster.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -600,7 +601,7 @@ func (m *Secret) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Secret.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -642,7 +643,7 @@ func (m *Config) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Config.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -690,7 +691,7 @@ func (m *Resource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Resource.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -731,7 +732,7 @@ func (m *Extension) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Extension.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1272,7 +1273,7 @@ func (m *Extension) CopyFrom(src interface{}) { func (m *Meta) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1280,45 +1281,56 @@ func (m *Meta) Marshal() (dAtA []byte, err error) { } func (m *Meta) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Meta) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Version.Size())) - n1, err := m.Version.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 - if m.CreatedAt != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.CreatedAt.Size())) - n2, err := m.CreatedAt.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n2 - } if m.UpdatedAt != nil { + { + size, err := m.UpdatedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x1a - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.UpdatedAt.Size())) - n3, err := m.UpdatedAt.MarshalTo(dAtA[i:]) + } + if m.CreatedAt != nil { + { + size, err := m.CreatedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + { + size, err := m.Version.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n3 + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) } - return i, nil + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *Node) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1326,107 +1338,129 @@ func (m *Node) Marshal() (dAtA []byte, err error) { } func (m *Node) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Node) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) - } - dAtA[i] = 0x12 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Meta.Size())) - n4, err := m.Meta.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n4 - dAtA[i] = 0x1a - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Spec.Size())) - n5, err := m.Spec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n5 - if m.Description != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Description.Size())) - n6, err := m.Description.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n6 - } - dAtA[i] = 0x2a - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Status.Size())) - n7, err := m.Status.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n7 - if m.ManagerStatus != nil { - dAtA[i] = 0x32 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.ManagerStatus.Size())) - n8, err := m.ManagerStatus.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n8 - } - if m.Attachment != nil { - dAtA[i] = 0x3a - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Attachment.Size())) - n9, err := m.Attachment.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n9 - } - dAtA[i] = 0x42 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Certificate.Size())) - n10, err := m.Certificate.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n10 - if m.Role != 0 { - dAtA[i] = 0x48 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Role)) + if m.VXLANUDPPort != 0 { + i = encodeVarintObjects(dAtA, i, uint64(m.VXLANUDPPort)) + i-- + dAtA[i] = 0x58 } if len(m.Attachments) > 0 { - for _, msg := range m.Attachments { + for iNdEx := len(m.Attachments) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Attachments[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x52 - i++ - i = encodeVarintObjects(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + } + } + if m.Role != 0 { + i = encodeVarintObjects(dAtA, i, uint64(m.Role)) + i-- + dAtA[i] = 0x48 + } + { + size, err := m.Certificate.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + if m.Attachment != nil { + { + size, err := m.Attachment.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x3a } - if m.VXLANUDPPort != 0 { - dAtA[i] = 0x58 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.VXLANUDPPort)) + if m.ManagerStatus != nil { + { + size, err := m.ManagerStatus.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 } - return i, nil + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + if m.Description != nil { + { + size, err := m.Description.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.Meta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *Service) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1434,109 +1468,131 @@ func (m *Service) Marshal() (dAtA []byte, err error) { } func (m *Service) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Service) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) - } - dAtA[i] = 0x12 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Meta.Size())) - n11, err := m.Meta.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n11 - dAtA[i] = 0x1a - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Spec.Size())) - n12, err := m.Spec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n12 - if m.Endpoint != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Endpoint.Size())) - n13, err := m.Endpoint.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.JobStatus != nil { + { + size, err := m.JobStatus.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) } - i += n13 + i-- + dAtA[i] = 0x62 } - if m.UpdateStatus != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.UpdateStatus.Size())) - n14, err := m.UpdateStatus.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.PreviousSpecVersion != nil { + { + size, err := m.PreviousSpecVersion.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) } - i += n14 + i-- + dAtA[i] = 0x5a } - if m.PreviousSpec != nil { - dAtA[i] = 0x32 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.PreviousSpec.Size())) - n15, err := m.PreviousSpec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.SpecVersion != nil { + { + size, err := m.SpecVersion.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) } - i += n15 + i-- + dAtA[i] = 0x52 } if m.PendingDelete { - dAtA[i] = 0x38 - i++ + i-- if m.PendingDelete { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x38 } - if m.SpecVersion != nil { - dAtA[i] = 0x52 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.SpecVersion.Size())) - n16, err := m.SpecVersion.MarshalTo(dAtA[i:]) + if m.PreviousSpec != nil { + { + size, err := m.PreviousSpec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.UpdateStatus != nil { + { + size, err := m.UpdateStatus.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.Endpoint != nil { + { + size, err := m.Endpoint.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n16 + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) } - if m.PreviousSpecVersion != nil { - dAtA[i] = 0x5a - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.PreviousSpecVersion.Size())) - n17, err := m.PreviousSpecVersion.MarshalTo(dAtA[i:]) + i-- + dAtA[i] = 0x1a + { + size, err := m.Meta.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n17 + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) } - if m.JobStatus != nil { - dAtA[i] = 0x62 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.JobStatus.Size())) - n18, err := m.JobStatus.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n18 + i-- + dAtA[i] = 0x12 + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Endpoint) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1544,51 +1600,62 @@ func (m *Endpoint) Marshal() (dAtA []byte, err error) { } func (m *Endpoint) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Endpoint) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Spec != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Spec.Size())) - n19, err := m.Spec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.VirtualIPs) > 0 { + for iNdEx := len(m.VirtualIPs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.VirtualIPs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a } - i += n19 } if len(m.Ports) > 0 { - for _, msg := range m.Ports { + for iNdEx := len(m.Ports) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Ports[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintObjects(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + } + } + if m.Spec != nil { + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa } - if len(m.VirtualIPs) > 0 { - for _, msg := range m.VirtualIPs { - dAtA[i] = 0x1a - i++ - i = encodeVarintObjects(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - return i, nil + return len(dAtA) - i, nil } func (m *Endpoint_VirtualIP) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1596,29 +1663,36 @@ func (m *Endpoint_VirtualIP) Marshal() (dAtA []byte, err error) { } func (m *Endpoint_VirtualIP) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Endpoint_VirtualIP) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.NetworkID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintObjects(dAtA, i, uint64(len(m.NetworkID))) - i += copy(dAtA[i:], m.NetworkID) - } if len(m.Addr) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Addr) + copy(dAtA[i:], m.Addr) i = encodeVarintObjects(dAtA, i, uint64(len(m.Addr))) - i += copy(dAtA[i:], m.Addr) + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.NetworkID) > 0 { + i -= len(m.NetworkID) + copy(dAtA[i:], m.NetworkID) + i = encodeVarintObjects(dAtA, i, uint64(len(m.NetworkID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *Task) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1626,151 +1700,181 @@ func (m *Task) Marshal() (dAtA []byte, err error) { } func (m *Task) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Task) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) - } - dAtA[i] = 0x12 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Meta.Size())) - n20, err := m.Meta.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n20 - dAtA[i] = 0x1a - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Spec.Size())) - n21, err := m.Spec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n21 - if len(m.ServiceID) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintObjects(dAtA, i, uint64(len(m.ServiceID))) - i += copy(dAtA[i:], m.ServiceID) - } - if m.Slot != 0 { - dAtA[i] = 0x28 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Slot)) - } - if len(m.NodeID) > 0 { - dAtA[i] = 0x32 - i++ - i = encodeVarintObjects(dAtA, i, uint64(len(m.NodeID))) - i += copy(dAtA[i:], m.NodeID) - } - dAtA[i] = 0x3a - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Annotations.Size())) - n22, err := m.Annotations.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n22 - dAtA[i] = 0x42 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.ServiceAnnotations.Size())) - n23, err := m.ServiceAnnotations.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n23 - dAtA[i] = 0x4a - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Status.Size())) - n24, err := m.Status.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n24 - if m.DesiredState != 0 { - dAtA[i] = 0x50 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.DesiredState)) - } - if len(m.Networks) > 0 { - for _, msg := range m.Networks { - dAtA[i] = 0x5a - i++ - i = encodeVarintObjects(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + if m.JobIteration != nil { + { + size, err := m.JobIteration.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) } - } - if m.Endpoint != nil { - dAtA[i] = 0x62 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Endpoint.Size())) - n25, err := m.Endpoint.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n25 - } - if m.LogDriver != nil { - dAtA[i] = 0x6a - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.LogDriver.Size())) - n26, err := m.LogDriver.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n26 - } - if m.SpecVersion != nil { - dAtA[i] = 0x72 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.SpecVersion.Size())) - n27, err := m.SpecVersion.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n27 + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 } if len(m.AssignedGenericResources) > 0 { - for _, msg := range m.AssignedGenericResources { + for iNdEx := len(m.AssignedGenericResources) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.AssignedGenericResources[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x7a - i++ - i = encodeVarintObjects(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + } + } + if m.SpecVersion != nil { + { + size, err := m.SpecVersion.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x72 + } + if m.LogDriver != nil { + { + size, err := m.LogDriver.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x6a + } + if m.Endpoint != nil { + { + size, err := m.Endpoint.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + } + 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 = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a } } - if m.JobIteration != nil { - dAtA[i] = 0x82 - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.JobIteration.Size())) - n28, err := m.JobIteration.MarshalTo(dAtA[i:]) + if m.DesiredState != 0 { + i = encodeVarintObjects(dAtA, i, uint64(m.DesiredState)) + i-- + dAtA[i] = 0x50 + } + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n28 + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) } - return i, nil + i-- + dAtA[i] = 0x4a + { + size, err := m.ServiceAnnotations.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + { + size, err := m.Annotations.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + if len(m.NodeID) > 0 { + i -= len(m.NodeID) + copy(dAtA[i:], m.NodeID) + i = encodeVarintObjects(dAtA, i, uint64(len(m.NodeID))) + i-- + dAtA[i] = 0x32 + } + if m.Slot != 0 { + i = encodeVarintObjects(dAtA, i, uint64(m.Slot)) + i-- + dAtA[i] = 0x28 + } + if len(m.ServiceID) > 0 { + i -= len(m.ServiceID) + copy(dAtA[i:], m.ServiceID) + i = encodeVarintObjects(dAtA, i, uint64(len(m.ServiceID))) + i-- + dAtA[i] = 0x22 + } + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.Meta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *NetworkAttachment) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1778,74 +1882,71 @@ func (m *NetworkAttachment) Marshal() (dAtA []byte, err error) { } func (m *NetworkAttachment) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NetworkAttachment) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Network != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Network.Size())) - n29, err := m.Network.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n29 - } - if len(m.Addresses) > 0 { - for _, s := range m.Addresses { + if len(m.DriverAttachmentOpts) > 0 { + for k := range m.DriverAttachmentOpts { + v := m.DriverAttachmentOpts[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintObjects(dAtA, i, uint64(len(v))) + i-- dAtA[i] = 0x12 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintObjects(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintObjects(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x22 } } if len(m.Aliases) > 0 { - for _, s := range m.Aliases { + for iNdEx := len(m.Aliases) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Aliases[iNdEx]) + copy(dAtA[i:], m.Aliases[iNdEx]) + i = encodeVarintObjects(dAtA, i, uint64(len(m.Aliases[iNdEx]))) + i-- dAtA[i] = 0x1a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) } } - if len(m.DriverAttachmentOpts) > 0 { - for k, _ := range m.DriverAttachmentOpts { - dAtA[i] = 0x22 - i++ - v := m.DriverAttachmentOpts[k] - mapSize := 1 + len(k) + sovObjects(uint64(len(k))) + 1 + len(v) + sovObjects(uint64(len(v))) - i = encodeVarintObjects(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintObjects(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) + if len(m.Addresses) > 0 { + for iNdEx := len(m.Addresses) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Addresses[iNdEx]) + copy(dAtA[i:], m.Addresses[iNdEx]) + i = encodeVarintObjects(dAtA, i, uint64(len(m.Addresses[iNdEx]))) + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintObjects(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) } } - return i, nil + if m.Network != nil { + { + size, err := m.Network.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *Network) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1853,69 +1954,83 @@ func (m *Network) Marshal() (dAtA []byte, err error) { } func (m *Network) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Network) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) - } - dAtA[i] = 0x12 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Meta.Size())) - n30, err := m.Meta.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n30 - dAtA[i] = 0x1a - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Spec.Size())) - n31, err := m.Spec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n31 - if m.DriverState != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.DriverState.Size())) - n32, err := m.DriverState.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n32 - } - if m.IPAM != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.IPAM.Size())) - n33, err := m.IPAM.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n33 - } if m.PendingDelete { - dAtA[i] = 0x30 - i++ + i-- if m.PendingDelete { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x30 } - return i, nil + if m.IPAM != nil { + { + size, err := m.IPAM.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.DriverState != nil { + { + size, err := m.DriverState.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.Meta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *Cluster) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1923,139 +2038,147 @@ func (m *Cluster) Marshal() (dAtA []byte, err error) { } func (m *Cluster) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Cluster) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) + if m.VXLANUDPPort != 0 { + i = encodeVarintObjects(dAtA, i, uint64(m.VXLANUDPPort)) + i-- + dAtA[i] = 0x68 } - dAtA[i] = 0x12 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Meta.Size())) - n34, err := m.Meta.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.SubnetSize != 0 { + i = encodeVarintObjects(dAtA, i, uint64(m.SubnetSize)) + i-- + dAtA[i] = 0x60 } - i += n34 - dAtA[i] = 0x1a - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Spec.Size())) - n35, err := m.Spec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n35 - dAtA[i] = 0x22 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.RootCA.Size())) - n36, err := m.RootCA.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n36 - if len(m.NetworkBootstrapKeys) > 0 { - for _, msg := range m.NetworkBootstrapKeys { - dAtA[i] = 0x2a - i++ - i = encodeVarintObjects(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.EncryptionKeyLamportClock != 0 { - dAtA[i] = 0x30 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.EncryptionKeyLamportClock)) - } - if len(m.BlacklistedCertificates) > 0 { - for k, _ := range m.BlacklistedCertificates { - dAtA[i] = 0x42 - i++ - v := m.BlacklistedCertificates[k] - msgSize := 0 - if v != nil { - msgSize = v.Size() - msgSize += 1 + sovObjects(uint64(msgSize)) - } - mapSize := 1 + len(k) + sovObjects(uint64(len(k))) + msgSize - i = encodeVarintObjects(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintObjects(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - if v != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintObjects(dAtA, i, uint64(v.Size())) - n37, err := v.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n37 - } - } - } - if len(m.UnlockKeys) > 0 { - for _, msg := range m.UnlockKeys { - dAtA[i] = 0x4a - i++ - i = encodeVarintObjects(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n + if len(m.DefaultAddressPool) > 0 { + for iNdEx := len(m.DefaultAddressPool) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.DefaultAddressPool[iNdEx]) + copy(dAtA[i:], m.DefaultAddressPool[iNdEx]) + i = encodeVarintObjects(dAtA, i, uint64(len(m.DefaultAddressPool[iNdEx]))) + i-- + dAtA[i] = 0x5a } } if m.FIPS { - dAtA[i] = 0x50 - i++ + i-- if m.FIPS { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x50 } - if len(m.DefaultAddressPool) > 0 { - for _, s := range m.DefaultAddressPool { - dAtA[i] = 0x5a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ + if len(m.UnlockKeys) > 0 { + for iNdEx := len(m.UnlockKeys) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.UnlockKeys[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + i-- + dAtA[i] = 0x4a } } - if m.SubnetSize != 0 { - dAtA[i] = 0x60 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.SubnetSize)) + if len(m.BlacklistedCertificates) > 0 { + for k := range m.BlacklistedCertificates { + v := m.BlacklistedCertificates[k] + baseI := i + if v != nil { + { + size, err := v.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintObjects(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintObjects(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x42 + } } - if m.VXLANUDPPort != 0 { - dAtA[i] = 0x68 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.VXLANUDPPort)) + if m.EncryptionKeyLamportClock != 0 { + i = encodeVarintObjects(dAtA, i, uint64(m.EncryptionKeyLamportClock)) + i-- + dAtA[i] = 0x30 } - return i, nil + if len(m.NetworkBootstrapKeys) > 0 { + for iNdEx := len(m.NetworkBootstrapKeys) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.NetworkBootstrapKeys[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + { + size, err := m.RootCA.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.Meta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *Secret) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2063,49 +2186,59 @@ func (m *Secret) Marshal() (dAtA []byte, err error) { } func (m *Secret) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Secret) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) - } - dAtA[i] = 0x12 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Meta.Size())) - n38, err := m.Meta.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n38 - dAtA[i] = 0x1a - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Spec.Size())) - n39, err := m.Spec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n39 if m.Internal { - dAtA[i] = 0x20 - i++ + i-- if m.Internal { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x20 } - return i, nil + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.Meta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *Config) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2113,39 +2246,49 @@ func (m *Config) Marshal() (dAtA []byte, err error) { } func (m *Config) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Config) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) } - dAtA[i] = 0x12 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Meta.Size())) - n40, err := m.Meta.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n40 + i-- dAtA[i] = 0x1a - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Spec.Size())) - n41, err := m.Spec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Meta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) } - i += n41 - return i, nil + i-- + dAtA[i] = 0x12 + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *Resource) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2153,55 +2296,68 @@ func (m *Resource) Marshal() (dAtA []byte, err error) { } func (m *Resource) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Resource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) - } - dAtA[i] = 0x12 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Meta.Size())) - n42, err := m.Meta.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n42 - dAtA[i] = 0x1a - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Annotations.Size())) - n43, err := m.Annotations.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n43 - if len(m.Kind) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintObjects(dAtA, i, uint64(len(m.Kind))) - i += copy(dAtA[i:], m.Kind) - } if m.Payload != nil { + { + size, err := m.Payload.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x2a - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Payload.Size())) - n44, err := m.Payload.MarshalTo(dAtA[i:]) + } + if len(m.Kind) > 0 { + i -= len(m.Kind) + copy(dAtA[i:], m.Kind) + i = encodeVarintObjects(dAtA, i, uint64(len(m.Kind))) + i-- + dAtA[i] = 0x22 + } + { + size, err := m.Annotations.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n44 + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) } - return i, nil + i-- + dAtA[i] = 0x1a + { + size, err := m.Meta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *Extension) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2209,49 +2365,62 @@ func (m *Extension) Marshal() (dAtA []byte, err error) { } func (m *Extension) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Extension) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) - } - dAtA[i] = 0x12 - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Meta.Size())) - n45, err := m.Meta.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n45 - dAtA[i] = 0x1a - i++ - i = encodeVarintObjects(dAtA, i, uint64(m.Annotations.Size())) - n46, err := m.Annotations.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n46 if len(m.Description) > 0 { - dAtA[i] = 0x22 - i++ + i -= len(m.Description) + copy(dAtA[i:], m.Description) i = encodeVarintObjects(dAtA, i, uint64(len(m.Description))) - i += copy(dAtA[i:], m.Description) + i-- + dAtA[i] = 0x22 } - return i, nil + { + size, err := m.Annotations.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.Meta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintObjects(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintObjects(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func encodeVarintObjects(dAtA []byte, offset int, v uint64) int { + offset -= sovObjects(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *Meta) Size() (n int) { if m == nil { @@ -2675,14 +2844,7 @@ func (m *Extension) Size() (n int) { } func sovObjects(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozObjects(x uint64) (n int) { return sovObjects(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -5329,7 +5491,7 @@ func (this *Meta) String() string { return "nil" } s := strings.Join([]string{`&Meta{`, - `Version:` + strings.Replace(strings.Replace(this.Version.String(), "Version", "Version", 1), `&`, ``, 1) + `,`, + `Version:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Version), "Version", "Version", 1), `&`, ``, 1) + `,`, `CreatedAt:` + strings.Replace(fmt.Sprintf("%v", this.CreatedAt), "Timestamp", "types.Timestamp", 1) + `,`, `UpdatedAt:` + strings.Replace(fmt.Sprintf("%v", this.UpdatedAt), "Timestamp", "types.Timestamp", 1) + `,`, `}`, @@ -5340,17 +5502,22 @@ func (this *Node) String() string { if this == nil { return "nil" } + repeatedStringForAttachments := "[]*NetworkAttachment{" + for _, f := range this.Attachments { + repeatedStringForAttachments += strings.Replace(f.String(), "NetworkAttachment", "NetworkAttachment", 1) + "," + } + repeatedStringForAttachments += "}" s := strings.Join([]string{`&Node{`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`, `Meta:` + strings.Replace(strings.Replace(this.Meta.String(), "Meta", "Meta", 1), `&`, ``, 1) + `,`, - `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "NodeSpec", "NodeSpec", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Spec), "NodeSpec", "NodeSpec", 1), `&`, ``, 1) + `,`, `Description:` + strings.Replace(fmt.Sprintf("%v", this.Description), "NodeDescription", "NodeDescription", 1) + `,`, - `Status:` + strings.Replace(strings.Replace(this.Status.String(), "NodeStatus", "NodeStatus", 1), `&`, ``, 1) + `,`, + `Status:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Status), "NodeStatus", "NodeStatus", 1), `&`, ``, 1) + `,`, `ManagerStatus:` + strings.Replace(fmt.Sprintf("%v", this.ManagerStatus), "ManagerStatus", "ManagerStatus", 1) + `,`, - `Attachment:` + strings.Replace(fmt.Sprintf("%v", this.Attachment), "NetworkAttachment", "NetworkAttachment", 1) + `,`, - `Certificate:` + strings.Replace(strings.Replace(this.Certificate.String(), "Certificate", "Certificate", 1), `&`, ``, 1) + `,`, + `Attachment:` + strings.Replace(this.Attachment.String(), "NetworkAttachment", "NetworkAttachment", 1) + `,`, + `Certificate:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Certificate), "Certificate", "Certificate", 1), `&`, ``, 1) + `,`, `Role:` + fmt.Sprintf("%v", this.Role) + `,`, - `Attachments:` + strings.Replace(fmt.Sprintf("%v", this.Attachments), "NetworkAttachment", "NetworkAttachment", 1) + `,`, + `Attachments:` + repeatedStringForAttachments + `,`, `VXLANUDPPort:` + fmt.Sprintf("%v", this.VXLANUDPPort) + `,`, `}`, }, "") @@ -5363,8 +5530,8 @@ func (this *Service) String() string { s := strings.Join([]string{`&Service{`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`, `Meta:` + strings.Replace(strings.Replace(this.Meta.String(), "Meta", "Meta", 1), `&`, ``, 1) + `,`, - `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "ServiceSpec", "ServiceSpec", 1), `&`, ``, 1) + `,`, - `Endpoint:` + strings.Replace(fmt.Sprintf("%v", this.Endpoint), "Endpoint", "Endpoint", 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Spec), "ServiceSpec", "ServiceSpec", 1), `&`, ``, 1) + `,`, + `Endpoint:` + strings.Replace(this.Endpoint.String(), "Endpoint", "Endpoint", 1) + `,`, `UpdateStatus:` + strings.Replace(fmt.Sprintf("%v", this.UpdateStatus), "UpdateStatus", "UpdateStatus", 1) + `,`, `PreviousSpec:` + strings.Replace(fmt.Sprintf("%v", this.PreviousSpec), "ServiceSpec", "ServiceSpec", 1) + `,`, `PendingDelete:` + fmt.Sprintf("%v", this.PendingDelete) + `,`, @@ -5379,10 +5546,20 @@ func (this *Endpoint) String() string { if this == nil { return "nil" } + repeatedStringForPorts := "[]*PortConfig{" + for _, f := range this.Ports { + repeatedStringForPorts += strings.Replace(fmt.Sprintf("%v", f), "PortConfig", "PortConfig", 1) + "," + } + repeatedStringForPorts += "}" + repeatedStringForVirtualIPs := "[]*Endpoint_VirtualIP{" + for _, f := range this.VirtualIPs { + repeatedStringForVirtualIPs += strings.Replace(fmt.Sprintf("%v", f), "Endpoint_VirtualIP", "Endpoint_VirtualIP", 1) + "," + } + repeatedStringForVirtualIPs += "}" s := strings.Join([]string{`&Endpoint{`, `Spec:` + strings.Replace(fmt.Sprintf("%v", this.Spec), "EndpointSpec", "EndpointSpec", 1) + `,`, - `Ports:` + strings.Replace(fmt.Sprintf("%v", this.Ports), "PortConfig", "PortConfig", 1) + `,`, - `VirtualIPs:` + strings.Replace(fmt.Sprintf("%v", this.VirtualIPs), "Endpoint_VirtualIP", "Endpoint_VirtualIP", 1) + `,`, + `Ports:` + repeatedStringForPorts + `,`, + `VirtualIPs:` + repeatedStringForVirtualIPs + `,`, `}`, }, "") return s @@ -5402,22 +5579,32 @@ func (this *Task) String() string { if this == nil { return "nil" } + repeatedStringForNetworks := "[]*NetworkAttachment{" + for _, f := range this.Networks { + repeatedStringForNetworks += strings.Replace(f.String(), "NetworkAttachment", "NetworkAttachment", 1) + "," + } + repeatedStringForNetworks += "}" + repeatedStringForAssignedGenericResources := "[]*GenericResource{" + for _, f := range this.AssignedGenericResources { + repeatedStringForAssignedGenericResources += strings.Replace(fmt.Sprintf("%v", f), "GenericResource", "GenericResource", 1) + "," + } + repeatedStringForAssignedGenericResources += "}" s := strings.Join([]string{`&Task{`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`, `Meta:` + strings.Replace(strings.Replace(this.Meta.String(), "Meta", "Meta", 1), `&`, ``, 1) + `,`, - `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "TaskSpec", "TaskSpec", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Spec), "TaskSpec", "TaskSpec", 1), `&`, ``, 1) + `,`, `ServiceID:` + fmt.Sprintf("%v", this.ServiceID) + `,`, `Slot:` + fmt.Sprintf("%v", this.Slot) + `,`, `NodeID:` + fmt.Sprintf("%v", this.NodeID) + `,`, - `Annotations:` + strings.Replace(strings.Replace(this.Annotations.String(), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, - `ServiceAnnotations:` + strings.Replace(strings.Replace(this.ServiceAnnotations.String(), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, - `Status:` + strings.Replace(strings.Replace(this.Status.String(), "TaskStatus", "TaskStatus", 1), `&`, ``, 1) + `,`, + `Annotations:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Annotations), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, + `ServiceAnnotations:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ServiceAnnotations), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, + `Status:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Status), "TaskStatus", "TaskStatus", 1), `&`, ``, 1) + `,`, `DesiredState:` + fmt.Sprintf("%v", this.DesiredState) + `,`, - `Networks:` + strings.Replace(fmt.Sprintf("%v", this.Networks), "NetworkAttachment", "NetworkAttachment", 1) + `,`, - `Endpoint:` + strings.Replace(fmt.Sprintf("%v", this.Endpoint), "Endpoint", "Endpoint", 1) + `,`, + `Networks:` + repeatedStringForNetworks + `,`, + `Endpoint:` + strings.Replace(this.Endpoint.String(), "Endpoint", "Endpoint", 1) + `,`, `LogDriver:` + strings.Replace(fmt.Sprintf("%v", this.LogDriver), "Driver", "Driver", 1) + `,`, `SpecVersion:` + strings.Replace(fmt.Sprintf("%v", this.SpecVersion), "Version", "Version", 1) + `,`, - `AssignedGenericResources:` + strings.Replace(fmt.Sprintf("%v", this.AssignedGenericResources), "GenericResource", "GenericResource", 1) + `,`, + `AssignedGenericResources:` + repeatedStringForAssignedGenericResources + `,`, `JobIteration:` + strings.Replace(fmt.Sprintf("%v", this.JobIteration), "Version", "Version", 1) + `,`, `}`, }, "") @@ -5438,7 +5625,7 @@ func (this *NetworkAttachment) String() string { } mapStringForDriverAttachmentOpts += "}" s := strings.Join([]string{`&NetworkAttachment{`, - `Network:` + strings.Replace(fmt.Sprintf("%v", this.Network), "Network", "Network", 1) + `,`, + `Network:` + strings.Replace(this.Network.String(), "Network", "Network", 1) + `,`, `Addresses:` + fmt.Sprintf("%v", this.Addresses) + `,`, `Aliases:` + fmt.Sprintf("%v", this.Aliases) + `,`, `DriverAttachmentOpts:` + mapStringForDriverAttachmentOpts + `,`, @@ -5453,7 +5640,7 @@ func (this *Network) String() string { s := strings.Join([]string{`&Network{`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`, `Meta:` + strings.Replace(strings.Replace(this.Meta.String(), "Meta", "Meta", 1), `&`, ``, 1) + `,`, - `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "NetworkSpec", "NetworkSpec", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Spec), "NetworkSpec", "NetworkSpec", 1), `&`, ``, 1) + `,`, `DriverState:` + strings.Replace(fmt.Sprintf("%v", this.DriverState), "Driver", "Driver", 1) + `,`, `IPAM:` + strings.Replace(fmt.Sprintf("%v", this.IPAM), "IPAMOptions", "IPAMOptions", 1) + `,`, `PendingDelete:` + fmt.Sprintf("%v", this.PendingDelete) + `,`, @@ -5465,6 +5652,16 @@ func (this *Cluster) String() string { if this == nil { return "nil" } + repeatedStringForNetworkBootstrapKeys := "[]*EncryptionKey{" + for _, f := range this.NetworkBootstrapKeys { + repeatedStringForNetworkBootstrapKeys += strings.Replace(fmt.Sprintf("%v", f), "EncryptionKey", "EncryptionKey", 1) + "," + } + repeatedStringForNetworkBootstrapKeys += "}" + repeatedStringForUnlockKeys := "[]*EncryptionKey{" + for _, f := range this.UnlockKeys { + repeatedStringForUnlockKeys += strings.Replace(fmt.Sprintf("%v", f), "EncryptionKey", "EncryptionKey", 1) + "," + } + repeatedStringForUnlockKeys += "}" keysForBlacklistedCertificates := make([]string, 0, len(this.BlacklistedCertificates)) for k, _ := range this.BlacklistedCertificates { keysForBlacklistedCertificates = append(keysForBlacklistedCertificates, k) @@ -5478,12 +5675,12 @@ func (this *Cluster) String() string { s := strings.Join([]string{`&Cluster{`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`, `Meta:` + strings.Replace(strings.Replace(this.Meta.String(), "Meta", "Meta", 1), `&`, ``, 1) + `,`, - `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "ClusterSpec", "ClusterSpec", 1), `&`, ``, 1) + `,`, - `RootCA:` + strings.Replace(strings.Replace(this.RootCA.String(), "RootCA", "RootCA", 1), `&`, ``, 1) + `,`, - `NetworkBootstrapKeys:` + strings.Replace(fmt.Sprintf("%v", this.NetworkBootstrapKeys), "EncryptionKey", "EncryptionKey", 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Spec), "ClusterSpec", "ClusterSpec", 1), `&`, ``, 1) + `,`, + `RootCA:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.RootCA), "RootCA", "RootCA", 1), `&`, ``, 1) + `,`, + `NetworkBootstrapKeys:` + repeatedStringForNetworkBootstrapKeys + `,`, `EncryptionKeyLamportClock:` + fmt.Sprintf("%v", this.EncryptionKeyLamportClock) + `,`, `BlacklistedCertificates:` + mapStringForBlacklistedCertificates + `,`, - `UnlockKeys:` + strings.Replace(fmt.Sprintf("%v", this.UnlockKeys), "EncryptionKey", "EncryptionKey", 1) + `,`, + `UnlockKeys:` + repeatedStringForUnlockKeys + `,`, `FIPS:` + fmt.Sprintf("%v", this.FIPS) + `,`, `DefaultAddressPool:` + fmt.Sprintf("%v", this.DefaultAddressPool) + `,`, `SubnetSize:` + fmt.Sprintf("%v", this.SubnetSize) + `,`, @@ -5499,7 +5696,7 @@ func (this *Secret) String() string { s := strings.Join([]string{`&Secret{`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`, `Meta:` + strings.Replace(strings.Replace(this.Meta.String(), "Meta", "Meta", 1), `&`, ``, 1) + `,`, - `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "SecretSpec", "SecretSpec", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Spec), "SecretSpec", "SecretSpec", 1), `&`, ``, 1) + `,`, `Internal:` + fmt.Sprintf("%v", this.Internal) + `,`, `}`, }, "") @@ -5512,7 +5709,7 @@ func (this *Config) String() string { s := strings.Join([]string{`&Config{`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`, `Meta:` + strings.Replace(strings.Replace(this.Meta.String(), "Meta", "Meta", 1), `&`, ``, 1) + `,`, - `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "ConfigSpec", "ConfigSpec", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Spec), "ConfigSpec", "ConfigSpec", 1), `&`, ``, 1) + `,`, `}`, }, "") return s @@ -5524,7 +5721,7 @@ func (this *Resource) String() string { s := strings.Join([]string{`&Resource{`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`, `Meta:` + strings.Replace(strings.Replace(this.Meta.String(), "Meta", "Meta", 1), `&`, ``, 1) + `,`, - `Annotations:` + strings.Replace(strings.Replace(this.Annotations.String(), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, + `Annotations:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Annotations), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`, `Payload:` + strings.Replace(fmt.Sprintf("%v", this.Payload), "Any", "types.Any", 1) + `,`, `}`, @@ -5538,7 +5735,7 @@ func (this *Extension) String() string { s := strings.Join([]string{`&Extension{`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`, `Meta:` + strings.Replace(strings.Replace(this.Meta.String(), "Meta", "Meta", 1), `&`, ``, 1) + `,`, - `Annotations:` + strings.Replace(strings.Replace(this.Annotations.String(), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, + `Annotations:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Annotations), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, `Description:` + fmt.Sprintf("%v", this.Description) + `,`, `}`, }, "") @@ -5692,10 +5889,7 @@ func (m *Meta) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthObjects - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthObjects } if (iNdEx + skippy) > l { @@ -6089,10 +6283,7 @@ func (m *Node) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthObjects - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthObjects } if (iNdEx + skippy) > l { @@ -6476,10 +6667,7 @@ func (m *Service) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthObjects - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthObjects } if (iNdEx + skippy) > l { @@ -6633,10 +6821,7 @@ func (m *Endpoint) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthObjects - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthObjects } if (iNdEx + skippy) > l { @@ -6750,10 +6935,7 @@ func (m *Endpoint_VirtualIP) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthObjects - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthObjects } if (iNdEx + skippy) > l { @@ -7314,10 +7496,7 @@ func (m *Task) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthObjects - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthObjects } if (iNdEx + skippy) > l { @@ -7577,7 +7756,7 @@ func (m *NetworkAttachment) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthObjects } if (iNdEx + skippy) > postIndex { @@ -7594,10 +7773,7 @@ func (m *NetworkAttachment) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthObjects - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthObjects } if (iNdEx + skippy) > l { @@ -7837,10 +8013,7 @@ func (m *Network) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthObjects - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthObjects } if (iNdEx + skippy) > l { @@ -8186,7 +8359,7 @@ func (m *Cluster) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthObjects } if (iNdEx + skippy) > postIndex { @@ -8327,10 +8500,7 @@ func (m *Cluster) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthObjects - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthObjects } if (iNdEx + skippy) > l { @@ -8498,10 +8668,7 @@ func (m *Secret) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthObjects - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthObjects } if (iNdEx + skippy) > l { @@ -8649,10 +8816,7 @@ func (m *Config) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthObjects - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthObjects } if (iNdEx + skippy) > l { @@ -8868,10 +9032,7 @@ func (m *Resource) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthObjects - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthObjects } if (iNdEx + skippy) > l { @@ -9051,10 +9212,7 @@ func (m *Extension) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthObjects - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthObjects } if (iNdEx + skippy) > l { @@ -9072,6 +9230,7 @@ func (m *Extension) Unmarshal(dAtA []byte) error { func skipObjects(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -9103,10 +9262,8 @@ func skipObjects(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -9127,55 +9284,30 @@ func skipObjects(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthObjects } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthObjects - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowObjects - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipObjects(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthObjects - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupObjects + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthObjects + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthObjects = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowObjects = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthObjects = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowObjects = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupObjects = fmt.Errorf("proto: unexpected end of group") ) diff --git a/vendor/github.com/docker/swarmkit/api/raft.pb.go b/vendor/github.com/docker/swarmkit/api/raft.pb.go index 16fb0b0c8e..1c2537f528 100644 --- a/vendor/github.com/docker/swarmkit/api/raft.pb.go +++ b/vendor/github.com/docker/swarmkit/api/raft.pb.go @@ -17,6 +17,7 @@ import ( status "google.golang.org/grpc/status" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" rafttime "time" @@ -31,7 +32,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // StoreActionKind defines the operation to take on the store for the target of // a storage action. @@ -91,7 +92,7 @@ func (m *RaftMember) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_RaftMember.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -128,7 +129,7 @@ func (m *JoinRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_JoinRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -170,7 +171,7 @@ func (m *JoinResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_JoinResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -206,7 +207,7 @@ func (m *LeaveRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_LeaveRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -241,7 +242,7 @@ func (m *LeaveResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return xxx_messageInfo_LeaveResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -277,7 +278,7 @@ func (m *ProcessRaftMessageRequest) XXX_Marshal(b []byte, deterministic bool) ([ return xxx_messageInfo_ProcessRaftMessageRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -312,7 +313,7 @@ func (m *ProcessRaftMessageResponse) XXX_Marshal(b []byte, deterministic bool) ( return xxx_messageInfo_ProcessRaftMessageResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -349,7 +350,7 @@ func (m *StreamRaftMessageRequest) XXX_Marshal(b []byte, deterministic bool) ([] return xxx_messageInfo_StreamRaftMessageRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -385,7 +386,7 @@ func (m *StreamRaftMessageResponse) XXX_Marshal(b []byte, deterministic bool) ([ return xxx_messageInfo_StreamRaftMessageResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -422,7 +423,7 @@ func (m *ResolveAddressRequest) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_ResolveAddressRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -459,7 +460,7 @@ func (m *ResolveAddressResponse) XXX_Marshal(b []byte, deterministic bool) ([]by return xxx_messageInfo_ResolveAddressResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -499,7 +500,7 @@ func (m *InternalRaftRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_InternalRaftRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -547,7 +548,7 @@ func (m *StoreAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_StoreAction.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -573,31 +574,31 @@ type isStoreAction_Target interface { } type StoreAction_Node struct { - Node *Node `protobuf:"bytes,2,opt,name=node,proto3,oneof"` + Node *Node `protobuf:"bytes,2,opt,name=node,proto3,oneof" json:"node,omitempty"` } type StoreAction_Service struct { - Service *Service `protobuf:"bytes,3,opt,name=service,proto3,oneof"` + Service *Service `protobuf:"bytes,3,opt,name=service,proto3,oneof" json:"service,omitempty"` } type StoreAction_Task struct { - Task *Task `protobuf:"bytes,4,opt,name=task,proto3,oneof"` + Task *Task `protobuf:"bytes,4,opt,name=task,proto3,oneof" json:"task,omitempty"` } type StoreAction_Network struct { - Network *Network `protobuf:"bytes,5,opt,name=network,proto3,oneof"` + Network *Network `protobuf:"bytes,5,opt,name=network,proto3,oneof" json:"network,omitempty"` } type StoreAction_Cluster struct { - Cluster *Cluster `protobuf:"bytes,6,opt,name=cluster,proto3,oneof"` + Cluster *Cluster `protobuf:"bytes,6,opt,name=cluster,proto3,oneof" json:"cluster,omitempty"` } type StoreAction_Secret struct { - Secret *Secret `protobuf:"bytes,7,opt,name=secret,proto3,oneof"` + Secret *Secret `protobuf:"bytes,7,opt,name=secret,proto3,oneof" json:"secret,omitempty"` } type StoreAction_Resource struct { - Resource *Resource `protobuf:"bytes,8,opt,name=resource,proto3,oneof"` + Resource *Resource `protobuf:"bytes,8,opt,name=resource,proto3,oneof" json:"resource,omitempty"` } type StoreAction_Extension struct { - Extension *Extension `protobuf:"bytes,9,opt,name=extension,proto3,oneof"` + Extension *Extension `protobuf:"bytes,9,opt,name=extension,proto3,oneof" json:"extension,omitempty"` } type StoreAction_Config struct { - Config *Config `protobuf:"bytes,10,opt,name=config,proto3,oneof"` + Config *Config `protobuf:"bytes,10,opt,name=config,proto3,oneof" json:"config,omitempty"` } func (*StoreAction_Node) isStoreAction_Target() {} @@ -680,9 +681,9 @@ func (m *StoreAction) GetConfig() *Config { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*StoreAction) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _StoreAction_OneofMarshaler, _StoreAction_OneofUnmarshaler, _StoreAction_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*StoreAction) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*StoreAction_Node)(nil), (*StoreAction_Service)(nil), (*StoreAction_Task)(nil), @@ -695,198 +696,6 @@ func (*StoreAction) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) e } } -func _StoreAction_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*StoreAction) - // target - switch x := m.Target.(type) { - case *StoreAction_Node: - _ = b.EncodeVarint(2<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Node); err != nil { - return err - } - case *StoreAction_Service: - _ = b.EncodeVarint(3<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Service); err != nil { - return err - } - case *StoreAction_Task: - _ = b.EncodeVarint(4<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Task); err != nil { - return err - } - case *StoreAction_Network: - _ = b.EncodeVarint(5<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Network); err != nil { - return err - } - case *StoreAction_Cluster: - _ = b.EncodeVarint(6<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Cluster); err != nil { - return err - } - case *StoreAction_Secret: - _ = b.EncodeVarint(7<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Secret); err != nil { - return err - } - case *StoreAction_Resource: - _ = b.EncodeVarint(8<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Resource); err != nil { - return err - } - case *StoreAction_Extension: - _ = b.EncodeVarint(9<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Extension); err != nil { - return err - } - case *StoreAction_Config: - _ = b.EncodeVarint(10<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Config); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("StoreAction.Target has unexpected type %T", x) - } - return nil -} - -func _StoreAction_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*StoreAction) - switch tag { - case 2: // target.node - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Node) - err := b.DecodeMessage(msg) - m.Target = &StoreAction_Node{msg} - return true, err - case 3: // target.service - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Service) - err := b.DecodeMessage(msg) - m.Target = &StoreAction_Service{msg} - return true, err - case 4: // target.task - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Task) - err := b.DecodeMessage(msg) - m.Target = &StoreAction_Task{msg} - return true, err - case 5: // target.network - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Network) - err := b.DecodeMessage(msg) - m.Target = &StoreAction_Network{msg} - return true, err - case 6: // target.cluster - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Cluster) - err := b.DecodeMessage(msg) - m.Target = &StoreAction_Cluster{msg} - return true, err - case 7: // target.secret - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Secret) - err := b.DecodeMessage(msg) - m.Target = &StoreAction_Secret{msg} - return true, err - case 8: // target.resource - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Resource) - err := b.DecodeMessage(msg) - m.Target = &StoreAction_Resource{msg} - return true, err - case 9: // target.extension - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Extension) - err := b.DecodeMessage(msg) - m.Target = &StoreAction_Extension{msg} - return true, err - case 10: // target.config - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Config) - err := b.DecodeMessage(msg) - m.Target = &StoreAction_Config{msg} - return true, err - default: - return false, nil - } -} - -func _StoreAction_OneofSizer(msg proto.Message) (n int) { - m := msg.(*StoreAction) - // target - switch x := m.Target.(type) { - case *StoreAction_Node: - s := proto.Size(x.Node) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *StoreAction_Service: - s := proto.Size(x.Service) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *StoreAction_Task: - s := proto.Size(x.Task) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *StoreAction_Network: - s := proto.Size(x.Network) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *StoreAction_Cluster: - s := proto.Size(x.Cluster) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *StoreAction_Secret: - s := proto.Size(x.Secret) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *StoreAction_Resource: - s := proto.Size(x.Resource) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *StoreAction_Extension: - s := proto.Size(x.Extension) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *StoreAction_Config: - s := proto.Size(x.Config) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - func init() { proto.RegisterEnum("docker.swarmkit.v1.StoreActionKind", StoreActionKind_name, StoreActionKind_value) proto.RegisterType((*RaftMember)(nil), "docker.swarmkit.v1.RaftMember") @@ -1375,6 +1184,20 @@ type RaftServer interface { ResolveAddress(context.Context, *ResolveAddressRequest) (*ResolveAddressResponse, error) } +// UnimplementedRaftServer can be embedded to have forward compatible implementations. +type UnimplementedRaftServer struct { +} + +func (*UnimplementedRaftServer) ProcessRaftMessage(ctx context.Context, req *ProcessRaftMessageRequest) (*ProcessRaftMessageResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ProcessRaftMessage not implemented") +} +func (*UnimplementedRaftServer) StreamRaftMessage(srv Raft_StreamRaftMessageServer) error { + return status.Errorf(codes.Unimplemented, "method StreamRaftMessage not implemented") +} +func (*UnimplementedRaftServer) ResolveAddress(ctx context.Context, req *ResolveAddressRequest) (*ResolveAddressResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ResolveAddress not implemented") +} + func RegisterRaftServer(s *grpc.Server, srv RaftServer) { s.RegisterService(&_Raft_serviceDesc, srv) } @@ -1508,6 +1331,17 @@ type RaftMembershipServer interface { Leave(context.Context, *LeaveRequest) (*LeaveResponse, error) } +// UnimplementedRaftMembershipServer can be embedded to have forward compatible implementations. +type UnimplementedRaftMembershipServer struct { +} + +func (*UnimplementedRaftMembershipServer) Join(ctx context.Context, req *JoinRequest) (*JoinResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Join not implemented") +} +func (*UnimplementedRaftMembershipServer) Leave(ctx context.Context, req *LeaveRequest) (*LeaveResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Leave not implemented") +} + func RegisterRaftMembershipServer(s *grpc.Server, srv RaftMembershipServer) { s.RegisterService(&_RaftMembership_serviceDesc, srv) } @@ -1568,7 +1402,7 @@ var _RaftMembership_serviceDesc = grpc.ServiceDesc{ func (m *RaftMember) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1576,42 +1410,51 @@ func (m *RaftMember) Marshal() (dAtA []byte, err error) { } func (m *RaftMember) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RaftMember) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.RaftID != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.RaftID)) + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaft(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.Addr) > 0 { + i -= len(m.Addr) + copy(dAtA[i:], m.Addr) + i = encodeVarintRaft(dAtA, i, uint64(len(m.Addr))) + i-- + dAtA[i] = 0x1a } if len(m.NodeID) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.NodeID) + copy(dAtA[i:], m.NodeID) i = encodeVarintRaft(dAtA, i, uint64(len(m.NodeID))) - i += copy(dAtA[i:], m.NodeID) + i-- + dAtA[i] = 0x12 } - if len(m.Addr) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintRaft(dAtA, i, uint64(len(m.Addr))) - i += copy(dAtA[i:], m.Addr) + if m.RaftID != 0 { + i = encodeVarintRaft(dAtA, i, uint64(m.RaftID)) + i-- + dAtA[i] = 0x8 } - dAtA[i] = 0x22 - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Status.Size())) - n1, err := m.Status.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 - return i, nil + return len(dAtA) - i, nil } func (m *JoinRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1619,23 +1462,29 @@ func (m *JoinRequest) Marshal() (dAtA []byte, err error) { } func (m *JoinRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *JoinRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Addr) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.Addr) + copy(dAtA[i:], m.Addr) i = encodeVarintRaft(dAtA, i, uint64(len(m.Addr))) - i += copy(dAtA[i:], m.Addr) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *JoinResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1643,41 +1492,48 @@ func (m *JoinResponse) Marshal() (dAtA []byte, err error) { } func (m *JoinResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *JoinResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.RaftID != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.RaftID)) + if len(m.RemovedMembers) > 0 { + for iNdEx := len(m.RemovedMembers) - 1; iNdEx >= 0; iNdEx-- { + i = encodeVarintRaft(dAtA, i, uint64(m.RemovedMembers[iNdEx])) + i-- + dAtA[i] = 0x18 + } } if len(m.Members) > 0 { - for _, msg := range m.Members { - dAtA[i] = 0x12 - i++ - i = encodeVarintRaft(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + 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 = encodeVarintRaft(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x12 } } - if len(m.RemovedMembers) > 0 { - for _, num := range m.RemovedMembers { - dAtA[i] = 0x18 - i++ - i = encodeVarintRaft(dAtA, i, uint64(num)) - } + if m.RaftID != 0 { + i = encodeVarintRaft(dAtA, i, uint64(m.RaftID)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *LeaveRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1685,27 +1541,34 @@ func (m *LeaveRequest) Marshal() (dAtA []byte, err error) { } func (m *LeaveRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LeaveRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Node != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Node.Size())) - n2, err := m.Node.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Node.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaft(dAtA, i, uint64(size)) } - i += n2 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *LeaveResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1713,17 +1576,22 @@ func (m *LeaveResponse) Marshal() (dAtA []byte, err error) { } func (m *LeaveResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LeaveResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + return len(dAtA) - i, nil } func (m *ProcessRaftMessageRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1731,27 +1599,34 @@ func (m *ProcessRaftMessageRequest) Marshal() (dAtA []byte, err error) { } func (m *ProcessRaftMessageRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProcessRaftMessageRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Message != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Message.Size())) - n3, err := m.Message.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Message.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaft(dAtA, i, uint64(size)) } - i += n3 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ProcessRaftMessageResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1759,17 +1634,22 @@ func (m *ProcessRaftMessageResponse) Marshal() (dAtA []byte, err error) { } func (m *ProcessRaftMessageResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProcessRaftMessageResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + return len(dAtA) - i, nil } func (m *StreamRaftMessageRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1777,27 +1657,34 @@ func (m *StreamRaftMessageRequest) Marshal() (dAtA []byte, err error) { } func (m *StreamRaftMessageRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StreamRaftMessageRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Message != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Message.Size())) - n4, err := m.Message.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Message.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaft(dAtA, i, uint64(size)) } - i += n4 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *StreamRaftMessageResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1805,17 +1692,22 @@ func (m *StreamRaftMessageResponse) Marshal() (dAtA []byte, err error) { } func (m *StreamRaftMessageResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StreamRaftMessageResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + return len(dAtA) - i, nil } func (m *ResolveAddressRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1823,22 +1715,27 @@ func (m *ResolveAddressRequest) Marshal() (dAtA []byte, err error) { } func (m *ResolveAddressRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ResolveAddressRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.RaftID != 0 { - dAtA[i] = 0x8 - i++ i = encodeVarintRaft(dAtA, i, uint64(m.RaftID)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *ResolveAddressResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1846,23 +1743,29 @@ func (m *ResolveAddressResponse) Marshal() (dAtA []byte, err error) { } func (m *ResolveAddressResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ResolveAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Addr) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.Addr) + copy(dAtA[i:], m.Addr) i = encodeVarintRaft(dAtA, i, uint64(len(m.Addr))) - i += copy(dAtA[i:], m.Addr) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *InternalRaftRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1870,34 +1773,41 @@ func (m *InternalRaftRequest) Marshal() (dAtA []byte, err error) { } func (m *InternalRaftRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *InternalRaftRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.ID != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.ID)) - } if len(m.Action) > 0 { - for _, msg := range m.Action { - dAtA[i] = 0x12 - i++ - i = encodeVarintRaft(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Action) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Action[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaft(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x12 } } - return i, nil + if m.ID != 0 { + i = encodeVarintRaft(dAtA, i, uint64(m.ID)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *StoreAction) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1905,159 +1815,231 @@ func (m *StoreAction) Marshal() (dAtA []byte, err error) { } func (m *StoreAction) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StoreAction) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Action != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Action)) - } if m.Target != nil { - nn5, err := m.Target.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.Target.Size() + i -= size + if _, err := m.Target.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn5 } - return i, nil + if m.Action != 0 { + i = encodeVarintRaft(dAtA, i, uint64(m.Action)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *StoreAction_Node) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StoreAction_Node) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Node != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Node.Size())) - n6, err := m.Node.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Node.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaft(dAtA, i, uint64(size)) } - i += n6 + i-- + dAtA[i] = 0x12 } - return i, nil + return len(dAtA) - i, nil } func (m *StoreAction_Service) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StoreAction_Service) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Service != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Service.Size())) - n7, err := m.Service.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Service.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaft(dAtA, i, uint64(size)) } - i += n7 + i-- + dAtA[i] = 0x1a } - return i, nil + return len(dAtA) - i, nil } func (m *StoreAction_Task) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StoreAction_Task) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Task != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Task.Size())) - n8, err := m.Task.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Task.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaft(dAtA, i, uint64(size)) } - i += n8 + i-- + dAtA[i] = 0x22 } - return i, nil + return len(dAtA) - i, nil } func (m *StoreAction_Network) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StoreAction_Network) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Network != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Network.Size())) - n9, err := m.Network.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Network.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaft(dAtA, i, uint64(size)) } - i += n9 + i-- + dAtA[i] = 0x2a } - return i, nil + return len(dAtA) - i, nil } func (m *StoreAction_Cluster) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StoreAction_Cluster) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Cluster != nil { - dAtA[i] = 0x32 - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Cluster.Size())) - n10, err := m.Cluster.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Cluster.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaft(dAtA, i, uint64(size)) } - i += n10 + i-- + dAtA[i] = 0x32 } - return i, nil + return len(dAtA) - i, nil } func (m *StoreAction_Secret) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StoreAction_Secret) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Secret != nil { - dAtA[i] = 0x3a - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Secret.Size())) - n11, err := m.Secret.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Secret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaft(dAtA, i, uint64(size)) } - i += n11 + i-- + dAtA[i] = 0x3a } - return i, nil + return len(dAtA) - i, nil } func (m *StoreAction_Resource) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StoreAction_Resource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Resource != nil { - dAtA[i] = 0x42 - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Resource.Size())) - n12, err := m.Resource.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Resource.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaft(dAtA, i, uint64(size)) } - i += n12 + i-- + dAtA[i] = 0x42 } - return i, nil + return len(dAtA) - i, nil } func (m *StoreAction_Extension) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StoreAction_Extension) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Extension != nil { - dAtA[i] = 0x4a - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Extension.Size())) - n13, err := m.Extension.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Extension.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaft(dAtA, i, uint64(size)) } - i += n13 + i-- + dAtA[i] = 0x4a } - return i, nil + return len(dAtA) - i, nil } func (m *StoreAction_Config) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StoreAction_Config) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Config != nil { - dAtA[i] = 0x52 - i++ - i = encodeVarintRaft(dAtA, i, uint64(m.Config.Size())) - n14, err := m.Config.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Config.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaft(dAtA, i, uint64(size)) } - i += n14 + i-- + dAtA[i] = 0x52 } - return i, nil + return len(dAtA) - i, nil } func encodeVarintRaft(dAtA []byte, offset int, v uint64) int { + offset -= sovRaft(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } type raftProxyRaftServer struct { @@ -2693,14 +2675,7 @@ func (m *StoreAction_Config) Size() (n int) { } func sovRaft(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozRaft(x uint64) (n int) { return sovRaft(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -2713,7 +2688,7 @@ func (this *RaftMember) String() string { `RaftID:` + fmt.Sprintf("%v", this.RaftID) + `,`, `NodeID:` + fmt.Sprintf("%v", this.NodeID) + `,`, `Addr:` + fmt.Sprintf("%v", this.Addr) + `,`, - `Status:` + strings.Replace(strings.Replace(this.Status.String(), "RaftMemberStatus", "RaftMemberStatus", 1), `&`, ``, 1) + `,`, + `Status:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Status), "RaftMemberStatus", "RaftMemberStatus", 1), `&`, ``, 1) + `,`, `}`, }, "") return s @@ -2732,9 +2707,14 @@ func (this *JoinResponse) String() string { if this == nil { return "nil" } + repeatedStringForMembers := "[]*RaftMember{" + for _, f := range this.Members { + repeatedStringForMembers += strings.Replace(f.String(), "RaftMember", "RaftMember", 1) + "," + } + repeatedStringForMembers += "}" s := strings.Join([]string{`&JoinResponse{`, `RaftID:` + fmt.Sprintf("%v", this.RaftID) + `,`, - `Members:` + strings.Replace(fmt.Sprintf("%v", this.Members), "RaftMember", "RaftMember", 1) + `,`, + `Members:` + repeatedStringForMembers + `,`, `RemovedMembers:` + fmt.Sprintf("%v", this.RemovedMembers) + `,`, `}`, }, "") @@ -2745,7 +2725,7 @@ func (this *LeaveRequest) String() string { return "nil" } s := strings.Join([]string{`&LeaveRequest{`, - `Node:` + strings.Replace(fmt.Sprintf("%v", this.Node), "RaftMember", "RaftMember", 1) + `,`, + `Node:` + strings.Replace(this.Node.String(), "RaftMember", "RaftMember", 1) + `,`, `}`, }, "") return s @@ -2821,9 +2801,14 @@ func (this *InternalRaftRequest) String() string { if this == nil { return "nil" } + repeatedStringForAction := "[]StoreAction{" + for _, f := range this.Action { + repeatedStringForAction += strings.Replace(strings.Replace(f.String(), "StoreAction", "StoreAction", 1), `&`, ``, 1) + "," + } + repeatedStringForAction += "}" s := strings.Join([]string{`&InternalRaftRequest{`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`, - `Action:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Action), "StoreAction", "StoreAction", 1), `&`, ``, 1) + `,`, + `Action:` + repeatedStringForAction + `,`, `}`, }, "") return s @@ -3088,10 +3073,7 @@ func (m *RaftMember) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRaft } if (iNdEx + skippy) > l { @@ -3173,10 +3155,7 @@ func (m *JoinRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRaft } if (iNdEx + skippy) > l { @@ -3355,10 +3334,7 @@ func (m *JoinResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRaft } if (iNdEx + skippy) > l { @@ -3444,10 +3420,7 @@ func (m *LeaveRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRaft } if (iNdEx + skippy) > l { @@ -3497,10 +3470,7 @@ func (m *LeaveResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRaft } if (iNdEx + skippy) > l { @@ -3586,10 +3556,7 @@ func (m *ProcessRaftMessageRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRaft } if (iNdEx + skippy) > l { @@ -3639,10 +3606,7 @@ func (m *ProcessRaftMessageResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRaft } if (iNdEx + skippy) > l { @@ -3728,10 +3692,7 @@ func (m *StreamRaftMessageRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRaft } if (iNdEx + skippy) > l { @@ -3781,10 +3742,7 @@ func (m *StreamRaftMessageResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRaft } if (iNdEx + skippy) > l { @@ -3853,10 +3811,7 @@ func (m *ResolveAddressRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRaft } if (iNdEx + skippy) > l { @@ -3938,10 +3893,7 @@ func (m *ResolveAddressResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRaft } if (iNdEx + skippy) > l { @@ -4044,10 +3996,7 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRaft } if (iNdEx + skippy) > l { @@ -4431,10 +4380,7 @@ func (m *StoreAction) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthRaft - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRaft } if (iNdEx + skippy) > l { @@ -4452,6 +4398,7 @@ func (m *StoreAction) Unmarshal(dAtA []byte) error { func skipRaft(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -4483,10 +4430,8 @@ func skipRaft(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -4507,55 +4452,30 @@ func skipRaft(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthRaft } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthRaft - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRaft - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipRaft(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthRaft - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupRaft + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthRaft + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthRaft = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowRaft = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthRaft = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowRaft = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupRaft = fmt.Errorf("proto: unexpected end of group") ) diff --git a/vendor/github.com/docker/swarmkit/api/resource.pb.go b/vendor/github.com/docker/swarmkit/api/resource.pb.go index d68c4bac02..8c9cf71e26 100644 --- a/vendor/github.com/docker/swarmkit/api/resource.pb.go +++ b/vendor/github.com/docker/swarmkit/api/resource.pb.go @@ -18,6 +18,7 @@ import ( status "google.golang.org/grpc/status" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" rafttime "time" @@ -32,7 +33,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type AttachNetworkRequest struct { Config *NetworkAttachmentConfig `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"` @@ -52,7 +53,7 @@ func (m *AttachNetworkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_AttachNetworkRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -88,7 +89,7 @@ func (m *AttachNetworkResponse) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_AttachNetworkResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -124,7 +125,7 @@ func (m *DetachNetworkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_DetachNetworkRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -159,7 +160,7 @@ func (m *DetachNetworkResponse) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_DetachNetworkResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -355,6 +356,17 @@ type ResourceAllocatorServer interface { DetachNetwork(context.Context, *DetachNetworkRequest) (*DetachNetworkResponse, error) } +// UnimplementedResourceAllocatorServer can be embedded to have forward compatible implementations. +type UnimplementedResourceAllocatorServer struct { +} + +func (*UnimplementedResourceAllocatorServer) AttachNetwork(ctx context.Context, req *AttachNetworkRequest) (*AttachNetworkResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AttachNetwork not implemented") +} +func (*UnimplementedResourceAllocatorServer) DetachNetwork(ctx context.Context, req *DetachNetworkRequest) (*DetachNetworkResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DetachNetwork not implemented") +} + func RegisterResourceAllocatorServer(s *grpc.Server, srv ResourceAllocatorServer) { s.RegisterService(&_ResourceAllocator_serviceDesc, srv) } @@ -415,7 +427,7 @@ var _ResourceAllocator_serviceDesc = grpc.ServiceDesc{ func (m *AttachNetworkRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -423,33 +435,41 @@ func (m *AttachNetworkRequest) Marshal() (dAtA []byte, err error) { } func (m *AttachNetworkRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AttachNetworkRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Config != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintResource(dAtA, i, uint64(m.Config.Size())) - n1, err := m.Config.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 - } if len(m.ContainerID) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.ContainerID) + copy(dAtA[i:], m.ContainerID) i = encodeVarintResource(dAtA, i, uint64(len(m.ContainerID))) - i += copy(dAtA[i:], m.ContainerID) + i-- + dAtA[i] = 0x12 } - return i, nil + if m.Config != nil { + { + size, err := m.Config.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResource(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *AttachNetworkResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -457,23 +477,29 @@ func (m *AttachNetworkResponse) Marshal() (dAtA []byte, err error) { } func (m *AttachNetworkResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AttachNetworkResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.AttachmentID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.AttachmentID) + copy(dAtA[i:], m.AttachmentID) i = encodeVarintResource(dAtA, i, uint64(len(m.AttachmentID))) - i += copy(dAtA[i:], m.AttachmentID) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *DetachNetworkRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -481,23 +507,29 @@ func (m *DetachNetworkRequest) Marshal() (dAtA []byte, err error) { } func (m *DetachNetworkRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DetachNetworkRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.AttachmentID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.AttachmentID) + copy(dAtA[i:], m.AttachmentID) i = encodeVarintResource(dAtA, i, uint64(len(m.AttachmentID))) - i += copy(dAtA[i:], m.AttachmentID) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *DetachNetworkResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -505,21 +537,28 @@ func (m *DetachNetworkResponse) Marshal() (dAtA []byte, err error) { } func (m *DetachNetworkResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DetachNetworkResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + return len(dAtA) - i, nil } func encodeVarintResource(dAtA []byte, offset int, v uint64) int { + offset -= sovResource(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } type raftProxyResourceAllocatorServer struct { @@ -717,14 +756,7 @@ func (m *DetachNetworkResponse) Size() (n int) { } func sovResource(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozResource(x uint64) (n int) { return sovResource(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -880,10 +912,7 @@ func (m *AttachNetworkRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthResource - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthResource } if (iNdEx + skippy) > l { @@ -965,10 +994,7 @@ func (m *AttachNetworkResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthResource - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthResource } if (iNdEx + skippy) > l { @@ -1050,10 +1076,7 @@ func (m *DetachNetworkRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthResource - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthResource } if (iNdEx + skippy) > l { @@ -1103,10 +1126,7 @@ func (m *DetachNetworkResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthResource - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthResource } if (iNdEx + skippy) > l { @@ -1124,6 +1144,7 @@ func (m *DetachNetworkResponse) Unmarshal(dAtA []byte) error { func skipResource(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -1155,10 +1176,8 @@ func skipResource(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -1179,55 +1198,30 @@ func skipResource(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthResource } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthResource - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowResource - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipResource(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthResource - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupResource + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthResource + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthResource = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowResource = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthResource = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowResource = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupResource = fmt.Errorf("proto: unexpected end of group") ) diff --git a/vendor/github.com/docker/swarmkit/api/snapshot.pb.go b/vendor/github.com/docker/swarmkit/api/snapshot.pb.go index 0add79d543..e7f1c35e44 100644 --- a/vendor/github.com/docker/swarmkit/api/snapshot.pb.go +++ b/vendor/github.com/docker/swarmkit/api/snapshot.pb.go @@ -9,6 +9,7 @@ import ( proto "github.com/gogo/protobuf/proto" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" ) @@ -22,7 +23,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type Snapshot_Version int32 @@ -73,7 +74,7 @@ func (m *StoreSnapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return xxx_messageInfo_StoreSnapshot.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -111,7 +112,7 @@ func (m *ClusterSnapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return xxx_messageInfo_ClusterSnapshot.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -149,7 +150,7 @@ func (m *Snapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Snapshot.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -350,7 +351,7 @@ func (m *Snapshot) CopyFrom(src interface{}) { func (m *StoreSnapshot) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -358,125 +359,148 @@ func (m *StoreSnapshot) Marshal() (dAtA []byte, err error) { } func (m *StoreSnapshot) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StoreSnapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Nodes) > 0 { - for _, msg := range m.Nodes { - dAtA[i] = 0xa - i++ - i = encodeVarintSnapshot(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + 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)) } - i += n - } - } - if len(m.Services) > 0 { - for _, msg := range m.Services { - dAtA[i] = 0x12 - i++ - i = encodeVarintSnapshot(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if len(m.Networks) > 0 { - for _, msg := range m.Networks { - dAtA[i] = 0x1a - i++ - i = encodeVarintSnapshot(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if len(m.Tasks) > 0 { - for _, msg := range m.Tasks { - dAtA[i] = 0x22 - i++ - i = encodeVarintSnapshot(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if len(m.Clusters) > 0 { - for _, msg := range m.Clusters { - dAtA[i] = 0x2a - i++ - i = encodeVarintSnapshot(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if len(m.Secrets) > 0 { - for _, msg := range m.Secrets { - dAtA[i] = 0x32 - i++ - i = encodeVarintSnapshot(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if len(m.Resources) > 0 { - for _, msg := range m.Resources { - dAtA[i] = 0x3a - i++ - i = encodeVarintSnapshot(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n + i-- + dAtA[i] = 0x4a } } if len(m.Extensions) > 0 { - for _, msg := range m.Extensions { + 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)) + } + i-- dAtA[i] = 0x42 - i++ - i = encodeVarintSnapshot(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n } } - if len(m.Configs) > 0 { - for _, msg := range m.Configs { - dAtA[i] = 0x4a - i++ - i = encodeVarintSnapshot(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + 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)) } - i += n + i-- + dAtA[i] = 0x3a } } - return i, nil + 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)) + } + i-- + dAtA[i] = 0x32 + } + } + if len(m.Clusters) > 0 { + 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)) + } + i-- + dAtA[i] = 0x2a + } + } + 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)) + } + i-- + dAtA[i] = 0x22 + } + } + 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)) + } + i-- + dAtA[i] = 0x1a + } + } + 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)) + } + i-- + dAtA[i] = 0x12 + } + } + 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)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil } func (m *ClusterSnapshot) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -484,36 +508,43 @@ func (m *ClusterSnapshot) Marshal() (dAtA []byte, err error) { } func (m *ClusterSnapshot) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ClusterSnapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Members) > 0 { - for _, msg := range m.Members { - dAtA[i] = 0xa - i++ - i = encodeVarintSnapshot(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } if len(m.Removed) > 0 { - for _, num := range m.Removed { + for iNdEx := len(m.Removed) - 1; iNdEx >= 0; iNdEx-- { + i = encodeVarintSnapshot(dAtA, i, uint64(m.Removed[iNdEx])) + i-- dAtA[i] = 0x10 - i++ - i = encodeVarintSnapshot(dAtA, i, uint64(num)) } } - return i, nil + 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 } func (m *Snapshot) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -521,42 +552,53 @@ func (m *Snapshot) Marshal() (dAtA []byte, err error) { } func (m *Snapshot) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Snapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Version != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintSnapshot(dAtA, i, uint64(m.Version)) + { + size, err := m.Store.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSnapshot(dAtA, i, uint64(size)) } - dAtA[i] = 0x12 - i++ - i = encodeVarintSnapshot(dAtA, i, uint64(m.Membership.Size())) - n1, err := m.Membership.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 + i-- dAtA[i] = 0x1a - i++ - i = encodeVarintSnapshot(dAtA, i, uint64(m.Store.Size())) - n2, err := m.Store.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Membership.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSnapshot(dAtA, i, uint64(size)) } - i += n2 - return i, nil + i-- + dAtA[i] = 0x12 + if m.Version != 0 { + i = encodeVarintSnapshot(dAtA, i, uint64(m.Version)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func encodeVarintSnapshot(dAtA []byte, offset int, v uint64) int { + offset -= sovSnapshot(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *StoreSnapshot) Size() (n int) { if m == nil { @@ -658,14 +700,7 @@ func (m *Snapshot) Size() (n int) { } func sovSnapshot(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozSnapshot(x uint64) (n int) { return sovSnapshot(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -674,16 +709,61 @@ func (this *StoreSnapshot) String() string { if this == nil { return "nil" } + 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 += "}" s := strings.Join([]string{`&StoreSnapshot{`, - `Nodes:` + strings.Replace(fmt.Sprintf("%v", this.Nodes), "Node", "Node", 1) + `,`, - `Services:` + strings.Replace(fmt.Sprintf("%v", this.Services), "Service", "Service", 1) + `,`, - `Networks:` + strings.Replace(fmt.Sprintf("%v", this.Networks), "Network", "Network", 1) + `,`, - `Tasks:` + strings.Replace(fmt.Sprintf("%v", this.Tasks), "Task", "Task", 1) + `,`, - `Clusters:` + strings.Replace(fmt.Sprintf("%v", this.Clusters), "Cluster", "Cluster", 1) + `,`, - `Secrets:` + strings.Replace(fmt.Sprintf("%v", this.Secrets), "Secret", "Secret", 1) + `,`, - `Resources:` + strings.Replace(fmt.Sprintf("%v", this.Resources), "Resource", "Resource", 1) + `,`, - `Extensions:` + strings.Replace(fmt.Sprintf("%v", this.Extensions), "Extension", "Extension", 1) + `,`, - `Configs:` + strings.Replace(fmt.Sprintf("%v", this.Configs), "Config", "Config", 1) + `,`, + `Nodes:` + repeatedStringForNodes + `,`, + `Services:` + repeatedStringForServices + `,`, + `Networks:` + repeatedStringForNetworks + `,`, + `Tasks:` + repeatedStringForTasks + `,`, + `Clusters:` + repeatedStringForClusters + `,`, + `Secrets:` + repeatedStringForSecrets + `,`, + `Resources:` + repeatedStringForResources + `,`, + `Extensions:` + repeatedStringForExtensions + `,`, + `Configs:` + repeatedStringForConfigs + `,`, `}`, }, "") return s @@ -692,8 +772,13 @@ func (this *ClusterSnapshot) String() string { if this == nil { return "nil" } + repeatedStringForMembers := "[]*RaftMember{" + for _, f := range this.Members { + repeatedStringForMembers += strings.Replace(fmt.Sprintf("%v", f), "RaftMember", "RaftMember", 1) + "," + } + repeatedStringForMembers += "}" s := strings.Join([]string{`&ClusterSnapshot{`, - `Members:` + strings.Replace(fmt.Sprintf("%v", this.Members), "RaftMember", "RaftMember", 1) + `,`, + `Members:` + repeatedStringForMembers + `,`, `Removed:` + fmt.Sprintf("%v", this.Removed) + `,`, `}`, }, "") @@ -1060,10 +1145,7 @@ func (m *StoreSnapshot) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSnapshot - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSnapshot } if (iNdEx + skippy) > l { @@ -1223,10 +1305,7 @@ func (m *ClusterSnapshot) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSnapshot - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSnapshot } if (iNdEx + skippy) > l { @@ -1361,10 +1440,7 @@ func (m *Snapshot) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSnapshot - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSnapshot } if (iNdEx + skippy) > l { @@ -1382,6 +1458,7 @@ func (m *Snapshot) Unmarshal(dAtA []byte) error { func skipSnapshot(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -1413,10 +1490,8 @@ func skipSnapshot(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -1437,55 +1512,30 @@ func skipSnapshot(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthSnapshot } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthSnapshot - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSnapshot - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipSnapshot(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthSnapshot - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupSnapshot + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthSnapshot + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthSnapshot = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowSnapshot = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthSnapshot = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowSnapshot = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupSnapshot = fmt.Errorf("proto: unexpected end of group") ) diff --git a/vendor/github.com/docker/swarmkit/api/specs.pb.go b/vendor/github.com/docker/swarmkit/api/specs.pb.go index 82e14798be..c04c13a88e 100644 --- a/vendor/github.com/docker/swarmkit/api/specs.pb.go +++ b/vendor/github.com/docker/swarmkit/api/specs.pb.go @@ -12,6 +12,7 @@ import ( types "github.com/gogo/protobuf/types" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" ) @@ -25,7 +26,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type NodeSpec_Membership int32 @@ -178,7 +179,7 @@ func (m *NodeSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_NodeSpec.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -241,7 +242,7 @@ func (m *ServiceSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_ServiceSpec.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -267,16 +268,16 @@ type isServiceSpec_Mode interface { } type ServiceSpec_Replicated struct { - Replicated *ReplicatedService `protobuf:"bytes,3,opt,name=replicated,proto3,oneof"` + Replicated *ReplicatedService `protobuf:"bytes,3,opt,name=replicated,proto3,oneof" json:"replicated,omitempty"` } type ServiceSpec_Global struct { - Global *GlobalService `protobuf:"bytes,4,opt,name=global,proto3,oneof"` + Global *GlobalService `protobuf:"bytes,4,opt,name=global,proto3,oneof" json:"global,omitempty"` } type ServiceSpec_ReplicatedJob struct { - ReplicatedJob *ReplicatedJob `protobuf:"bytes,10,opt,name=replicated_job,json=replicatedJob,proto3,oneof"` + ReplicatedJob *ReplicatedJob `protobuf:"bytes,10,opt,name=replicated_job,json=replicatedJob,proto3,oneof" json:"replicated_job,omitempty"` } type ServiceSpec_GlobalJob struct { - GlobalJob *GlobalJob `protobuf:"bytes,11,opt,name=global_job,json=globalJob,proto3,oneof"` + GlobalJob *GlobalJob `protobuf:"bytes,11,opt,name=global_job,json=globalJob,proto3,oneof" json:"global_job,omitempty"` } func (*ServiceSpec_Replicated) isServiceSpec_Mode() {} @@ -319,9 +320,9 @@ func (m *ServiceSpec) GetGlobalJob() *GlobalJob { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*ServiceSpec) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _ServiceSpec_OneofMarshaler, _ServiceSpec_OneofUnmarshaler, _ServiceSpec_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*ServiceSpec) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*ServiceSpec_Replicated)(nil), (*ServiceSpec_Global)(nil), (*ServiceSpec_ReplicatedJob)(nil), @@ -329,108 +330,6 @@ func (*ServiceSpec) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) e } } -func _ServiceSpec_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*ServiceSpec) - // mode - switch x := m.Mode.(type) { - case *ServiceSpec_Replicated: - _ = b.EncodeVarint(3<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Replicated); err != nil { - return err - } - case *ServiceSpec_Global: - _ = b.EncodeVarint(4<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Global); err != nil { - return err - } - case *ServiceSpec_ReplicatedJob: - _ = b.EncodeVarint(10<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.ReplicatedJob); err != nil { - return err - } - case *ServiceSpec_GlobalJob: - _ = b.EncodeVarint(11<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.GlobalJob); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("ServiceSpec.Mode has unexpected type %T", x) - } - return nil -} - -func _ServiceSpec_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*ServiceSpec) - switch tag { - case 3: // mode.replicated - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(ReplicatedService) - err := b.DecodeMessage(msg) - m.Mode = &ServiceSpec_Replicated{msg} - return true, err - case 4: // mode.global - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(GlobalService) - err := b.DecodeMessage(msg) - m.Mode = &ServiceSpec_Global{msg} - return true, err - case 10: // mode.replicated_job - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(ReplicatedJob) - err := b.DecodeMessage(msg) - m.Mode = &ServiceSpec_ReplicatedJob{msg} - return true, err - case 11: // mode.global_job - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(GlobalJob) - err := b.DecodeMessage(msg) - m.Mode = &ServiceSpec_GlobalJob{msg} - return true, err - default: - return false, nil - } -} - -func _ServiceSpec_OneofSizer(msg proto.Message) (n int) { - m := msg.(*ServiceSpec) - // mode - switch x := m.Mode.(type) { - case *ServiceSpec_Replicated: - s := proto.Size(x.Replicated) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *ServiceSpec_Global: - s := proto.Size(x.Global) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *ServiceSpec_ReplicatedJob: - s := proto.Size(x.ReplicatedJob) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *ServiceSpec_GlobalJob: - s := proto.Size(x.GlobalJob) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - // ReplicatedService sets the reconciliation target to certain number of replicas. type ReplicatedService struct { Replicas uint64 `protobuf:"varint,1,opt,name=replicas,proto3" json:"replicas,omitempty"` @@ -449,7 +348,7 @@ func (m *ReplicatedService) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_ReplicatedService.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -485,7 +384,7 @@ func (m *GlobalService) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return xxx_messageInfo_GlobalService.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -530,7 +429,7 @@ func (m *ReplicatedJob) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return xxx_messageInfo_ReplicatedJob.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -567,7 +466,7 @@ func (m *GlobalJob) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_GlobalJob.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -634,7 +533,7 @@ func (m *TaskSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_TaskSpec.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -660,13 +559,13 @@ type isTaskSpec_Runtime interface { } type TaskSpec_Attachment struct { - Attachment *NetworkAttachmentSpec `protobuf:"bytes,8,opt,name=attachment,proto3,oneof"` + Attachment *NetworkAttachmentSpec `protobuf:"bytes,8,opt,name=attachment,proto3,oneof" json:"attachment,omitempty"` } type TaskSpec_Container struct { - Container *ContainerSpec `protobuf:"bytes,1,opt,name=container,proto3,oneof"` + Container *ContainerSpec `protobuf:"bytes,1,opt,name=container,proto3,oneof" json:"container,omitempty"` } type TaskSpec_Generic struct { - Generic *GenericRuntimeSpec `protobuf:"bytes,10,opt,name=generic,proto3,oneof"` + Generic *GenericRuntimeSpec `protobuf:"bytes,10,opt,name=generic,proto3,oneof" json:"generic,omitempty"` } func (*TaskSpec_Attachment) isTaskSpec_Runtime() {} @@ -701,99 +600,15 @@ func (m *TaskSpec) GetGeneric() *GenericRuntimeSpec { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*TaskSpec) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _TaskSpec_OneofMarshaler, _TaskSpec_OneofUnmarshaler, _TaskSpec_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*TaskSpec) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*TaskSpec_Attachment)(nil), (*TaskSpec_Container)(nil), (*TaskSpec_Generic)(nil), } } -func _TaskSpec_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*TaskSpec) - // runtime - switch x := m.Runtime.(type) { - case *TaskSpec_Attachment: - _ = b.EncodeVarint(8<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Attachment); err != nil { - return err - } - case *TaskSpec_Container: - _ = b.EncodeVarint(1<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Container); err != nil { - return err - } - case *TaskSpec_Generic: - _ = b.EncodeVarint(10<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Generic); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("TaskSpec.Runtime has unexpected type %T", x) - } - return nil -} - -func _TaskSpec_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*TaskSpec) - switch tag { - case 8: // runtime.attachment - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(NetworkAttachmentSpec) - err := b.DecodeMessage(msg) - m.Runtime = &TaskSpec_Attachment{msg} - return true, err - case 1: // runtime.container - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(ContainerSpec) - err := b.DecodeMessage(msg) - m.Runtime = &TaskSpec_Container{msg} - return true, err - case 10: // runtime.generic - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(GenericRuntimeSpec) - err := b.DecodeMessage(msg) - m.Runtime = &TaskSpec_Generic{msg} - return true, err - default: - return false, nil - } -} - -func _TaskSpec_OneofSizer(msg proto.Message) (n int) { - m := msg.(*TaskSpec) - // runtime - switch x := m.Runtime.(type) { - case *TaskSpec_Attachment: - s := proto.Size(x.Attachment) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *TaskSpec_Container: - s := proto.Size(x.Container) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *TaskSpec_Generic: - s := proto.Size(x.Generic) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - type ResourceReference struct { ResourceID string `protobuf:"bytes,1,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"` ResourceType ResourceType `protobuf:"varint,2,opt,name=resource_type,json=resourceType,proto3,enum=docker.swarmkit.v1.ResourceType" json:"resource_type,omitempty"` @@ -812,7 +627,7 @@ func (m *ResourceReference) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_ResourceReference.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -849,7 +664,7 @@ func (m *GenericRuntimeSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_GenericRuntimeSpec.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -889,7 +704,7 @@ func (m *NetworkAttachmentSpec) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_NetworkAttachmentSpec.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1041,7 +856,7 @@ func (m *ContainerSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return xxx_messageInfo_ContainerSpec.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1082,7 +897,7 @@ func (m *ContainerSpec_PullOptions) XXX_Marshal(b []byte, deterministic bool) ([ return xxx_messageInfo_ContainerSpec_PullOptions.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1127,7 +942,7 @@ func (m *ContainerSpec_DNSConfig) XXX_Marshal(b []byte, deterministic bool) ([]b return xxx_messageInfo_ContainerSpec_DNSConfig.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1165,7 +980,7 @@ func (m *ContainerSpec_Ulimit) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_ContainerSpec_Ulimit.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1206,7 +1021,7 @@ func (m *EndpointSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_EndpointSpec.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1269,7 +1084,7 @@ func (m *NetworkSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_NetworkSpec.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1295,7 +1110,7 @@ type isNetworkSpec_ConfigFrom interface { } type NetworkSpec_Network struct { - Network string `protobuf:"bytes,8,opt,name=network,proto3,oneof"` + Network string `protobuf:"bytes,8,opt,name=network,proto3,oneof" json:"network,omitempty"` } func (*NetworkSpec_Network) isNetworkSpec_ConfigFrom() {} @@ -1314,57 +1129,13 @@ func (m *NetworkSpec) GetNetwork() string { return "" } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*NetworkSpec) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _NetworkSpec_OneofMarshaler, _NetworkSpec_OneofUnmarshaler, _NetworkSpec_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*NetworkSpec) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*NetworkSpec_Network)(nil), } } -func _NetworkSpec_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*NetworkSpec) - // config_from - switch x := m.ConfigFrom.(type) { - case *NetworkSpec_Network: - _ = b.EncodeVarint(8<<3 | proto.WireBytes) - _ = b.EncodeStringBytes(x.Network) - case nil: - default: - return fmt.Errorf("NetworkSpec.ConfigFrom has unexpected type %T", x) - } - return nil -} - -func _NetworkSpec_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*NetworkSpec) - switch tag { - case 8: // config_from.network - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeStringBytes() - m.ConfigFrom = &NetworkSpec_Network{x} - return true, err - default: - return false, nil - } -} - -func _NetworkSpec_OneofSizer(msg proto.Message) (n int) { - m := msg.(*NetworkSpec) - // config_from - switch x := m.ConfigFrom.(type) { - case *NetworkSpec_Network: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(len(x.Network))) - n += len(x.Network) - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - // ClusterSpec specifies global cluster settings. type ClusterSpec struct { Annotations Annotations `protobuf:"bytes,1,opt,name=annotations,proto3" json:"annotations"` @@ -1399,7 +1170,7 @@ func (m *ClusterSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_ClusterSpec.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1446,7 +1217,7 @@ func (m *SecretSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_SecretSpec.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1493,7 +1264,7 @@ func (m *ConfigSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_ConfigSpec.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2260,7 +2031,7 @@ func (m *ConfigSpec) CopyFrom(src interface{}) { func (m *NodeSpec) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2268,40 +2039,47 @@ func (m *NodeSpec) Marshal() (dAtA []byte, err error) { } func (m *NodeSpec) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NodeSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Annotations.Size())) - n1, err := m.Annotations.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 - if m.DesiredRole != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.DesiredRole)) + if m.Availability != 0 { + i = encodeVarintSpecs(dAtA, i, uint64(m.Availability)) + i-- + dAtA[i] = 0x20 } if m.Membership != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintSpecs(dAtA, i, uint64(m.Membership)) + i-- + dAtA[i] = 0x18 } - if m.Availability != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Availability)) + if m.DesiredRole != 0 { + i = encodeVarintSpecs(dAtA, i, uint64(m.DesiredRole)) + i-- + dAtA[i] = 0x10 } - return i, nil + { + size, err := m.Annotations.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *ServiceSpec) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2309,138 +2087,185 @@ func (m *ServiceSpec) Marshal() (dAtA []byte, err error) { } func (m *ServiceSpec) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ServiceSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Annotations.Size())) - n2, err := m.Annotations.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n2 - dAtA[i] = 0x12 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Task.Size())) - n3, err := m.Task.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n3 if m.Mode != nil { - nn4, err := m.Mode.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.Mode.Size() + i -= size + if _, err := m.Mode.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn4 } - if m.Update != nil { - dAtA[i] = 0x32 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Update.Size())) - n5, err := m.Update.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n5 - } - if len(m.Networks) > 0 { - for _, msg := range m.Networks { - dAtA[i] = 0x3a - i++ - i = encodeVarintSpecs(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + if m.Rollback != nil { + { + size, err := m.Rollback.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x4a } if m.Endpoint != nil { + { + size, err := m.Endpoint.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x42 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Endpoint.Size())) - n6, err := m.Endpoint.MarshalTo(dAtA[i:]) + } + 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 = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } + if m.Update != nil { + { + size, err := m.Update.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + { + size, err := m.Task.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n6 + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) } - if m.Rollback != nil { - dAtA[i] = 0x4a - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Rollback.Size())) - n7, err := m.Rollback.MarshalTo(dAtA[i:]) + i-- + dAtA[i] = 0x12 + { + size, err := m.Annotations.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n7 + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) } - return i, nil + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *ServiceSpec_Replicated) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ServiceSpec_Replicated) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Replicated != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Replicated.Size())) - n8, err := m.Replicated.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Replicated.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) } - i += n8 + i-- + dAtA[i] = 0x1a } - return i, nil + return len(dAtA) - i, nil } func (m *ServiceSpec_Global) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ServiceSpec_Global) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Global != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Global.Size())) - n9, err := m.Global.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Global.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) } - i += n9 + i-- + dAtA[i] = 0x22 } - return i, nil + return len(dAtA) - i, nil } func (m *ServiceSpec_ReplicatedJob) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ServiceSpec_ReplicatedJob) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.ReplicatedJob != nil { - dAtA[i] = 0x52 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.ReplicatedJob.Size())) - n10, err := m.ReplicatedJob.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.ReplicatedJob.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) } - i += n10 + i-- + dAtA[i] = 0x52 } - return i, nil + return len(dAtA) - i, nil } func (m *ServiceSpec_GlobalJob) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ServiceSpec_GlobalJob) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.GlobalJob != nil { - dAtA[i] = 0x5a - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.GlobalJob.Size())) - n11, err := m.GlobalJob.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.GlobalJob.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) } - i += n11 + i-- + dAtA[i] = 0x5a } - return i, nil + return len(dAtA) - i, nil } func (m *ReplicatedService) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2448,22 +2273,27 @@ func (m *ReplicatedService) Marshal() (dAtA []byte, err error) { } func (m *ReplicatedService) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ReplicatedService) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Replicas != 0 { - dAtA[i] = 0x8 - i++ i = encodeVarintSpecs(dAtA, i, uint64(m.Replicas)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *GlobalService) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2471,17 +2301,22 @@ func (m *GlobalService) Marshal() (dAtA []byte, err error) { } func (m *GlobalService) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GlobalService) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + return len(dAtA) - i, nil } func (m *ReplicatedJob) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2489,27 +2324,32 @@ func (m *ReplicatedJob) Marshal() (dAtA []byte, err error) { } func (m *ReplicatedJob) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ReplicatedJob) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.MaxConcurrent != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.MaxConcurrent)) - } if m.TotalCompletions != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintSpecs(dAtA, i, uint64(m.TotalCompletions)) + i-- + dAtA[i] = 0x10 } - return i, nil + if m.MaxConcurrent != 0 { + i = encodeVarintSpecs(dAtA, i, uint64(m.MaxConcurrent)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *GlobalJob) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2517,17 +2357,22 @@ func (m *GlobalJob) Marshal() (dAtA []byte, err error) { } func (m *GlobalJob) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GlobalJob) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + return len(dAtA) - i, nil } func (m *TaskSpec) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2535,135 +2380,175 @@ func (m *TaskSpec) Marshal() (dAtA []byte, err error) { } func (m *TaskSpec) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TaskSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if len(m.ResourceReferences) > 0 { + for iNdEx := len(m.ResourceReferences) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ResourceReferences[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + } + } if m.Runtime != nil { - nn12, err := m.Runtime.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += nn12 - } - if m.Resources != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Resources.Size())) - n13, err := m.Resources.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n13 - } - if m.Restart != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Restart.Size())) - n14, err := m.Restart.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n14 - } - if m.Placement != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Placement.Size())) - n15, err := m.Placement.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n15 - } - if m.LogDriver != nil { - dAtA[i] = 0x32 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.LogDriver.Size())) - n16, err := m.LogDriver.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n16 - } - if len(m.Networks) > 0 { - for _, msg := range m.Networks { - dAtA[i] = 0x3a - i++ - i = encodeVarintSpecs(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { + { + size := m.Runtime.Size() + i -= size + if _, err := m.Runtime.MarshalTo(dAtA[i:]); err != nil { return 0, err } - i += n } } if m.ForceUpdate != 0 { - dAtA[i] = 0x48 - i++ i = encodeVarintSpecs(dAtA, i, uint64(m.ForceUpdate)) + i-- + dAtA[i] = 0x48 } - if len(m.ResourceReferences) > 0 { - for _, msg := range m.ResourceReferences { - dAtA[i] = 0x5a - i++ - i = encodeVarintSpecs(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + 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 = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } + if m.LogDriver != nil { + { + size, err := m.LogDriver.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x32 } - return i, nil + if m.Placement != nil { + { + size, err := m.Placement.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.Restart != nil { + { + size, err := m.Restart.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Resources != nil { + { + size, err := m.Resources.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil } func (m *TaskSpec_Container) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TaskSpec_Container) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Container != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Container.Size())) - n17, err := m.Container.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Container.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) } - i += n17 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *TaskSpec_Attachment) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TaskSpec_Attachment) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Attachment != nil { - dAtA[i] = 0x42 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Attachment.Size())) - n18, err := m.Attachment.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Attachment.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) } - i += n18 + i-- + dAtA[i] = 0x42 } - return i, nil + return len(dAtA) - i, nil } func (m *TaskSpec_Generic) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TaskSpec_Generic) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Generic != nil { - dAtA[i] = 0x52 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Generic.Size())) - n19, err := m.Generic.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Generic.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) } - i += n19 + i-- + dAtA[i] = 0x52 } - return i, nil + return len(dAtA) - i, nil } func (m *ResourceReference) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2671,28 +2556,34 @@ func (m *ResourceReference) Marshal() (dAtA []byte, err error) { } func (m *ResourceReference) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ResourceReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ResourceID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintSpecs(dAtA, i, uint64(len(m.ResourceID))) - i += copy(dAtA[i:], m.ResourceID) - } if m.ResourceType != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintSpecs(dAtA, i, uint64(m.ResourceType)) + i-- + dAtA[i] = 0x10 } - return i, nil + if len(m.ResourceID) > 0 { + i -= len(m.ResourceID) + copy(dAtA[i:], m.ResourceID) + i = encodeVarintSpecs(dAtA, i, uint64(len(m.ResourceID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *GenericRuntimeSpec) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2700,33 +2591,41 @@ func (m *GenericRuntimeSpec) Marshal() (dAtA []byte, err error) { } func (m *GenericRuntimeSpec) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenericRuntimeSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Kind) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintSpecs(dAtA, i, uint64(len(m.Kind))) - i += copy(dAtA[i:], m.Kind) - } if m.Payload != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Payload.Size())) - n20, err := m.Payload.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Payload.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) } - i += n20 + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.Kind) > 0 { + i -= len(m.Kind) + copy(dAtA[i:], m.Kind) + i = encodeVarintSpecs(dAtA, i, uint64(len(m.Kind))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *NetworkAttachmentSpec) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2734,23 +2633,29 @@ func (m *NetworkAttachmentSpec) Marshal() (dAtA []byte, err error) { } func (m *NetworkAttachmentSpec) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NetworkAttachmentSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.ContainerID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.ContainerID) + copy(dAtA[i:], m.ContainerID) i = encodeVarintSpecs(dAtA, i, uint64(len(m.ContainerID))) - i += copy(dAtA[i:], m.ContainerID) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ContainerSpec) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2758,362 +2663,354 @@ func (m *ContainerSpec) Marshal() (dAtA []byte, err error) { } func (m *ContainerSpec) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ContainerSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Image) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintSpecs(dAtA, i, uint64(len(m.Image))) - i += copy(dAtA[i:], m.Image) - } - if len(m.Labels) > 0 { - for k, _ := range m.Labels { - dAtA[i] = 0x12 - i++ - v := m.Labels[k] - mapSize := 1 + len(k) + sovSpecs(uint64(len(k))) + 1 + len(v) + sovSpecs(uint64(len(v))) - i = encodeVarintSpecs(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintSpecs(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) - } - } - if len(m.Command) > 0 { - for _, s := range m.Command { - dAtA[i] = 0x1a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ + if len(m.Ulimits) > 0 { + for iNdEx := len(m.Ulimits) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Ulimits[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - if len(m.Args) > 0 { - for _, s := range m.Args { - dAtA[i] = 0x22 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - if len(m.Env) > 0 { - for _, s := range m.Env { - dAtA[i] = 0x2a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - if len(m.Dir) > 0 { - dAtA[i] = 0x32 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(len(m.Dir))) - i += copy(dAtA[i:], m.Dir) - } - if len(m.User) > 0 { - dAtA[i] = 0x3a - i++ - i = encodeVarintSpecs(dAtA, i, uint64(len(m.User))) - i += copy(dAtA[i:], m.User) - } - if len(m.Mounts) > 0 { - for _, msg := range m.Mounts { - dAtA[i] = 0x42 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.StopGracePeriod != nil { - dAtA[i] = 0x4a - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.StopGracePeriod.Size())) - n21, err := m.StopGracePeriod.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n21 - } - if m.PullOptions != nil { - dAtA[i] = 0x52 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.PullOptions.Size())) - n22, err := m.PullOptions.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n22 - } - if len(m.Groups) > 0 { - for _, s := range m.Groups { - dAtA[i] = 0x5a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - if len(m.Secrets) > 0 { - for _, msg := range m.Secrets { - dAtA[i] = 0x62 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.TTY { - dAtA[i] = 0x68 - i++ - if m.TTY { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if len(m.Hostname) > 0 { - dAtA[i] = 0x72 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(len(m.Hostname))) - i += copy(dAtA[i:], m.Hostname) - } - if m.DNSConfig != nil { - dAtA[i] = 0x7a - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.DNSConfig.Size())) - n23, err := m.DNSConfig.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n23 - } - if m.Healthcheck != nil { - dAtA[i] = 0x82 - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Healthcheck.Size())) - n24, err := m.Healthcheck.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n24 - } - if len(m.Hosts) > 0 { - for _, s := range m.Hosts { - dAtA[i] = 0x8a - i++ + i-- dAtA[i] = 0x1 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + i-- + dAtA[i] = 0xea } } - if m.OpenStdin { - dAtA[i] = 0x90 - i++ - dAtA[i] = 0x1 - i++ - if m.OpenStdin { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + if len(m.CapabilityDrop) > 0 { + for iNdEx := len(m.CapabilityDrop) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.CapabilityDrop[iNdEx]) + copy(dAtA[i:], m.CapabilityDrop[iNdEx]) + i = encodeVarintSpecs(dAtA, i, uint64(len(m.CapabilityDrop[iNdEx]))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xe2 } - i++ + } + if len(m.CapabilityAdd) > 0 { + for iNdEx := len(m.CapabilityAdd) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.CapabilityAdd[iNdEx]) + copy(dAtA[i:], m.CapabilityAdd[iNdEx]) + i = encodeVarintSpecs(dAtA, i, uint64(len(m.CapabilityAdd[iNdEx]))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xda + } + } + if len(m.Sysctls) > 0 { + for k := range m.Sysctls { + v := m.Sysctls[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintSpecs(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintSpecs(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintSpecs(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xd2 + } + } + if m.PidsLimit != 0 { + i = encodeVarintSpecs(dAtA, i, uint64(m.PidsLimit)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xc8 + } + if m.Isolation != 0 { + i = encodeVarintSpecs(dAtA, i, uint64(m.Isolation)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xc0 + } + if m.Init != nil { + { + size, err := m.Init.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xba + } + if m.Privileges != nil { + { + size, err := m.Privileges.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb2 + } + 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 = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xaa + } + } + if len(m.StopSignal) > 0 { + i -= len(m.StopSignal) + copy(dAtA[i:], m.StopSignal) + i = encodeVarintSpecs(dAtA, i, uint64(len(m.StopSignal))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa2 } if m.ReadOnly { - dAtA[i] = 0x98 - i++ - dAtA[i] = 0x1 - i++ + i-- if m.ReadOnly { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ - } - if len(m.StopSignal) > 0 { - dAtA[i] = 0xa2 - i++ + i-- dAtA[i] = 0x1 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(len(m.StopSignal))) - i += copy(dAtA[i:], m.StopSignal) + i-- + dAtA[i] = 0x98 } - if len(m.Configs) > 0 { - for _, msg := range m.Configs { - dAtA[i] = 0xaa - i++ + if m.OpenStdin { + i-- + if m.OpenStdin { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x90 + } + if len(m.Hosts) > 0 { + for iNdEx := len(m.Hosts) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Hosts[iNdEx]) + copy(dAtA[i:], m.Hosts[iNdEx]) + i = encodeVarintSpecs(dAtA, i, uint64(len(m.Hosts[iNdEx]))) + i-- dAtA[i] = 0x1 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + i-- + dAtA[i] = 0x8a + } + } + if m.Healthcheck != nil { + { + size, err := m.Healthcheck.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + if m.DNSConfig != nil { + { + size, err := m.DNSConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x7a + } + if len(m.Hostname) > 0 { + i -= len(m.Hostname) + copy(dAtA[i:], m.Hostname) + i = encodeVarintSpecs(dAtA, i, uint64(len(m.Hostname))) + i-- + dAtA[i] = 0x72 + } + if m.TTY { + i-- + if m.TTY { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x68 + } + 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 = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 } } - if m.Privileges != nil { - dAtA[i] = 0xb2 - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Privileges.Size())) - n25, err := m.Privileges.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.Groups) > 0 { + for iNdEx := len(m.Groups) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Groups[iNdEx]) + copy(dAtA[i:], m.Groups[iNdEx]) + i = encodeVarintSpecs(dAtA, i, uint64(len(m.Groups[iNdEx]))) + i-- + dAtA[i] = 0x5a } - i += n25 } - if m.Init != nil { - dAtA[i] = 0xba - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Init.Size())) - n26, err := m.Init.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.PullOptions != nil { + { + size, err := m.PullOptions.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) } - i += n26 + i-- + dAtA[i] = 0x52 } - if m.Isolation != 0 { - dAtA[i] = 0xc0 - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Isolation)) + if m.StopGracePeriod != nil { + { + size, err := m.StopGracePeriod.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a } - if m.PidsLimit != 0 { - dAtA[i] = 0xc8 - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.PidsLimit)) + if len(m.Mounts) > 0 { + for iNdEx := len(m.Mounts) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Mounts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } } - if len(m.Sysctls) > 0 { - for k, _ := range m.Sysctls { - dAtA[i] = 0xd2 - i++ - dAtA[i] = 0x1 - i++ - v := m.Sysctls[k] - mapSize := 1 + len(k) + sovSpecs(uint64(len(k))) + 1 + len(v) + sovSpecs(uint64(len(v))) - i = encodeVarintSpecs(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintSpecs(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ + if len(m.User) > 0 { + i -= len(m.User) + copy(dAtA[i:], m.User) + i = encodeVarintSpecs(dAtA, i, uint64(len(m.User))) + i-- + dAtA[i] = 0x3a + } + if len(m.Dir) > 0 { + i -= len(m.Dir) + copy(dAtA[i:], m.Dir) + i = encodeVarintSpecs(dAtA, i, uint64(len(m.Dir))) + i-- + dAtA[i] = 0x32 + } + if len(m.Env) > 0 { + for iNdEx := len(m.Env) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Env[iNdEx]) + copy(dAtA[i:], m.Env[iNdEx]) + i = encodeVarintSpecs(dAtA, i, uint64(len(m.Env[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } + if len(m.Args) > 0 { + for iNdEx := len(m.Args) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Args[iNdEx]) + copy(dAtA[i:], m.Args[iNdEx]) + i = encodeVarintSpecs(dAtA, i, uint64(len(m.Args[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(m.Command) > 0 { + for iNdEx := len(m.Command) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Command[iNdEx]) + copy(dAtA[i:], m.Command[iNdEx]) + i = encodeVarintSpecs(dAtA, i, uint64(len(m.Command[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if len(m.Labels) > 0 { + for k := range m.Labels { + v := m.Labels[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) i = encodeVarintSpecs(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintSpecs(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintSpecs(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 } } - if len(m.CapabilityAdd) > 0 { - for _, s := range m.CapabilityAdd { - dAtA[i] = 0xda - i++ - dAtA[i] = 0x1 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } + if len(m.Image) > 0 { + i -= len(m.Image) + copy(dAtA[i:], m.Image) + i = encodeVarintSpecs(dAtA, i, uint64(len(m.Image))) + i-- + dAtA[i] = 0xa } - if len(m.CapabilityDrop) > 0 { - for _, s := range m.CapabilityDrop { - dAtA[i] = 0xe2 - i++ - dAtA[i] = 0x1 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - if len(m.Ulimits) > 0 { - for _, msg := range m.Ulimits { - dAtA[i] = 0xea - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - return i, nil + return len(dAtA) - i, nil } func (m *ContainerSpec_PullOptions) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3121,25 +3018,31 @@ func (m *ContainerSpec_PullOptions) Marshal() (dAtA []byte, err error) { } func (m *ContainerSpec_PullOptions) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ContainerSpec_PullOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.RegistryAuth) > 0 { - dAtA[i] = 0x82 - i++ - dAtA[i] = 0x4 - i++ + i -= len(m.RegistryAuth) + copy(dAtA[i:], m.RegistryAuth) i = encodeVarintSpecs(dAtA, i, uint64(len(m.RegistryAuth))) - i += copy(dAtA[i:], m.RegistryAuth) + i-- + dAtA[i] = 0x4 + i-- + dAtA[i] = 0x82 } - return i, nil + return len(dAtA) - i, nil } func (m *ContainerSpec_DNSConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3147,62 +3050,49 @@ func (m *ContainerSpec_DNSConfig) Marshal() (dAtA []byte, err error) { } func (m *ContainerSpec_DNSConfig) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ContainerSpec_DNSConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Nameservers) > 0 { - for _, s := range m.Nameservers { - dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if len(m.Options) > 0 { + for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Options[iNdEx]) + copy(dAtA[i:], m.Options[iNdEx]) + i = encodeVarintSpecs(dAtA, i, uint64(len(m.Options[iNdEx]))) + i-- + dAtA[i] = 0x1a } } if len(m.Search) > 0 { - for _, s := range m.Search { + for iNdEx := len(m.Search) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Search[iNdEx]) + copy(dAtA[i:], m.Search[iNdEx]) + i = encodeVarintSpecs(dAtA, i, uint64(len(m.Search[iNdEx]))) + i-- dAtA[i] = 0x12 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) } } - if len(m.Options) > 0 { - for _, s := range m.Options { - dAtA[i] = 0x1a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if len(m.Nameservers) > 0 { + for iNdEx := len(m.Nameservers) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Nameservers[iNdEx]) + copy(dAtA[i:], m.Nameservers[iNdEx]) + i = encodeVarintSpecs(dAtA, i, uint64(len(m.Nameservers[iNdEx]))) + i-- + dAtA[i] = 0xa } } - return i, nil + return len(dAtA) - i, nil } func (m *ContainerSpec_Ulimit) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3210,33 +3100,39 @@ func (m *ContainerSpec_Ulimit) Marshal() (dAtA []byte, err error) { } func (m *ContainerSpec_Ulimit) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ContainerSpec_Ulimit) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintSpecs(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + if m.Hard != 0 { + i = encodeVarintSpecs(dAtA, i, uint64(m.Hard)) + i-- + dAtA[i] = 0x18 } if m.Soft != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintSpecs(dAtA, i, uint64(m.Soft)) + i-- + dAtA[i] = 0x10 } - if m.Hard != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Hard)) + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintSpecs(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *EndpointSpec) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3244,34 +3140,41 @@ func (m *EndpointSpec) Marshal() (dAtA []byte, err error) { } func (m *EndpointSpec) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EndpointSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Mode != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Mode)) - } if len(m.Ports) > 0 { - for _, msg := range m.Ports { - dAtA[i] = 0x12 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Ports) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Ports[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x12 } } - return i, nil + if m.Mode != 0 { + i = encodeVarintSpecs(dAtA, i, uint64(m.Mode)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *NetworkSpec) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3279,100 +3182,119 @@ func (m *NetworkSpec) Marshal() (dAtA []byte, err error) { } func (m *NetworkSpec) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NetworkSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Annotations.Size())) - n27, err := m.Annotations.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n27 - if m.DriverConfig != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.DriverConfig.Size())) - n28, err := m.DriverConfig.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.ConfigFrom != nil { + { + size := m.ConfigFrom.Size() + i -= size + if _, err := m.ConfigFrom.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += n28 - } - if m.Ipv6Enabled { - dAtA[i] = 0x18 - i++ - if m.Ipv6Enabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.Internal { - dAtA[i] = 0x20 - i++ - if m.Internal { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.IPAM != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.IPAM.Size())) - n29, err := m.IPAM.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n29 - } - if m.Attachable { - dAtA[i] = 0x30 - i++ - if m.Attachable { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ } if m.Ingress { - dAtA[i] = 0x38 - i++ + i-- if m.Ingress { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x38 } - if m.ConfigFrom != nil { - nn30, err := m.ConfigFrom.MarshalTo(dAtA[i:]) + if m.Attachable { + i-- + if m.Attachable { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if m.IPAM != nil { + { + size, err := m.IPAM.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.Internal { + i-- + if m.Internal { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if m.Ipv6Enabled { + i-- + if m.Ipv6Enabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if m.DriverConfig != nil { + { + size, err := m.DriverConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + { + size, err := m.Annotations.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += nn30 + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) } - return i, nil + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *NetworkSpec_Network) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x42 - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NetworkSpec_Network) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Network) + copy(dAtA[i:], m.Network) i = encodeVarintSpecs(dAtA, i, uint64(len(m.Network))) - i += copy(dAtA[i:], m.Network) - return i, nil + i-- + dAtA[i] = 0x42 + return len(dAtA) - i, nil } func (m *ClusterSpec) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3380,81 +3302,102 @@ func (m *ClusterSpec) Marshal() (dAtA []byte, err error) { } func (m *ClusterSpec) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ClusterSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Annotations.Size())) - n31, err := m.Annotations.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.EncryptionConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) } - i += n31 - dAtA[i] = 0x12 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.AcceptancePolicy.Size())) - n32, err := m.AcceptancePolicy.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n32 - dAtA[i] = 0x1a - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Orchestration.Size())) - n33, err := m.Orchestration.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n33 - dAtA[i] = 0x22 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Raft.Size())) - n34, err := m.Raft.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n34 - dAtA[i] = 0x2a - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Dispatcher.Size())) - n35, err := m.Dispatcher.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n35 - dAtA[i] = 0x32 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.CAConfig.Size())) - n36, err := m.CAConfig.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n36 - dAtA[i] = 0x3a - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.TaskDefaults.Size())) - n37, err := m.TaskDefaults.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n37 + i-- dAtA[i] = 0x42 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.EncryptionConfig.Size())) - n38, err := m.EncryptionConfig.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.TaskDefaults.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) } - i += n38 - return i, nil + i-- + dAtA[i] = 0x3a + { + size, err := m.CAConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + { + size, err := m.Dispatcher.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + { + size, err := m.Raft.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + { + size, err := m.Orchestration.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.AcceptancePolicy.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.Annotations.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *SecretSpec) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3462,51 +3405,63 @@ func (m *SecretSpec) Marshal() (dAtA []byte, err error) { } func (m *SecretSpec) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SecretSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Annotations.Size())) - n39, err := m.Annotations.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n39 - if len(m.Data) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(len(m.Data))) - i += copy(dAtA[i:], m.Data) + if m.Driver != nil { + { + size, err := m.Driver.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 } if m.Templating != nil { + { + size, err := m.Templating.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x1a - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Templating.Size())) - n40, err := m.Templating.MarshalTo(dAtA[i:]) + } + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintSpecs(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0x12 + } + { + size, err := m.Annotations.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n40 + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) } - if m.Driver != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Driver.Size())) - n41, err := m.Driver.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n41 - } - return i, nil + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *ConfigSpec) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3514,45 +3469,57 @@ func (m *ConfigSpec) Marshal() (dAtA []byte, err error) { } func (m *ConfigSpec) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConfigSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Annotations.Size())) - n42, err := m.Annotations.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n42 - if len(m.Data) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintSpecs(dAtA, i, uint64(len(m.Data))) - i += copy(dAtA[i:], m.Data) - } if m.Templating != nil { + { + size, err := m.Templating.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x1a - i++ - i = encodeVarintSpecs(dAtA, i, uint64(m.Templating.Size())) - n43, err := m.Templating.MarshalTo(dAtA[i:]) + } + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintSpecs(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0x12 + } + { + size, err := m.Annotations.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n43 + i -= size + i = encodeVarintSpecs(dAtA, i, uint64(size)) } - return i, nil + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func encodeVarintSpecs(dAtA []byte, offset int, v uint64) int { + offset -= sovSpecs(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *NodeSpec) Size() (n int) { if m == nil { @@ -4165,14 +4132,7 @@ func (m *ConfigSpec) Size() (n int) { } func sovSpecs(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozSpecs(x uint64) (n int) { return sovSpecs(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -4182,7 +4142,7 @@ func (this *NodeSpec) String() string { return "nil" } s := strings.Join([]string{`&NodeSpec{`, - `Annotations:` + strings.Replace(strings.Replace(this.Annotations.String(), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, + `Annotations:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Annotations), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, `DesiredRole:` + fmt.Sprintf("%v", this.DesiredRole) + `,`, `Membership:` + fmt.Sprintf("%v", this.Membership) + `,`, `Availability:` + fmt.Sprintf("%v", this.Availability) + `,`, @@ -4194,13 +4154,18 @@ func (this *ServiceSpec) String() string { if this == nil { return "nil" } + repeatedStringForNetworks := "[]*NetworkAttachmentConfig{" + for _, f := range this.Networks { + repeatedStringForNetworks += strings.Replace(fmt.Sprintf("%v", f), "NetworkAttachmentConfig", "NetworkAttachmentConfig", 1) + "," + } + repeatedStringForNetworks += "}" s := strings.Join([]string{`&ServiceSpec{`, - `Annotations:` + strings.Replace(strings.Replace(this.Annotations.String(), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, + `Annotations:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Annotations), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, `Task:` + strings.Replace(strings.Replace(this.Task.String(), "TaskSpec", "TaskSpec", 1), `&`, ``, 1) + `,`, `Mode:` + fmt.Sprintf("%v", this.Mode) + `,`, `Update:` + strings.Replace(fmt.Sprintf("%v", this.Update), "UpdateConfig", "UpdateConfig", 1) + `,`, - `Networks:` + strings.Replace(fmt.Sprintf("%v", this.Networks), "NetworkAttachmentConfig", "NetworkAttachmentConfig", 1) + `,`, - `Endpoint:` + strings.Replace(fmt.Sprintf("%v", this.Endpoint), "EndpointSpec", "EndpointSpec", 1) + `,`, + `Networks:` + repeatedStringForNetworks + `,`, + `Endpoint:` + strings.Replace(this.Endpoint.String(), "EndpointSpec", "EndpointSpec", 1) + `,`, `Rollback:` + strings.Replace(fmt.Sprintf("%v", this.Rollback), "UpdateConfig", "UpdateConfig", 1) + `,`, `}`, }, "") @@ -4289,15 +4254,25 @@ func (this *TaskSpec) String() string { if this == nil { return "nil" } + repeatedStringForNetworks := "[]*NetworkAttachmentConfig{" + for _, f := range this.Networks { + repeatedStringForNetworks += strings.Replace(fmt.Sprintf("%v", f), "NetworkAttachmentConfig", "NetworkAttachmentConfig", 1) + "," + } + repeatedStringForNetworks += "}" + repeatedStringForResourceReferences := "[]ResourceReference{" + for _, f := range this.ResourceReferences { + repeatedStringForResourceReferences += strings.Replace(strings.Replace(f.String(), "ResourceReference", "ResourceReference", 1), `&`, ``, 1) + "," + } + repeatedStringForResourceReferences += "}" s := strings.Join([]string{`&TaskSpec{`, `Runtime:` + fmt.Sprintf("%v", this.Runtime) + `,`, `Resources:` + strings.Replace(fmt.Sprintf("%v", this.Resources), "ResourceRequirements", "ResourceRequirements", 1) + `,`, `Restart:` + strings.Replace(fmt.Sprintf("%v", this.Restart), "RestartPolicy", "RestartPolicy", 1) + `,`, `Placement:` + strings.Replace(fmt.Sprintf("%v", this.Placement), "Placement", "Placement", 1) + `,`, `LogDriver:` + strings.Replace(fmt.Sprintf("%v", this.LogDriver), "Driver", "Driver", 1) + `,`, - `Networks:` + strings.Replace(fmt.Sprintf("%v", this.Networks), "NetworkAttachmentConfig", "NetworkAttachmentConfig", 1) + `,`, + `Networks:` + repeatedStringForNetworks + `,`, `ForceUpdate:` + fmt.Sprintf("%v", this.ForceUpdate) + `,`, - `ResourceReferences:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ResourceReferences), "ResourceReference", "ResourceReference", 1), `&`, ``, 1) + `,`, + `ResourceReferences:` + repeatedStringForResourceReferences + `,`, `}`, }, "") return s @@ -4368,6 +4343,26 @@ func (this *ContainerSpec) String() string { if this == nil { return "nil" } + repeatedStringForMounts := "[]Mount{" + for _, f := range this.Mounts { + repeatedStringForMounts += fmt.Sprintf("%v", f) + "," + } + repeatedStringForMounts += "}" + repeatedStringForSecrets := "[]*SecretReference{" + for _, f := range this.Secrets { + repeatedStringForSecrets += strings.Replace(fmt.Sprintf("%v", f), "SecretReference", "SecretReference", 1) + "," + } + repeatedStringForSecrets += "}" + repeatedStringForConfigs := "[]*ConfigReference{" + for _, f := range this.Configs { + repeatedStringForConfigs += strings.Replace(fmt.Sprintf("%v", f), "ConfigReference", "ConfigReference", 1) + "," + } + repeatedStringForConfigs += "}" + repeatedStringForUlimits := "[]*ContainerSpec_Ulimit{" + for _, f := range this.Ulimits { + repeatedStringForUlimits += strings.Replace(fmt.Sprintf("%v", f), "ContainerSpec_Ulimit", "ContainerSpec_Ulimit", 1) + "," + } + repeatedStringForUlimits += "}" keysForLabels := make([]string, 0, len(this.Labels)) for k, _ := range this.Labels { keysForLabels = append(keysForLabels, k) @@ -4396,11 +4391,11 @@ func (this *ContainerSpec) String() string { `Env:` + fmt.Sprintf("%v", this.Env) + `,`, `Dir:` + fmt.Sprintf("%v", this.Dir) + `,`, `User:` + fmt.Sprintf("%v", this.User) + `,`, - `Mounts:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Mounts), "Mount", "Mount", 1), `&`, ``, 1) + `,`, + `Mounts:` + repeatedStringForMounts + `,`, `StopGracePeriod:` + strings.Replace(fmt.Sprintf("%v", this.StopGracePeriod), "Duration", "types.Duration", 1) + `,`, `PullOptions:` + strings.Replace(fmt.Sprintf("%v", this.PullOptions), "ContainerSpec_PullOptions", "ContainerSpec_PullOptions", 1) + `,`, `Groups:` + fmt.Sprintf("%v", this.Groups) + `,`, - `Secrets:` + strings.Replace(fmt.Sprintf("%v", this.Secrets), "SecretReference", "SecretReference", 1) + `,`, + `Secrets:` + repeatedStringForSecrets + `,`, `TTY:` + fmt.Sprintf("%v", this.TTY) + `,`, `Hostname:` + fmt.Sprintf("%v", this.Hostname) + `,`, `DNSConfig:` + strings.Replace(fmt.Sprintf("%v", this.DNSConfig), "ContainerSpec_DNSConfig", "ContainerSpec_DNSConfig", 1) + `,`, @@ -4409,7 +4404,7 @@ func (this *ContainerSpec) String() string { `OpenStdin:` + fmt.Sprintf("%v", this.OpenStdin) + `,`, `ReadOnly:` + fmt.Sprintf("%v", this.ReadOnly) + `,`, `StopSignal:` + fmt.Sprintf("%v", this.StopSignal) + `,`, - `Configs:` + strings.Replace(fmt.Sprintf("%v", this.Configs), "ConfigReference", "ConfigReference", 1) + `,`, + `Configs:` + repeatedStringForConfigs + `,`, `Privileges:` + strings.Replace(fmt.Sprintf("%v", this.Privileges), "Privileges", "Privileges", 1) + `,`, `Init:` + strings.Replace(fmt.Sprintf("%v", this.Init), "BoolValue", "types.BoolValue", 1) + `,`, `Isolation:` + fmt.Sprintf("%v", this.Isolation) + `,`, @@ -4417,7 +4412,7 @@ func (this *ContainerSpec) String() string { `Sysctls:` + mapStringForSysctls + `,`, `CapabilityAdd:` + fmt.Sprintf("%v", this.CapabilityAdd) + `,`, `CapabilityDrop:` + fmt.Sprintf("%v", this.CapabilityDrop) + `,`, - `Ulimits:` + strings.Replace(fmt.Sprintf("%v", this.Ulimits), "ContainerSpec_Ulimit", "ContainerSpec_Ulimit", 1) + `,`, + `Ulimits:` + repeatedStringForUlimits + `,`, `}`, }, "") return s @@ -4460,9 +4455,14 @@ func (this *EndpointSpec) String() string { if this == nil { return "nil" } + repeatedStringForPorts := "[]*PortConfig{" + for _, f := range this.Ports { + repeatedStringForPorts += strings.Replace(fmt.Sprintf("%v", f), "PortConfig", "PortConfig", 1) + "," + } + repeatedStringForPorts += "}" s := strings.Join([]string{`&EndpointSpec{`, `Mode:` + fmt.Sprintf("%v", this.Mode) + `,`, - `Ports:` + strings.Replace(fmt.Sprintf("%v", this.Ports), "PortConfig", "PortConfig", 1) + `,`, + `Ports:` + repeatedStringForPorts + `,`, `}`, }, "") return s @@ -4472,7 +4472,7 @@ func (this *NetworkSpec) String() string { return "nil" } s := strings.Join([]string{`&NetworkSpec{`, - `Annotations:` + strings.Replace(strings.Replace(this.Annotations.String(), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, + `Annotations:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Annotations), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, `DriverConfig:` + strings.Replace(fmt.Sprintf("%v", this.DriverConfig), "Driver", "Driver", 1) + `,`, `Ipv6Enabled:` + fmt.Sprintf("%v", this.Ipv6Enabled) + `,`, `Internal:` + fmt.Sprintf("%v", this.Internal) + `,`, @@ -4499,14 +4499,14 @@ func (this *ClusterSpec) String() string { return "nil" } s := strings.Join([]string{`&ClusterSpec{`, - `Annotations:` + strings.Replace(strings.Replace(this.Annotations.String(), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, - `AcceptancePolicy:` + strings.Replace(strings.Replace(this.AcceptancePolicy.String(), "AcceptancePolicy", "AcceptancePolicy", 1), `&`, ``, 1) + `,`, - `Orchestration:` + strings.Replace(strings.Replace(this.Orchestration.String(), "OrchestrationConfig", "OrchestrationConfig", 1), `&`, ``, 1) + `,`, - `Raft:` + strings.Replace(strings.Replace(this.Raft.String(), "RaftConfig", "RaftConfig", 1), `&`, ``, 1) + `,`, - `Dispatcher:` + strings.Replace(strings.Replace(this.Dispatcher.String(), "DispatcherConfig", "DispatcherConfig", 1), `&`, ``, 1) + `,`, - `CAConfig:` + strings.Replace(strings.Replace(this.CAConfig.String(), "CAConfig", "CAConfig", 1), `&`, ``, 1) + `,`, - `TaskDefaults:` + strings.Replace(strings.Replace(this.TaskDefaults.String(), "TaskDefaults", "TaskDefaults", 1), `&`, ``, 1) + `,`, - `EncryptionConfig:` + strings.Replace(strings.Replace(this.EncryptionConfig.String(), "EncryptionConfig", "EncryptionConfig", 1), `&`, ``, 1) + `,`, + `Annotations:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Annotations), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, + `AcceptancePolicy:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.AcceptancePolicy), "AcceptancePolicy", "AcceptancePolicy", 1), `&`, ``, 1) + `,`, + `Orchestration:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Orchestration), "OrchestrationConfig", "OrchestrationConfig", 1), `&`, ``, 1) + `,`, + `Raft:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Raft), "RaftConfig", "RaftConfig", 1), `&`, ``, 1) + `,`, + `Dispatcher:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Dispatcher), "DispatcherConfig", "DispatcherConfig", 1), `&`, ``, 1) + `,`, + `CAConfig:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.CAConfig), "CAConfig", "CAConfig", 1), `&`, ``, 1) + `,`, + `TaskDefaults:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.TaskDefaults), "TaskDefaults", "TaskDefaults", 1), `&`, ``, 1) + `,`, + `EncryptionConfig:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.EncryptionConfig), "EncryptionConfig", "EncryptionConfig", 1), `&`, ``, 1) + `,`, `}`, }, "") return s @@ -4516,7 +4516,7 @@ func (this *SecretSpec) String() string { return "nil" } s := strings.Join([]string{`&SecretSpec{`, - `Annotations:` + strings.Replace(strings.Replace(this.Annotations.String(), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, + `Annotations:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Annotations), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, `Data:` + fmt.Sprintf("%v", this.Data) + `,`, `Templating:` + strings.Replace(fmt.Sprintf("%v", this.Templating), "Driver", "Driver", 1) + `,`, `Driver:` + strings.Replace(fmt.Sprintf("%v", this.Driver), "Driver", "Driver", 1) + `,`, @@ -4529,7 +4529,7 @@ func (this *ConfigSpec) String() string { return "nil" } s := strings.Join([]string{`&ConfigSpec{`, - `Annotations:` + strings.Replace(strings.Replace(this.Annotations.String(), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, + `Annotations:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Annotations), "Annotations", "Annotations", 1), `&`, ``, 1) + `,`, `Data:` + fmt.Sprintf("%v", this.Data) + `,`, `Templating:` + strings.Replace(fmt.Sprintf("%v", this.Templating), "Driver", "Driver", 1) + `,`, `}`, @@ -4669,10 +4669,7 @@ func (m *NodeSpec) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSpecs } if (iNdEx + skippy) > l { @@ -5070,10 +5067,7 @@ func (m *ServiceSpec) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSpecs } if (iNdEx + skippy) > l { @@ -5142,10 +5136,7 @@ func (m *ReplicatedService) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSpecs } if (iNdEx + skippy) > l { @@ -5195,10 +5186,7 @@ func (m *GlobalService) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSpecs } if (iNdEx + skippy) > l { @@ -5286,10 +5274,7 @@ func (m *ReplicatedJob) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSpecs } if (iNdEx + skippy) > l { @@ -5339,10 +5324,7 @@ func (m *GlobalJob) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSpecs } if (iNdEx + skippy) > l { @@ -5728,10 +5710,7 @@ func (m *TaskSpec) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSpecs } if (iNdEx + skippy) > l { @@ -5832,10 +5811,7 @@ func (m *ResourceReference) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSpecs } if (iNdEx + skippy) > l { @@ -5953,10 +5929,7 @@ func (m *GenericRuntimeSpec) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSpecs } if (iNdEx + skippy) > l { @@ -6038,10 +6011,7 @@ func (m *NetworkAttachmentSpec) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSpecs } if (iNdEx + skippy) > l { @@ -6233,7 +6203,7 @@ func (m *ContainerSpec) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSpecs } if (iNdEx + skippy) > postIndex { @@ -7064,7 +7034,7 @@ func (m *ContainerSpec) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSpecs } if (iNdEx + skippy) > postIndex { @@ -7179,10 +7149,7 @@ func (m *ContainerSpec) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSpecs } if (iNdEx + skippy) > l { @@ -7264,10 +7231,7 @@ func (m *ContainerSpec_PullOptions) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSpecs } if (iNdEx + skippy) > l { @@ -7413,10 +7377,7 @@ func (m *ContainerSpec_DNSConfig) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSpecs } if (iNdEx + skippy) > l { @@ -7536,10 +7497,7 @@ func (m *ContainerSpec_Ulimit) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSpecs } if (iNdEx + skippy) > l { @@ -7642,10 +7600,7 @@ func (m *EndpointSpec) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSpecs } if (iNdEx + skippy) > l { @@ -7912,10 +7867,7 @@ func (m *NetworkSpec) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSpecs } if (iNdEx + skippy) > l { @@ -8229,10 +8181,7 @@ func (m *ClusterSpec) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSpecs } if (iNdEx + skippy) > l { @@ -8421,10 +8370,7 @@ func (m *SecretSpec) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSpecs } if (iNdEx + skippy) > l { @@ -8577,10 +8523,7 @@ func (m *ConfigSpec) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSpecs - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSpecs } if (iNdEx + skippy) > l { @@ -8598,6 +8541,7 @@ func (m *ConfigSpec) Unmarshal(dAtA []byte) error { func skipSpecs(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -8629,10 +8573,8 @@ func skipSpecs(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -8653,55 +8595,30 @@ func skipSpecs(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthSpecs } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthSpecs - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSpecs - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipSpecs(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthSpecs - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupSpecs + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthSpecs + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthSpecs = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowSpecs = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthSpecs = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowSpecs = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupSpecs = fmt.Errorf("proto: unexpected end of group") ) diff --git a/vendor/github.com/docker/swarmkit/api/types.pb.go b/vendor/github.com/docker/swarmkit/api/types.pb.go index 69f052cefa..d941916ff6 100644 --- a/vendor/github.com/docker/swarmkit/api/types.pb.go +++ b/vendor/github.com/docker/swarmkit/api/types.pb.go @@ -14,6 +14,7 @@ import ( types "github.com/gogo/protobuf/types" io "io" math "math" + math_bits "math/bits" os "os" reflect "reflect" strings "strings" @@ -30,7 +31,7 @@ var _ = time.Kitchen // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type ResourceType int32 @@ -678,7 +679,7 @@ func (m *Version) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Version.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -715,7 +716,7 @@ func (m *IndexEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_IndexEntry.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -757,7 +758,7 @@ func (m *Annotations) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_Annotations.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -798,7 +799,7 @@ func (m *NamedGenericResource) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_NamedGenericResource.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -839,7 +840,7 @@ func (m *DiscreteGenericResource) XXX_Marshal(b []byte, deterministic bool) ([]b return xxx_messageInfo_DiscreteGenericResource.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -880,7 +881,7 @@ func (m *GenericResource) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return xxx_messageInfo_GenericResource.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -906,10 +907,10 @@ type isGenericResource_Resource interface { } type GenericResource_NamedResourceSpec struct { - NamedResourceSpec *NamedGenericResource `protobuf:"bytes,1,opt,name=named_resource_spec,json=namedResourceSpec,proto3,oneof"` + NamedResourceSpec *NamedGenericResource `protobuf:"bytes,1,opt,name=named_resource_spec,json=namedResourceSpec,proto3,oneof" json:"named_resource_spec,omitempty"` } type GenericResource_DiscreteResourceSpec struct { - DiscreteResourceSpec *DiscreteGenericResource `protobuf:"bytes,2,opt,name=discrete_resource_spec,json=discreteResourceSpec,proto3,oneof"` + DiscreteResourceSpec *DiscreteGenericResource `protobuf:"bytes,2,opt,name=discrete_resource_spec,json=discreteResourceSpec,proto3,oneof" json:"discrete_resource_spec,omitempty"` } func (*GenericResource_NamedResourceSpec) isGenericResource_Resource() {} @@ -936,80 +937,14 @@ func (m *GenericResource) GetDiscreteResourceSpec() *DiscreteGenericResource { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*GenericResource) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _GenericResource_OneofMarshaler, _GenericResource_OneofUnmarshaler, _GenericResource_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*GenericResource) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*GenericResource_NamedResourceSpec)(nil), (*GenericResource_DiscreteResourceSpec)(nil), } } -func _GenericResource_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*GenericResource) - // resource - switch x := m.Resource.(type) { - case *GenericResource_NamedResourceSpec: - _ = b.EncodeVarint(1<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.NamedResourceSpec); err != nil { - return err - } - case *GenericResource_DiscreteResourceSpec: - _ = b.EncodeVarint(2<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.DiscreteResourceSpec); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("GenericResource.Resource has unexpected type %T", x) - } - return nil -} - -func _GenericResource_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*GenericResource) - switch tag { - case 1: // resource.named_resource_spec - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(NamedGenericResource) - err := b.DecodeMessage(msg) - m.Resource = &GenericResource_NamedResourceSpec{msg} - return true, err - case 2: // resource.discrete_resource_spec - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(DiscreteGenericResource) - err := b.DecodeMessage(msg) - m.Resource = &GenericResource_DiscreteResourceSpec{msg} - return true, err - default: - return false, nil - } -} - -func _GenericResource_OneofSizer(msg proto.Message) (n int) { - m := msg.(*GenericResource) - // resource - switch x := m.Resource.(type) { - case *GenericResource_NamedResourceSpec: - s := proto.Size(x.NamedResourceSpec) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *GenericResource_DiscreteResourceSpec: - s := proto.Size(x.DiscreteResourceSpec) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - type Resources struct { // Amount of CPUs (e.g. 2000000000 = 2 CPU cores) NanoCPUs int64 `protobuf:"varint,1,opt,name=nano_cpus,json=nanoCpus,proto3" json:"nano_cpus,omitempty"` @@ -1032,7 +967,7 @@ func (m *Resources) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Resources.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1078,7 +1013,7 @@ func (m *ResourceRequirements) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_ResourceRequirements.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1117,7 +1052,7 @@ func (m *Platform) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Platform.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1159,7 +1094,7 @@ func (m *PluginDescription) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_PluginDescription.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1200,7 +1135,7 @@ func (m *EngineDescription) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_EngineDescription.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1248,7 +1183,7 @@ func (m *NodeDescription) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return xxx_messageInfo_NodeDescription.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1288,7 +1223,7 @@ func (m *NodeTLSInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_NodeTLSInfo.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1326,7 +1261,7 @@ func (m *RaftMemberStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_RaftMemberStatus.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1365,7 +1300,7 @@ func (m *NodeStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_NodeStatus.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1404,7 +1339,7 @@ func (m *Image) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Image.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1468,7 +1403,7 @@ func (m *Mount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Mount.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1508,7 +1443,7 @@ func (m *Mount_BindOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_Mount_BindOptions.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1553,7 +1488,7 @@ func (m *Mount_VolumeOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_Mount_VolumeOptions.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1601,7 +1536,7 @@ func (m *Mount_TmpfsOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_Mount_TmpfsOptions.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1647,7 +1582,7 @@ func (m *RestartPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return xxx_messageInfo_RestartPolicy.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1715,7 +1650,7 @@ func (m *UpdateConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_UpdateConfig.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1767,7 +1702,7 @@ func (m *UpdateStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_UpdateStatus.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1806,7 +1741,7 @@ func (m *ContainerStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return xxx_messageInfo_ContainerStatus.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1844,7 +1779,7 @@ func (m *PortStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_PortStatus.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1921,7 +1856,7 @@ func (m *TaskStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_TaskStatus.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1947,7 +1882,7 @@ type isTaskStatus_RuntimeStatus interface { } type TaskStatus_Container struct { - Container *ContainerStatus `protobuf:"bytes,5,opt,name=container,proto3,oneof"` + Container *ContainerStatus `protobuf:"bytes,5,opt,name=container,proto3,oneof" json:"container,omitempty"` } func (*TaskStatus_Container) isTaskStatus_RuntimeStatus() {} @@ -1966,61 +1901,13 @@ func (m *TaskStatus) GetContainer() *ContainerStatus { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*TaskStatus) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _TaskStatus_OneofMarshaler, _TaskStatus_OneofUnmarshaler, _TaskStatus_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*TaskStatus) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*TaskStatus_Container)(nil), } } -func _TaskStatus_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*TaskStatus) - // runtime_status - switch x := m.RuntimeStatus.(type) { - case *TaskStatus_Container: - _ = b.EncodeVarint(5<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Container); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("TaskStatus.RuntimeStatus has unexpected type %T", x) - } - return nil -} - -func _TaskStatus_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*TaskStatus) - switch tag { - case 5: // runtime_status.container - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(ContainerStatus) - err := b.DecodeMessage(msg) - m.RuntimeStatus = &TaskStatus_Container{msg} - return true, err - default: - return false, nil - } -} - -func _TaskStatus_OneofSizer(msg proto.Message) (n int) { - m := msg.(*TaskStatus) - // runtime_status - switch x := m.RuntimeStatus.(type) { - case *TaskStatus_Container: - s := proto.Size(x.Container) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - // NetworkAttachmentConfig specifies how a service should be attached to a particular network. // // For now, this is a simple struct, but this can include future information @@ -2053,7 +1940,7 @@ func (m *NetworkAttachmentConfig) XXX_Marshal(b []byte, deterministic bool) ([]b return xxx_messageInfo_NetworkAttachmentConfig.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2102,7 +1989,7 @@ func (m *IPAMConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_IPAMConfig.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2156,7 +2043,7 @@ func (m *PortConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_PortConfig.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2197,7 +2084,7 @@ func (m *Driver) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Driver.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2234,7 +2121,7 @@ func (m *IPAMOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_IPAMOptions.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2272,7 +2159,7 @@ func (m *Peer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Peer.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2311,7 +2198,7 @@ func (m *WeightedPeer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_WeightedPeer.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2351,7 +2238,7 @@ func (m *IssuanceStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return xxx_messageInfo_IssuanceStatus.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2387,7 +2274,7 @@ func (m *AcceptancePolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_AcceptancePolicy.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2429,7 +2316,7 @@ func (m *AcceptancePolicy_RoleAdmissionPolicy) XXX_Marshal(b []byte, determinist return xxx_messageInfo_AcceptancePolicy_RoleAdmissionPolicy.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2470,7 +2357,7 @@ func (m *AcceptancePolicy_RoleAdmissionPolicy_Secret) XXX_Marshal(b []byte, dete return xxx_messageInfo_AcceptancePolicy_RoleAdmissionPolicy_Secret.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2514,7 +2401,7 @@ func (m *ExternalCA) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_ExternalCA.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2567,7 +2454,7 @@ func (m *CAConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_CAConfig.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2606,7 +2493,7 @@ func (m *OrchestrationConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_OrchestrationConfig.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2648,7 +2535,7 @@ func (m *TaskDefaults) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_TaskDefaults.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2688,7 +2575,7 @@ func (m *DispatcherConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_DispatcherConfig.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2738,7 +2625,7 @@ func (m *RaftConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_RaftConfig.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2777,7 +2664,7 @@ func (m *EncryptionConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_EncryptionConfig.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2813,7 +2700,7 @@ func (m *SpreadOver) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_SpreadOver.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2851,7 +2738,7 @@ func (m *PlacementPreference) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_PlacementPreference.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2877,7 +2764,7 @@ type isPlacementPreference_Preference interface { } type PlacementPreference_Spread struct { - Spread *SpreadOver `protobuf:"bytes,1,opt,name=spread,proto3,oneof"` + Spread *SpreadOver `protobuf:"bytes,1,opt,name=spread,proto3,oneof" json:"spread,omitempty"` } func (*PlacementPreference_Spread) isPlacementPreference_Preference() {} @@ -2896,61 +2783,13 @@ func (m *PlacementPreference) GetSpread() *SpreadOver { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*PlacementPreference) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _PlacementPreference_OneofMarshaler, _PlacementPreference_OneofUnmarshaler, _PlacementPreference_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*PlacementPreference) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*PlacementPreference_Spread)(nil), } } -func _PlacementPreference_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*PlacementPreference) - // Preference - switch x := m.Preference.(type) { - case *PlacementPreference_Spread: - _ = b.EncodeVarint(1<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Spread); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("PlacementPreference.Preference has unexpected type %T", x) - } - return nil -} - -func _PlacementPreference_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*PlacementPreference) - switch tag { - case 1: // Preference.spread - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(SpreadOver) - err := b.DecodeMessage(msg) - m.Preference = &PlacementPreference_Spread{msg} - return true, err - default: - return false, nil - } -} - -func _PlacementPreference_OneofSizer(msg proto.Message) (n int) { - m := msg.(*PlacementPreference) - // Preference - switch x := m.Preference.(type) { - case *PlacementPreference_Spread: - s := proto.Size(x.Spread) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - // Placement specifies task distribution constraints. type Placement struct { // Constraints specifies a set of requirements a node should meet for a task. @@ -2980,7 +2819,7 @@ func (m *Placement) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Placement.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -3020,7 +2859,7 @@ func (m *JoinTokens) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_JoinTokens.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -3069,7 +2908,7 @@ func (m *RootCA) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_RootCA.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -3110,7 +2949,7 @@ func (m *Certificate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_Certificate.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -3154,7 +2993,7 @@ func (m *EncryptionKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return xxx_messageInfo_EncryptionKey.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -3199,7 +3038,7 @@ func (m *ManagerStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return xxx_messageInfo_ManagerStatus.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -3243,7 +3082,7 @@ func (m *FileTarget) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_FileTarget.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -3282,7 +3121,7 @@ func (m *RuntimeTarget) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return xxx_messageInfo_RuntimeTarget.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -3330,7 +3169,7 @@ func (m *SecretReference) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return xxx_messageInfo_SecretReference.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -3356,7 +3195,7 @@ type isSecretReference_Target interface { } type SecretReference_File struct { - File *FileTarget `protobuf:"bytes,3,opt,name=file,proto3,oneof"` + File *FileTarget `protobuf:"bytes,3,opt,name=file,proto3,oneof" json:"file,omitempty"` } func (*SecretReference_File) isSecretReference_Target() {} @@ -3375,61 +3214,13 @@ func (m *SecretReference) GetFile() *FileTarget { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*SecretReference) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _SecretReference_OneofMarshaler, _SecretReference_OneofUnmarshaler, _SecretReference_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*SecretReference) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*SecretReference_File)(nil), } } -func _SecretReference_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*SecretReference) - // target - switch x := m.Target.(type) { - case *SecretReference_File: - _ = b.EncodeVarint(3<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.File); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("SecretReference.Target has unexpected type %T", x) - } - return nil -} - -func _SecretReference_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*SecretReference) - switch tag { - case 3: // target.file - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(FileTarget) - err := b.DecodeMessage(msg) - m.Target = &SecretReference_File{msg} - return true, err - default: - return false, nil - } -} - -func _SecretReference_OneofSizer(msg proto.Message) (n int) { - m := msg.(*SecretReference) - // target - switch x := m.Target.(type) { - case *SecretReference_File: - s := proto.Size(x.File) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - // ConfigReference is the linkage between a service and a config that it uses. type ConfigReference struct { // ConfigID represents the ID of the specific Config that we're @@ -3459,7 +3250,7 @@ func (m *ConfigReference) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return xxx_messageInfo_ConfigReference.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -3485,10 +3276,10 @@ type isConfigReference_Target interface { } type ConfigReference_File struct { - File *FileTarget `protobuf:"bytes,3,opt,name=file,proto3,oneof"` + File *FileTarget `protobuf:"bytes,3,opt,name=file,proto3,oneof" json:"file,omitempty"` } type ConfigReference_Runtime struct { - Runtime *RuntimeTarget `protobuf:"bytes,4,opt,name=runtime,proto3,oneof"` + Runtime *RuntimeTarget `protobuf:"bytes,4,opt,name=runtime,proto3,oneof" json:"runtime,omitempty"` } func (*ConfigReference_File) isConfigReference_Target() {} @@ -3515,80 +3306,14 @@ func (m *ConfigReference) GetRuntime() *RuntimeTarget { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*ConfigReference) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _ConfigReference_OneofMarshaler, _ConfigReference_OneofUnmarshaler, _ConfigReference_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*ConfigReference) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*ConfigReference_File)(nil), (*ConfigReference_Runtime)(nil), } } -func _ConfigReference_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*ConfigReference) - // target - switch x := m.Target.(type) { - case *ConfigReference_File: - _ = b.EncodeVarint(3<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.File); err != nil { - return err - } - case *ConfigReference_Runtime: - _ = b.EncodeVarint(4<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Runtime); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("ConfigReference.Target has unexpected type %T", x) - } - return nil -} - -func _ConfigReference_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*ConfigReference) - switch tag { - case 3: // target.file - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(FileTarget) - err := b.DecodeMessage(msg) - m.Target = &ConfigReference_File{msg} - return true, err - case 4: // target.runtime - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(RuntimeTarget) - err := b.DecodeMessage(msg) - m.Target = &ConfigReference_Runtime{msg} - return true, err - default: - return false, nil - } -} - -func _ConfigReference_OneofSizer(msg proto.Message) (n int) { - m := msg.(*ConfigReference) - // target - switch x := m.Target.(type) { - case *ConfigReference_File: - s := proto.Size(x.File) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *ConfigReference_Runtime: - s := proto.Size(x.Runtime) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - // BlacklistedCertificate is a record for a blacklisted certificate. It does not // contain the certificate's CN, because these records are indexed by CN. type BlacklistedCertificate struct { @@ -3611,7 +3336,7 @@ func (m *BlacklistedCertificate) XXX_Marshal(b []byte, deterministic bool) ([]by return xxx_messageInfo_BlacklistedCertificate.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -3669,7 +3394,7 @@ func (m *HealthConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_HealthConfig.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -3707,7 +3432,7 @@ func (m *MaybeEncryptedRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_MaybeEncryptedRecord.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -3746,7 +3471,7 @@ func (m *RootRotation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_RootRotation.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -3784,7 +3509,7 @@ func (m *Privileges) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Privileges.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -3825,7 +3550,7 @@ func (m *Privileges_CredentialSpec) XXX_Marshal(b []byte, deterministic bool) ([ return xxx_messageInfo_Privileges_CredentialSpec.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -3851,13 +3576,13 @@ type isPrivileges_CredentialSpec_Source interface { } type Privileges_CredentialSpec_File struct { - File string `protobuf:"bytes,1,opt,name=file,proto3,oneof"` + File string `protobuf:"bytes,1,opt,name=file,proto3,oneof" json:"file,omitempty"` } type Privileges_CredentialSpec_Registry struct { - Registry string `protobuf:"bytes,2,opt,name=registry,proto3,oneof"` + Registry string `protobuf:"bytes,2,opt,name=registry,proto3,oneof" json:"registry,omitempty"` } type Privileges_CredentialSpec_Config struct { - Config string `protobuf:"bytes,3,opt,name=config,proto3,oneof"` + Config string `protobuf:"bytes,3,opt,name=config,proto3,oneof" json:"config,omitempty"` } func (*Privileges_CredentialSpec_File) isPrivileges_CredentialSpec_Source() {} @@ -3892,87 +3617,15 @@ func (m *Privileges_CredentialSpec) GetConfig() string { return "" } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*Privileges_CredentialSpec) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _Privileges_CredentialSpec_OneofMarshaler, _Privileges_CredentialSpec_OneofUnmarshaler, _Privileges_CredentialSpec_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*Privileges_CredentialSpec) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*Privileges_CredentialSpec_File)(nil), (*Privileges_CredentialSpec_Registry)(nil), (*Privileges_CredentialSpec_Config)(nil), } } -func _Privileges_CredentialSpec_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*Privileges_CredentialSpec) - // source - switch x := m.Source.(type) { - case *Privileges_CredentialSpec_File: - _ = b.EncodeVarint(1<<3 | proto.WireBytes) - _ = b.EncodeStringBytes(x.File) - case *Privileges_CredentialSpec_Registry: - _ = b.EncodeVarint(2<<3 | proto.WireBytes) - _ = b.EncodeStringBytes(x.Registry) - case *Privileges_CredentialSpec_Config: - _ = b.EncodeVarint(3<<3 | proto.WireBytes) - _ = b.EncodeStringBytes(x.Config) - case nil: - default: - return fmt.Errorf("Privileges_CredentialSpec.Source has unexpected type %T", x) - } - return nil -} - -func _Privileges_CredentialSpec_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*Privileges_CredentialSpec) - switch tag { - case 1: // source.file - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeStringBytes() - m.Source = &Privileges_CredentialSpec_File{x} - return true, err - case 2: // source.registry - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeStringBytes() - m.Source = &Privileges_CredentialSpec_Registry{x} - return true, err - case 3: // source.config - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeStringBytes() - m.Source = &Privileges_CredentialSpec_Config{x} - return true, err - default: - return false, nil - } -} - -func _Privileges_CredentialSpec_OneofSizer(msg proto.Message) (n int) { - m := msg.(*Privileges_CredentialSpec) - // source - switch x := m.Source.(type) { - case *Privileges_CredentialSpec_File: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(len(x.File))) - n += len(x.File) - case *Privileges_CredentialSpec_Registry: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(len(x.Registry))) - n += len(x.Registry) - case *Privileges_CredentialSpec_Config: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(len(x.Config))) - n += len(x.Config) - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - // SELinuxContext contains the SELinux labels for the container. type Privileges_SELinuxContext struct { Disable bool `protobuf:"varint,1,opt,name=disable,proto3" json:"disable,omitempty"` @@ -3995,7 +3648,7 @@ func (m *Privileges_SELinuxContext) XXX_Marshal(b []byte, deterministic bool) ([ return xxx_messageInfo_Privileges_SELinuxContext.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -4042,7 +3695,7 @@ func (m *JobStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_JobStatus.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -5889,7 +5542,7 @@ func (m *JobStatus) CopyFrom(src interface{}) { func (m *Version) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -5897,22 +5550,27 @@ func (m *Version) Marshal() (dAtA []byte, err error) { } func (m *Version) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Version) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Index != 0 { - dAtA[i] = 0x8 - i++ i = encodeVarintTypes(dAtA, i, uint64(m.Index)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *IndexEntry) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -5920,29 +5578,36 @@ func (m *IndexEntry) Marshal() (dAtA []byte, err error) { } func (m *IndexEntry) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IndexEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Key) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Key))) - i += copy(dAtA[i:], m.Key) - } if len(m.Val) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Val) + copy(dAtA[i:], m.Val) i = encodeVarintTypes(dAtA, i, uint64(len(m.Val))) - i += copy(dAtA[i:], m.Val) + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *Annotations) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -5950,52 +5615,62 @@ func (m *Annotations) Marshal() (dAtA []byte, err error) { } func (m *Annotations) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Annotations) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + if len(m.Indices) > 0 { + for iNdEx := len(m.Indices) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Indices[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } } if len(m.Labels) > 0 { - for k, _ := range m.Labels { - dAtA[i] = 0x12 - i++ + for k := range m.Labels { v := m.Labels[k] - mapSize := 1 + len(k) + sovTypes(uint64(len(k))) + 1 + len(v) + sovTypes(uint64(len(v))) - i = encodeVarintTypes(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ + baseI := i + i -= len(v) + copy(dAtA[i:], v) i = encodeVarintTypes(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintTypes(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintTypes(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 } } - if len(m.Indices) > 0 { - for _, msg := range m.Indices { - dAtA[i] = 0x22 - i++ - i = encodeVarintTypes(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *NamedGenericResource) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6003,29 +5678,36 @@ func (m *NamedGenericResource) Marshal() (dAtA []byte, err error) { } func (m *NamedGenericResource) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NamedGenericResource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Kind) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Kind))) - i += copy(dAtA[i:], m.Kind) - } if len(m.Value) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Value) + copy(dAtA[i:], m.Value) i = encodeVarintTypes(dAtA, i, uint64(len(m.Value))) - i += copy(dAtA[i:], m.Value) + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.Kind) > 0 { + i -= len(m.Kind) + copy(dAtA[i:], m.Kind) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Kind))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *DiscreteGenericResource) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6033,28 +5715,34 @@ func (m *DiscreteGenericResource) Marshal() (dAtA []byte, err error) { } func (m *DiscreteGenericResource) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DiscreteGenericResource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Kind) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Kind))) - i += copy(dAtA[i:], m.Kind) - } if m.Value != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintTypes(dAtA, i, uint64(m.Value)) + i-- + dAtA[i] = 0x10 } - return i, nil + if len(m.Kind) > 0 { + i -= len(m.Kind) + copy(dAtA[i:], m.Kind) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Kind))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *GenericResource) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6062,52 +5750,73 @@ func (m *GenericResource) Marshal() (dAtA []byte, err error) { } func (m *GenericResource) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenericResource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Resource != nil { - nn1, err := m.Resource.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.Resource.Size() + i -= size + if _, err := m.Resource.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn1 } - return i, nil + return len(dAtA) - i, nil } func (m *GenericResource_NamedResourceSpec) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenericResource_NamedResourceSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.NamedResourceSpec != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.NamedResourceSpec.Size())) - n2, err := m.NamedResourceSpec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.NamedResourceSpec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - i += n2 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GenericResource_DiscreteResourceSpec) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenericResource_DiscreteResourceSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.DiscreteResourceSpec != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.DiscreteResourceSpec.Size())) - n3, err := m.DiscreteResourceSpec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.DiscreteResourceSpec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - i += n3 + i-- + dAtA[i] = 0x12 } - return i, nil + return len(dAtA) - i, nil } func (m *Resources) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6115,39 +5824,46 @@ func (m *Resources) Marshal() (dAtA []byte, err error) { } func (m *Resources) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Resources) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.NanoCPUs != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.NanoCPUs)) - } - if m.MemoryBytes != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.MemoryBytes)) - } if len(m.Generic) > 0 { - for _, msg := range m.Generic { - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Generic) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Generic[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x1a } } - return i, nil + if m.MemoryBytes != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.MemoryBytes)) + i-- + dAtA[i] = 0x10 + } + if m.NanoCPUs != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.NanoCPUs)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *ResourceRequirements) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6155,57 +5871,70 @@ func (m *ResourceRequirements) Marshal() (dAtA []byte, err error) { } func (m *ResourceRequirements) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ResourceRequirements) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Limits != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Limits.Size())) - n4, err := m.Limits.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.MemorySwappiness != nil { + { + size, err := m.MemorySwappiness.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - i += n4 - } - if m.Reservations != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Reservations.Size())) - n5, err := m.Reservations.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n5 + i-- + dAtA[i] = 0x22 } if m.SwapBytes != nil { + { + size, err := m.SwapBytes.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.SwapBytes.Size())) - n6, err := m.SwapBytes.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n6 } - if m.MemorySwappiness != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.MemorySwappiness.Size())) - n7, err := m.MemorySwappiness.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.Reservations != nil { + { + size, err := m.Reservations.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - i += n7 + i-- + dAtA[i] = 0x12 } - return i, nil + if m.Limits != nil { + { + size, err := m.Limits.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *Platform) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6213,29 +5942,36 @@ func (m *Platform) Marshal() (dAtA []byte, err error) { } func (m *Platform) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Platform) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Architecture) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Architecture))) - i += copy(dAtA[i:], m.Architecture) - } if len(m.OS) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.OS) + copy(dAtA[i:], m.OS) i = encodeVarintTypes(dAtA, i, uint64(len(m.OS))) - i += copy(dAtA[i:], m.OS) + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.Architecture) > 0 { + i -= len(m.Architecture) + copy(dAtA[i:], m.Architecture) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Architecture))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *PluginDescription) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6243,29 +5979,36 @@ func (m *PluginDescription) Marshal() (dAtA []byte, err error) { } func (m *PluginDescription) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PluginDescription) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Type) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Type))) - i += copy(dAtA[i:], m.Type) - } if len(m.Name) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Name) + copy(dAtA[i:], m.Name) i = encodeVarintTypes(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.Type) > 0 { + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *EngineDescription) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6273,52 +6016,62 @@ func (m *EngineDescription) Marshal() (dAtA []byte, err error) { } func (m *EngineDescription) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EngineDescription) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.EngineVersion) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.EngineVersion))) - i += copy(dAtA[i:], m.EngineVersion) + if len(m.Plugins) > 0 { + for iNdEx := len(m.Plugins) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Plugins[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } } if len(m.Labels) > 0 { - for k, _ := range m.Labels { - dAtA[i] = 0x12 - i++ + for k := range m.Labels { v := m.Labels[k] - mapSize := 1 + len(k) + sovTypes(uint64(len(k))) + 1 + len(v) + sovTypes(uint64(len(v))) - i = encodeVarintTypes(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ + baseI := i + i -= len(v) + copy(dAtA[i:], v) i = encodeVarintTypes(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintTypes(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintTypes(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 } } - if len(m.Plugins) > 0 { - for _, msg := range m.Plugins { - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } + if len(m.EngineVersion) > 0 { + i -= len(m.EngineVersion) + copy(dAtA[i:], m.EngineVersion) + i = encodeVarintTypes(dAtA, i, uint64(len(m.EngineVersion))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *NodeDescription) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6326,73 +6079,87 @@ func (m *NodeDescription) Marshal() (dAtA []byte, err error) { } func (m *NodeDescription) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NodeDescription) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Hostname) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Hostname))) - i += copy(dAtA[i:], m.Hostname) - } - if m.Platform != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Platform.Size())) - n8, err := m.Platform.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n8 - } - if m.Resources != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Resources.Size())) - n9, err := m.Resources.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n9 - } - if m.Engine != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Engine.Size())) - n10, err := m.Engine.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n10 - } - if m.TLSInfo != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.TLSInfo.Size())) - n11, err := m.TLSInfo.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n11 - } if m.FIPS { - dAtA[i] = 0x30 - i++ + i-- if m.FIPS { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x30 } - return i, nil + if m.TLSInfo != nil { + { + size, err := m.TLSInfo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.Engine != nil { + { + size, err := m.Engine.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Resources != nil { + { + size, err := m.Resources.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Platform != nil { + { + size, err := m.Platform.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Hostname) > 0 { + i -= len(m.Hostname) + copy(dAtA[i:], m.Hostname) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Hostname))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *NodeTLSInfo) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6400,35 +6167,43 @@ func (m *NodeTLSInfo) Marshal() (dAtA []byte, err error) { } func (m *NodeTLSInfo) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NodeTLSInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.TrustRoot) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.TrustRoot))) - i += copy(dAtA[i:], m.TrustRoot) + if len(m.CertIssuerPublicKey) > 0 { + i -= len(m.CertIssuerPublicKey) + copy(dAtA[i:], m.CertIssuerPublicKey) + i = encodeVarintTypes(dAtA, i, uint64(len(m.CertIssuerPublicKey))) + i-- + dAtA[i] = 0x1a } if len(m.CertIssuerSubject) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.CertIssuerSubject) + copy(dAtA[i:], m.CertIssuerSubject) i = encodeVarintTypes(dAtA, i, uint64(len(m.CertIssuerSubject))) - i += copy(dAtA[i:], m.CertIssuerSubject) + i-- + dAtA[i] = 0x12 } - if len(m.CertIssuerPublicKey) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.CertIssuerPublicKey))) - i += copy(dAtA[i:], m.CertIssuerPublicKey) + if len(m.TrustRoot) > 0 { + i -= len(m.TrustRoot) + copy(dAtA[i:], m.TrustRoot) + i = encodeVarintTypes(dAtA, i, uint64(len(m.TrustRoot))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RaftMemberStatus) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6436,38 +6211,44 @@ func (m *RaftMemberStatus) Marshal() (dAtA []byte, err error) { } func (m *RaftMemberStatus) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RaftMemberStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if len(m.Message) > 0 { + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0x1a + } + if m.Reachability != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Reachability)) + i-- + dAtA[i] = 0x10 + } if m.Leader { - dAtA[i] = 0x8 - i++ + i-- if m.Leader { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x8 } - if m.Reachability != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Reachability)) - } - if len(m.Message) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Message))) - i += copy(dAtA[i:], m.Message) - } - return i, nil + return len(dAtA) - i, nil } func (m *NodeStatus) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6475,34 +6256,41 @@ func (m *NodeStatus) Marshal() (dAtA []byte, err error) { } func (m *NodeStatus) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NodeStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.State != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.State)) + if len(m.Addr) > 0 { + i -= len(m.Addr) + copy(dAtA[i:], m.Addr) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Addr))) + i-- + dAtA[i] = 0x1a } if len(m.Message) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Message) + copy(dAtA[i:], m.Message) i = encodeVarintTypes(dAtA, i, uint64(len(m.Message))) - i += copy(dAtA[i:], m.Message) + i-- + dAtA[i] = 0x12 } - if len(m.Addr) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Addr))) - i += copy(dAtA[i:], m.Addr) + if m.State != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.State)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *Image) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6510,23 +6298,29 @@ func (m *Image) Marshal() (dAtA []byte, err error) { } func (m *Image) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Image) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Reference) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.Reference) + copy(dAtA[i:], m.Reference) i = encodeVarintTypes(dAtA, i, uint64(len(m.Reference))) - i += copy(dAtA[i:], m.Reference) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Mount) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6534,79 +6328,92 @@ func (m *Mount) Marshal() (dAtA []byte, err error) { } func (m *Mount) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Mount) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Type != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Type)) + if m.Consistency != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Consistency)) + i-- + dAtA[i] = 0x40 } - if len(m.Source) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Source))) - i += copy(dAtA[i:], m.Source) + if m.TmpfsOptions != nil { + { + size, err := m.TmpfsOptions.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a } - if len(m.Target) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Target))) - i += copy(dAtA[i:], m.Target) + if m.VolumeOptions != nil { + { + size, err := m.VolumeOptions.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.BindOptions != nil { + { + size, err := m.BindOptions.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a } if m.ReadOnly { - dAtA[i] = 0x20 - i++ + i-- if m.ReadOnly { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x20 } - if m.BindOptions != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.BindOptions.Size())) - n12, err := m.BindOptions.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n12 + if len(m.Target) > 0 { + i -= len(m.Target) + copy(dAtA[i:], m.Target) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Target))) + i-- + dAtA[i] = 0x1a } - if m.VolumeOptions != nil { - dAtA[i] = 0x32 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.VolumeOptions.Size())) - n13, err := m.VolumeOptions.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n13 + if len(m.Source) > 0 { + i -= len(m.Source) + copy(dAtA[i:], m.Source) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Source))) + i-- + dAtA[i] = 0x12 } - if m.TmpfsOptions != nil { - dAtA[i] = 0x3a - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.TmpfsOptions.Size())) - n14, err := m.TmpfsOptions.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n14 + if m.Type != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x8 } - if m.Consistency != 0 { - dAtA[i] = 0x40 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Consistency)) - } - return i, nil + return len(dAtA) - i, nil } func (m *Mount_BindOptions) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6614,32 +6421,37 @@ func (m *Mount_BindOptions) Marshal() (dAtA []byte, err error) { } func (m *Mount_BindOptions) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Mount_BindOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Propagation != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Propagation)) - } if m.NonRecursive { - dAtA[i] = 0x10 - i++ + i-- if m.NonRecursive { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x10 } - return i, nil + if m.Propagation != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Propagation)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *Mount_VolumeOptions) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6647,54 +6459,63 @@ func (m *Mount_VolumeOptions) Marshal() (dAtA []byte, err error) { } func (m *Mount_VolumeOptions) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Mount_VolumeOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.DriverConfig != nil { + { + size, err := m.DriverConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Labels) > 0 { + for k := range m.Labels { + v := m.Labels[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintTypes(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintTypes(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintTypes(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } if m.NoCopy { - dAtA[i] = 0x8 - i++ + i-- if m.NoCopy { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x8 } - if len(m.Labels) > 0 { - for k, _ := range m.Labels { - dAtA[i] = 0x12 - i++ - v := m.Labels[k] - mapSize := 1 + len(k) + sovTypes(uint64(len(k))) + 1 + len(v) + sovTypes(uint64(len(v))) - i = encodeVarintTypes(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) - } - } - if m.DriverConfig != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.DriverConfig.Size())) - n15, err := m.DriverConfig.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n15 - } - return i, nil + return len(dAtA) - i, nil } func (m *Mount_TmpfsOptions) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6702,33 +6523,39 @@ func (m *Mount_TmpfsOptions) Marshal() (dAtA []byte, err error) { } func (m *Mount_TmpfsOptions) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Mount_TmpfsOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.SizeBytes != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.SizeBytes)) + if len(m.Options) > 0 { + i -= len(m.Options) + copy(dAtA[i:], m.Options) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Options))) + i-- + dAtA[i] = 0x1a } if m.Mode != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintTypes(dAtA, i, uint64(m.Mode)) + i-- + dAtA[i] = 0x10 } - if len(m.Options) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Options))) - i += copy(dAtA[i:], m.Options) + if m.SizeBytes != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.SizeBytes)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *RestartPolicy) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6736,47 +6563,56 @@ func (m *RestartPolicy) Marshal() (dAtA []byte, err error) { } func (m *RestartPolicy) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RestartPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Condition != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Condition)) - } - if m.Delay != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Delay.Size())) - n16, err := m.Delay.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.Window != nil { + { + size, err := m.Window.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - i += n16 + i-- + dAtA[i] = 0x22 } if m.MaxAttempts != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintTypes(dAtA, i, uint64(m.MaxAttempts)) + i-- + dAtA[i] = 0x18 } - if m.Window != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Window.Size())) - n17, err := m.Window.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.Delay != nil { + { + size, err := m.Delay.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - i += n17 + i-- + dAtA[i] = 0x12 } - return i, nil + if m.Condition != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Condition)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *UpdateConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6784,56 +6620,63 @@ func (m *UpdateConfig) Marshal() (dAtA []byte, err error) { } func (m *UpdateConfig) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Parallelism != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Parallelism)) - } - dAtA[i] = 0x12 - i++ - i = encodeVarintTypes(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(m.Delay))) - n18, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Delay, dAtA[i:]) - if err != nil { - return 0, err - } - i += n18 - if m.FailureAction != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.FailureAction)) - } - if m.Monitor != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Monitor.Size())) - n19, err := m.Monitor.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n19 + if m.Order != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Order)) + i-- + dAtA[i] = 0x30 } if m.MaxFailureRatio != 0 { - dAtA[i] = 0x2d - i++ + i -= 4 encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.MaxFailureRatio)))) - i += 4 + i-- + dAtA[i] = 0x2d } - if m.Order != 0 { - dAtA[i] = 0x30 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Order)) + if m.Monitor != nil { + { + size, err := m.Monitor.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 } - return i, nil + if m.FailureAction != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.FailureAction)) + i-- + dAtA[i] = 0x18 + } + n18, err18 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Delay, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.Delay):]) + if err18 != nil { + return 0, err18 + } + i -= n18 + i = encodeVarintTypes(dAtA, i, uint64(n18)) + i-- + dAtA[i] = 0x12 + if m.Parallelism != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Parallelism)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *UpdateStatus) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6841,48 +6684,58 @@ func (m *UpdateStatus) Marshal() (dAtA []byte, err error) { } func (m *UpdateStatus) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.State != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.State)) - } - if m.StartedAt != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.StartedAt.Size())) - n20, err := m.StartedAt.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n20 + if len(m.Message) > 0 { + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0x22 } if m.CompletedAt != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.CompletedAt.Size())) - n21, err := m.CompletedAt.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.CompletedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - i += n21 + i-- + dAtA[i] = 0x1a } - if len(m.Message) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Message))) - i += copy(dAtA[i:], m.Message) + if m.StartedAt != nil { + { + size, err := m.StartedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 } - return i, nil + if m.State != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.State)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *ContainerStatus) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6890,33 +6743,39 @@ func (m *ContainerStatus) Marshal() (dAtA []byte, err error) { } func (m *ContainerStatus) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ContainerStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ContainerID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.ContainerID))) - i += copy(dAtA[i:], m.ContainerID) + if m.ExitCode != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.ExitCode)) + i-- + dAtA[i] = 0x18 } if m.PID != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintTypes(dAtA, i, uint64(m.PID)) + i-- + dAtA[i] = 0x10 } - if m.ExitCode != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.ExitCode)) + if len(m.ContainerID) > 0 { + i -= len(m.ContainerID) + copy(dAtA[i:], m.ContainerID) + i = encodeVarintTypes(dAtA, i, uint64(len(m.ContainerID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *PortStatus) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6924,29 +6783,36 @@ func (m *PortStatus) Marshal() (dAtA []byte, err error) { } func (m *PortStatus) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PortStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Ports) > 0 { - for _, msg := range m.Ports { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Ports) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Ports[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - return i, nil + return len(dAtA) - i, nil } func (m *TaskStatus) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -6954,91 +6820,114 @@ func (m *TaskStatus) Marshal() (dAtA []byte, err error) { } func (m *TaskStatus) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TaskStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Timestamp != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Timestamp.Size())) - n22, err := m.Timestamp.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.AppliedAt != nil { + { + size, err := m.AppliedAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - i += n22 - } - if m.State != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.State)) - } - if len(m.Message) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Message))) - i += copy(dAtA[i:], m.Message) - } - if len(m.Err) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Err))) - i += copy(dAtA[i:], m.Err) - } - if m.RuntimeStatus != nil { - nn23, err := m.RuntimeStatus.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += nn23 - } - if m.PortStatus != nil { - dAtA[i] = 0x32 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.PortStatus.Size())) - n24, err := m.PortStatus.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n24 + i-- + dAtA[i] = 0x42 } if len(m.AppliedBy) > 0 { - dAtA[i] = 0x3a - i++ + i -= len(m.AppliedBy) + copy(dAtA[i:], m.AppliedBy) i = encodeVarintTypes(dAtA, i, uint64(len(m.AppliedBy))) - i += copy(dAtA[i:], m.AppliedBy) + i-- + dAtA[i] = 0x3a } - if m.AppliedAt != nil { - dAtA[i] = 0x42 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.AppliedAt.Size())) - n25, err := m.AppliedAt.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.PortStatus != nil { + { + size, err := m.PortStatus.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - i += n25 + i-- + dAtA[i] = 0x32 } - return i, nil + if m.RuntimeStatus != nil { + { + size := m.RuntimeStatus.Size() + i -= size + if _, err := m.RuntimeStatus.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if len(m.Err) > 0 { + i -= len(m.Err) + copy(dAtA[i:], m.Err) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Err))) + i-- + dAtA[i] = 0x22 + } + if len(m.Message) > 0 { + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0x1a + } + if m.State != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.State)) + i-- + dAtA[i] = 0x10 + } + if m.Timestamp != nil { + { + size, err := m.Timestamp.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *TaskStatus_Container) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TaskStatus_Container) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Container != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Container.Size())) - n26, err := m.Container.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Container.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - i += n26 + i-- + dAtA[i] = 0x2a } - return i, nil + return len(dAtA) - i, nil } func (m *NetworkAttachmentConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7046,70 +6935,66 @@ func (m *NetworkAttachmentConfig) Marshal() (dAtA []byte, err error) { } func (m *NetworkAttachmentConfig) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NetworkAttachmentConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Target) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Target))) - i += copy(dAtA[i:], m.Target) - } - if len(m.Aliases) > 0 { - for _, s := range m.Aliases { + if len(m.DriverAttachmentOpts) > 0 { + for k := range m.DriverAttachmentOpts { + v := m.DriverAttachmentOpts[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintTypes(dAtA, i, uint64(len(v))) + i-- dAtA[i] = 0x12 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintTypes(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintTypes(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x22 } } if len(m.Addresses) > 0 { - for _, s := range m.Addresses { + for iNdEx := len(m.Addresses) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Addresses[iNdEx]) + copy(dAtA[i:], m.Addresses[iNdEx]) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Addresses[iNdEx]))) + i-- dAtA[i] = 0x1a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) } } - if len(m.DriverAttachmentOpts) > 0 { - for k, _ := range m.DriverAttachmentOpts { - dAtA[i] = 0x22 - i++ - v := m.DriverAttachmentOpts[k] - mapSize := 1 + len(k) + sovTypes(uint64(len(k))) + 1 + len(v) + sovTypes(uint64(len(v))) - i = encodeVarintTypes(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) + if len(m.Aliases) > 0 { + for iNdEx := len(m.Aliases) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Aliases[iNdEx]) + copy(dAtA[i:], m.Aliases[iNdEx]) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Aliases[iNdEx]))) + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) } } - return i, nil + if len(m.Target) > 0 { + i -= len(m.Target) + copy(dAtA[i:], m.Target) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Target))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *IPAMConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7117,57 +7002,67 @@ func (m *IPAMConfig) Marshal() (dAtA []byte, err error) { } func (m *IPAMConfig) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IPAMConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Family != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Family)) - } - if len(m.Subnet) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Subnet))) - i += copy(dAtA[i:], m.Subnet) - } - if len(m.Range) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Range))) - i += copy(dAtA[i:], m.Range) - } - if len(m.Gateway) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Gateway))) - i += copy(dAtA[i:], m.Gateway) - } if len(m.Reserved) > 0 { - for k, _ := range m.Reserved { - dAtA[i] = 0x2a - i++ + for k := range m.Reserved { v := m.Reserved[k] - mapSize := 1 + len(k) + sovTypes(uint64(len(k))) + 1 + len(v) + sovTypes(uint64(len(v))) - i = encodeVarintTypes(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ + baseI := i + i -= len(v) + copy(dAtA[i:], v) i = encodeVarintTypes(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintTypes(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintTypes(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2a } } - return i, nil + if len(m.Gateway) > 0 { + i -= len(m.Gateway) + copy(dAtA[i:], m.Gateway) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Gateway))) + i-- + dAtA[i] = 0x22 + } + if len(m.Range) > 0 { + i -= len(m.Range) + copy(dAtA[i:], m.Range) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Range))) + i-- + dAtA[i] = 0x1a + } + if len(m.Subnet) > 0 { + i -= len(m.Subnet) + copy(dAtA[i:], m.Subnet) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Subnet))) + i-- + dAtA[i] = 0x12 + } + if m.Family != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Family)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *PortConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7175,43 +7070,49 @@ func (m *PortConfig) Marshal() (dAtA []byte, err error) { } func (m *PortConfig) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PortConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - if m.Protocol != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Protocol)) - } - if m.TargetPort != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.TargetPort)) + if m.PublishMode != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.PublishMode)) + i-- + dAtA[i] = 0x28 } if m.PublishedPort != 0 { - dAtA[i] = 0x20 - i++ i = encodeVarintTypes(dAtA, i, uint64(m.PublishedPort)) + i-- + dAtA[i] = 0x20 } - if m.PublishMode != 0 { - dAtA[i] = 0x28 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.PublishMode)) + if m.TargetPort != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.TargetPort)) + i-- + dAtA[i] = 0x18 } - return i, nil + if m.Protocol != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Protocol)) + i-- + dAtA[i] = 0x10 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *Driver) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7219,40 +7120,48 @@ func (m *Driver) Marshal() (dAtA []byte, err error) { } func (m *Driver) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Driver) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } if len(m.Options) > 0 { - for k, _ := range m.Options { - dAtA[i] = 0x12 - i++ + for k := range m.Options { v := m.Options[k] - mapSize := 1 + len(k) + sovTypes(uint64(len(k))) + 1 + len(v) + sovTypes(uint64(len(v))) - i = encodeVarintTypes(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ + baseI := i + i -= len(v) + copy(dAtA[i:], v) i = encodeVarintTypes(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintTypes(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintTypes(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 } } - return i, nil + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *IPAMOptions) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7260,39 +7169,48 @@ func (m *IPAMOptions) Marshal() (dAtA []byte, err error) { } func (m *IPAMOptions) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IPAMOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Driver != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Driver.Size())) - n27, err := m.Driver.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n27 - } if len(m.Configs) > 0 { - for _, msg := range m.Configs { + 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 = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + } + } + if m.Driver != nil { + { + size, err := m.Driver.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Peer) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7300,29 +7218,36 @@ func (m *Peer) Marshal() (dAtA []byte, err error) { } func (m *Peer) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Peer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.NodeID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.NodeID))) - i += copy(dAtA[i:], m.NodeID) - } if len(m.Addr) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Addr) + copy(dAtA[i:], m.Addr) i = encodeVarintTypes(dAtA, i, uint64(len(m.Addr))) - i += copy(dAtA[i:], m.Addr) + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.NodeID) > 0 { + i -= len(m.NodeID) + copy(dAtA[i:], m.NodeID) + i = encodeVarintTypes(dAtA, i, uint64(len(m.NodeID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *WeightedPeer) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7330,32 +7255,39 @@ func (m *WeightedPeer) Marshal() (dAtA []byte, err error) { } func (m *WeightedPeer) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WeightedPeer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Peer != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Peer.Size())) - n28, err := m.Peer.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n28 - } if m.Weight != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintTypes(dAtA, i, uint64(m.Weight)) + i-- + dAtA[i] = 0x10 } - return i, nil + if m.Peer != nil { + { + size, err := m.Peer.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *IssuanceStatus) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7363,28 +7295,34 @@ func (m *IssuanceStatus) Marshal() (dAtA []byte, err error) { } func (m *IssuanceStatus) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IssuanceStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.State != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.State)) - } if len(m.Err) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Err) + copy(dAtA[i:], m.Err) i = encodeVarintTypes(dAtA, i, uint64(len(m.Err))) - i += copy(dAtA[i:], m.Err) + i-- + dAtA[i] = 0x12 } - return i, nil + if m.State != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.State)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *AcceptancePolicy) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7392,29 +7330,36 @@ func (m *AcceptancePolicy) Marshal() (dAtA []byte, err error) { } func (m *AcceptancePolicy) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AcceptancePolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.Policies) > 0 { - for _, msg := range m.Policies { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Policies) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Policies[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - return i, nil + return len(dAtA) - i, nil } func (m *AcceptancePolicy_RoleAdmissionPolicy) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7422,42 +7367,49 @@ func (m *AcceptancePolicy_RoleAdmissionPolicy) Marshal() (dAtA []byte, err error } func (m *AcceptancePolicy_RoleAdmissionPolicy) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AcceptancePolicy_RoleAdmissionPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Role != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Role)) + if m.Secret != nil { + { + size, err := m.Secret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a } if m.Autoaccept { - dAtA[i] = 0x10 - i++ + i-- if m.Autoaccept { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x10 } - if m.Secret != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Secret.Size())) - n29, err := m.Secret.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n29 + if m.Role != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Role)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *AcceptancePolicy_RoleAdmissionPolicy_Secret) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7465,29 +7417,36 @@ func (m *AcceptancePolicy_RoleAdmissionPolicy_Secret) Marshal() (dAtA []byte, er } func (m *AcceptancePolicy_RoleAdmissionPolicy_Secret) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AcceptancePolicy_RoleAdmissionPolicy_Secret) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Data) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Data))) - i += copy(dAtA[i:], m.Data) - } if len(m.Alg) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Alg) + copy(dAtA[i:], m.Alg) i = encodeVarintTypes(dAtA, i, uint64(len(m.Alg))) - i += copy(dAtA[i:], m.Alg) + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *ExternalCA) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7495,51 +7454,60 @@ func (m *ExternalCA) Marshal() (dAtA []byte, err error) { } func (m *ExternalCA) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ExternalCA) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Protocol != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Protocol)) - } - if len(m.URL) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.URL))) - i += copy(dAtA[i:], m.URL) + if len(m.CACert) > 0 { + i -= len(m.CACert) + copy(dAtA[i:], m.CACert) + i = encodeVarintTypes(dAtA, i, uint64(len(m.CACert))) + i-- + dAtA[i] = 0x22 } if len(m.Options) > 0 { - for k, _ := range m.Options { - dAtA[i] = 0x1a - i++ + for k := range m.Options { v := m.Options[k] - mapSize := 1 + len(k) + sovTypes(uint64(len(k))) + 1 + len(v) + sovTypes(uint64(len(v))) - i = encodeVarintTypes(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ + baseI := i + i -= len(v) + copy(dAtA[i:], v) i = encodeVarintTypes(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintTypes(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintTypes(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1a } } - if len(m.CACert) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.CACert))) - i += copy(dAtA[i:], m.CACert) + if len(m.URL) > 0 { + i -= len(m.URL) + copy(dAtA[i:], m.URL) + i = encodeVarintTypes(dAtA, i, uint64(len(m.URL))) + i-- + dAtA[i] = 0x12 } - return i, nil + if m.Protocol != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Protocol)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *CAConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7547,56 +7515,67 @@ func (m *CAConfig) Marshal() (dAtA []byte, err error) { } func (m *CAConfig) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CAConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.NodeCertExpiry != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.NodeCertExpiry.Size())) - n30, err := m.NodeCertExpiry.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n30 + if m.ForceRotate != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.ForceRotate)) + i-- + dAtA[i] = 0x28 + } + if len(m.SigningCAKey) > 0 { + i -= len(m.SigningCAKey) + copy(dAtA[i:], m.SigningCAKey) + i = encodeVarintTypes(dAtA, i, uint64(len(m.SigningCAKey))) + i-- + dAtA[i] = 0x22 + } + if len(m.SigningCACert) > 0 { + i -= len(m.SigningCACert) + copy(dAtA[i:], m.SigningCACert) + i = encodeVarintTypes(dAtA, i, uint64(len(m.SigningCACert))) + i-- + dAtA[i] = 0x1a } if len(m.ExternalCAs) > 0 { - for _, msg := range m.ExternalCAs { + for iNdEx := len(m.ExternalCAs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ExternalCAs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintTypes(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + } + } + if m.NodeCertExpiry != nil { + { + size, err := m.NodeCertExpiry.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa } - if len(m.SigningCACert) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.SigningCACert))) - i += copy(dAtA[i:], m.SigningCACert) - } - if len(m.SigningCAKey) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.SigningCAKey))) - i += copy(dAtA[i:], m.SigningCAKey) - } - if m.ForceRotate != 0 { - dAtA[i] = 0x28 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.ForceRotate)) - } - return i, nil + return len(dAtA) - i, nil } func (m *OrchestrationConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7604,22 +7583,27 @@ func (m *OrchestrationConfig) Marshal() (dAtA []byte, err error) { } func (m *OrchestrationConfig) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OrchestrationConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.TaskHistoryRetentionLimit != 0 { - dAtA[i] = 0x8 - i++ i = encodeVarintTypes(dAtA, i, uint64(m.TaskHistoryRetentionLimit)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *TaskDefaults) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7627,27 +7611,34 @@ func (m *TaskDefaults) Marshal() (dAtA []byte, err error) { } func (m *TaskDefaults) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TaskDefaults) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.LogDriver != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.LogDriver.Size())) - n31, err := m.LogDriver.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.LogDriver.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - i += n31 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *DispatcherConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7655,27 +7646,34 @@ func (m *DispatcherConfig) Marshal() (dAtA []byte, err error) { } func (m *DispatcherConfig) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DispatcherConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.HeartbeatPeriod != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.HeartbeatPeriod.Size())) - n32, err := m.HeartbeatPeriod.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.HeartbeatPeriod.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - i += n32 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RaftConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7683,42 +7681,47 @@ func (m *RaftConfig) Marshal() (dAtA []byte, err error) { } func (m *RaftConfig) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RaftConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.SnapshotInterval != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.SnapshotInterval)) - } - if m.KeepOldSnapshots != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.KeepOldSnapshots)) - } - if m.LogEntriesForSlowFollowers != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.LogEntriesForSlowFollowers)) + if m.ElectionTick != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.ElectionTick)) + i-- + dAtA[i] = 0x28 } if m.HeartbeatTick != 0 { - dAtA[i] = 0x20 - i++ i = encodeVarintTypes(dAtA, i, uint64(m.HeartbeatTick)) + i-- + dAtA[i] = 0x20 } - if m.ElectionTick != 0 { - dAtA[i] = 0x28 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.ElectionTick)) + if m.LogEntriesForSlowFollowers != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.LogEntriesForSlowFollowers)) + i-- + dAtA[i] = 0x18 } - return i, nil + if m.KeepOldSnapshots != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.KeepOldSnapshots)) + i-- + dAtA[i] = 0x10 + } + if m.SnapshotInterval != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.SnapshotInterval)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *EncryptionConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7726,27 +7729,32 @@ func (m *EncryptionConfig) Marshal() (dAtA []byte, err error) { } func (m *EncryptionConfig) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EncryptionConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.AutoLockManagers { - dAtA[i] = 0x8 - i++ + i-- if m.AutoLockManagers { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *SpreadOver) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7754,23 +7762,29 @@ func (m *SpreadOver) Marshal() (dAtA []byte, err error) { } func (m *SpreadOver) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SpreadOver) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if len(m.SpreadDescriptor) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.SpreadDescriptor) + copy(dAtA[i:], m.SpreadDescriptor) i = encodeVarintTypes(dAtA, i, uint64(len(m.SpreadDescriptor))) - i += copy(dAtA[i:], m.SpreadDescriptor) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *PlacementPreference) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7778,38 +7792,52 @@ func (m *PlacementPreference) Marshal() (dAtA []byte, err error) { } func (m *PlacementPreference) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PlacementPreference) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Preference != nil { - nn33, err := m.Preference.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.Preference.Size() + i -= size + if _, err := m.Preference.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn33 } - return i, nil + return len(dAtA) - i, nil } func (m *PlacementPreference_Spread) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PlacementPreference_Spread) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Spread != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Spread.Size())) - n34, err := m.Spread.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Spread.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - i += n34 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Placement) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7817,61 +7845,64 @@ func (m *Placement) Marshal() (dAtA []byte, err error) { } func (m *Placement) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Placement) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Constraints) > 0 { - for _, s := range m.Constraints { - dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ + if m.MaxReplicas != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.MaxReplicas)) + i-- + dAtA[i] = 0x20 + } + if len(m.Platforms) > 0 { + for iNdEx := len(m.Platforms) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Platforms[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + i-- + dAtA[i] = 0x1a } } if len(m.Preferences) > 0 { - for _, msg := range m.Preferences { + for iNdEx := len(m.Preferences) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Preferences[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintTypes(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n } } - if len(m.Platforms) > 0 { - for _, msg := range m.Platforms { - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n + if len(m.Constraints) > 0 { + for iNdEx := len(m.Constraints) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Constraints[iNdEx]) + copy(dAtA[i:], m.Constraints[iNdEx]) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Constraints[iNdEx]))) + i-- + dAtA[i] = 0xa } } - if m.MaxReplicas != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.MaxReplicas)) - } - return i, nil + return len(dAtA) - i, nil } func (m *JoinTokens) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7879,29 +7910,36 @@ func (m *JoinTokens) Marshal() (dAtA []byte, err error) { } func (m *JoinTokens) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *JoinTokens) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Worker) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Worker))) - i += copy(dAtA[i:], m.Worker) - } if len(m.Manager) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Manager) + copy(dAtA[i:], m.Manager) i = encodeVarintTypes(dAtA, i, uint64(len(m.Manager))) - i += copy(dAtA[i:], m.Manager) + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.Worker) > 0 { + i -= len(m.Worker) + copy(dAtA[i:], m.Worker) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Worker))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *RootCA) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7909,58 +7947,70 @@ func (m *RootCA) Marshal() (dAtA []byte, err error) { } func (m *RootCA) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RootCA) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.CAKey) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.CAKey))) - i += copy(dAtA[i:], m.CAKey) + if m.LastForcedRotation != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.LastForcedRotation)) + i-- + dAtA[i] = 0x30 } - if len(m.CACert) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.CACert))) - i += copy(dAtA[i:], m.CACert) - } - if len(m.CACertHash) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.CACertHash))) - i += copy(dAtA[i:], m.CACertHash) - } - dAtA[i] = 0x22 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.JoinTokens.Size())) - n35, err := m.JoinTokens.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n35 if m.RootRotation != nil { + { + size, err := m.RootRotation.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x2a - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.RootRotation.Size())) - n36, err := m.RootRotation.MarshalTo(dAtA[i:]) + } + { + size, err := m.JoinTokens.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n36 + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - if m.LastForcedRotation != 0 { - dAtA[i] = 0x30 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.LastForcedRotation)) + i-- + dAtA[i] = 0x22 + if len(m.CACertHash) > 0 { + i -= len(m.CACertHash) + copy(dAtA[i:], m.CACertHash) + i = encodeVarintTypes(dAtA, i, uint64(len(m.CACertHash))) + i-- + dAtA[i] = 0x1a } - return i, nil + if len(m.CACert) > 0 { + i -= len(m.CACert) + copy(dAtA[i:], m.CACert) + i = encodeVarintTypes(dAtA, i, uint64(len(m.CACert))) + i-- + dAtA[i] = 0x12 + } + if len(m.CAKey) > 0 { + i -= len(m.CAKey) + copy(dAtA[i:], m.CAKey) + i = encodeVarintTypes(dAtA, i, uint64(len(m.CAKey))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *Certificate) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -7968,48 +8018,58 @@ func (m *Certificate) Marshal() (dAtA []byte, err error) { } func (m *Certificate) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Certificate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Role != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Role)) - } - if len(m.CSR) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.CSR))) - i += copy(dAtA[i:], m.CSR) - } - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Status.Size())) - n37, err := m.Status.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n37 - if len(m.Certificate) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Certificate))) - i += copy(dAtA[i:], m.Certificate) - } if len(m.CN) > 0 { - dAtA[i] = 0x2a - i++ + i -= len(m.CN) + copy(dAtA[i:], m.CN) i = encodeVarintTypes(dAtA, i, uint64(len(m.CN))) - i += copy(dAtA[i:], m.CN) + i-- + dAtA[i] = 0x2a } - return i, nil + if len(m.Certificate) > 0 { + i -= len(m.Certificate) + copy(dAtA[i:], m.Certificate) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Certificate))) + i-- + dAtA[i] = 0x22 + } + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.CSR) > 0 { + i -= len(m.CSR) + copy(dAtA[i:], m.CSR) + i = encodeVarintTypes(dAtA, i, uint64(len(m.CSR))) + i-- + dAtA[i] = 0x12 + } + if m.Role != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Role)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *EncryptionKey) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8017,39 +8077,46 @@ func (m *EncryptionKey) Marshal() (dAtA []byte, err error) { } func (m *EncryptionKey) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EncryptionKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Subsystem) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Subsystem))) - i += copy(dAtA[i:], m.Subsystem) - } - if m.Algorithm != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Algorithm)) + if m.LamportTime != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.LamportTime)) + i-- + dAtA[i] = 0x20 } if len(m.Key) > 0 { - dAtA[i] = 0x1a - i++ + i -= len(m.Key) + copy(dAtA[i:], m.Key) i = encodeVarintTypes(dAtA, i, uint64(len(m.Key))) - i += copy(dAtA[i:], m.Key) + i-- + dAtA[i] = 0x1a } - if m.LamportTime != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.LamportTime)) + if m.Algorithm != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Algorithm)) + i-- + dAtA[i] = 0x10 } - return i, nil + if len(m.Subsystem) > 0 { + i -= len(m.Subsystem) + copy(dAtA[i:], m.Subsystem) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Subsystem))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *ManagerStatus) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8057,43 +8124,49 @@ func (m *ManagerStatus) Marshal() (dAtA []byte, err error) { } func (m *ManagerStatus) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ManagerStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.RaftID != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.RaftID)) - } - if len(m.Addr) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Addr))) - i += copy(dAtA[i:], m.Addr) + if m.Reachability != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Reachability)) + i-- + dAtA[i] = 0x20 } if m.Leader { - dAtA[i] = 0x18 - i++ + i-- if m.Leader { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x18 } - if m.Reachability != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Reachability)) + if len(m.Addr) > 0 { + i -= len(m.Addr) + copy(dAtA[i:], m.Addr) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Addr))) + i-- + dAtA[i] = 0x12 } - return i, nil + if m.RaftID != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.RaftID)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *FileTarget) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8101,40 +8174,48 @@ func (m *FileTarget) Marshal() (dAtA []byte, err error) { } func (m *FileTarget) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FileTarget) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - if len(m.UID) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.UID))) - i += copy(dAtA[i:], m.UID) + if m.Mode != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Mode)) + i-- + dAtA[i] = 0x20 } if len(m.GID) > 0 { - dAtA[i] = 0x1a - i++ + i -= len(m.GID) + copy(dAtA[i:], m.GID) i = encodeVarintTypes(dAtA, i, uint64(len(m.GID))) - i += copy(dAtA[i:], m.GID) + i-- + dAtA[i] = 0x1a } - if m.Mode != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Mode)) + if len(m.UID) > 0 { + i -= len(m.UID) + copy(dAtA[i:], m.UID) + i = encodeVarintTypes(dAtA, i, uint64(len(m.UID))) + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *RuntimeTarget) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8142,17 +8223,22 @@ func (m *RuntimeTarget) Marshal() (dAtA []byte, err error) { } func (m *RuntimeTarget) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RuntimeTarget) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - return i, nil + return len(dAtA) - i, nil } func (m *SecretReference) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8160,50 +8246,66 @@ func (m *SecretReference) Marshal() (dAtA []byte, err error) { } func (m *SecretReference) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SecretReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.SecretID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.SecretID))) - i += copy(dAtA[i:], m.SecretID) + if m.Target != nil { + { + size := m.Target.Size() + i -= size + if _, err := m.Target.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } } if len(m.SecretName) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.SecretName) + copy(dAtA[i:], m.SecretName) i = encodeVarintTypes(dAtA, i, uint64(len(m.SecretName))) - i += copy(dAtA[i:], m.SecretName) + i-- + dAtA[i] = 0x12 } - if m.Target != nil { - nn38, err := m.Target.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += nn38 + if len(m.SecretID) > 0 { + i -= len(m.SecretID) + copy(dAtA[i:], m.SecretID) + i = encodeVarintTypes(dAtA, i, uint64(len(m.SecretID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *SecretReference_File) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SecretReference_File) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.File != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.File.Size())) - n39, err := m.File.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.File.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - i += n39 + i-- + dAtA[i] = 0x1a } - return i, nil + return len(dAtA) - i, nil } func (m *ConfigReference) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8211,64 +8313,87 @@ func (m *ConfigReference) Marshal() (dAtA []byte, err error) { } func (m *ConfigReference) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConfigReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ConfigID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.ConfigID))) - i += copy(dAtA[i:], m.ConfigID) + if m.Target != nil { + { + size := m.Target.Size() + i -= size + if _, err := m.Target.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } } if len(m.ConfigName) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.ConfigName) + copy(dAtA[i:], m.ConfigName) i = encodeVarintTypes(dAtA, i, uint64(len(m.ConfigName))) - i += copy(dAtA[i:], m.ConfigName) + i-- + dAtA[i] = 0x12 } - if m.Target != nil { - nn40, err := m.Target.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += nn40 + if len(m.ConfigID) > 0 { + i -= len(m.ConfigID) + copy(dAtA[i:], m.ConfigID) + i = encodeVarintTypes(dAtA, i, uint64(len(m.ConfigID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ConfigReference_File) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConfigReference_File) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.File != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.File.Size())) - n41, err := m.File.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.File.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - i += n41 + i-- + dAtA[i] = 0x1a } - return i, nil + return len(dAtA) - i, nil } func (m *ConfigReference_Runtime) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConfigReference_Runtime) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Runtime != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Runtime.Size())) - n42, err := m.Runtime.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Runtime.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - i += n42 + i-- + dAtA[i] = 0x22 } - return i, nil + return len(dAtA) - i, nil } func (m *BlacklistedCertificate) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8276,27 +8401,34 @@ func (m *BlacklistedCertificate) Marshal() (dAtA []byte, err error) { } func (m *BlacklistedCertificate) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BlacklistedCertificate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Expiry != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Expiry.Size())) - n43, err := m.Expiry.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Expiry.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - i += n43 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *HealthConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8304,67 +8436,72 @@ func (m *HealthConfig) Marshal() (dAtA []byte, err error) { } func (m *HealthConfig) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HealthConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Test) > 0 { - for _, s := range m.Test { - dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ + if m.StartPeriod != nil { + { + size, err := m.StartPeriod.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - } - if m.Interval != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Interval.Size())) - n44, err := m.Interval.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n44 - } - if m.Timeout != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Timeout.Size())) - n45, err := m.Timeout.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n45 + i-- + dAtA[i] = 0x2a } if m.Retries != 0 { - dAtA[i] = 0x20 - i++ i = encodeVarintTypes(dAtA, i, uint64(m.Retries)) + i-- + dAtA[i] = 0x20 } - if m.StartPeriod != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.StartPeriod.Size())) - n46, err := m.StartPeriod.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.Timeout != nil { + { + size, err := m.Timeout.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - i += n46 + i-- + dAtA[i] = 0x1a } - return i, nil + if m.Interval != nil { + { + size, err := m.Interval.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Test) > 0 { + for iNdEx := len(m.Test) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Test[iNdEx]) + copy(dAtA[i:], m.Test[iNdEx]) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Test[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil } func (m *MaybeEncryptedRecord) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8372,34 +8509,41 @@ func (m *MaybeEncryptedRecord) Marshal() (dAtA []byte, err error) { } func (m *MaybeEncryptedRecord) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MaybeEncryptedRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Algorithm != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Algorithm)) + if len(m.Nonce) > 0 { + i -= len(m.Nonce) + copy(dAtA[i:], m.Nonce) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Nonce))) + i-- + dAtA[i] = 0x1a } if len(m.Data) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Data) + copy(dAtA[i:], m.Data) i = encodeVarintTypes(dAtA, i, uint64(len(m.Data))) - i += copy(dAtA[i:], m.Data) + i-- + dAtA[i] = 0x12 } - if len(m.Nonce) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Nonce))) - i += copy(dAtA[i:], m.Nonce) + if m.Algorithm != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Algorithm)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *RootRotation) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8407,35 +8551,43 @@ func (m *RootRotation) Marshal() (dAtA []byte, err error) { } func (m *RootRotation) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RootRotation) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.CACert) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.CACert))) - i += copy(dAtA[i:], m.CACert) + if len(m.CrossSignedCACert) > 0 { + i -= len(m.CrossSignedCACert) + copy(dAtA[i:], m.CrossSignedCACert) + i = encodeVarintTypes(dAtA, i, uint64(len(m.CrossSignedCACert))) + i-- + dAtA[i] = 0x1a } if len(m.CAKey) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.CAKey) + copy(dAtA[i:], m.CAKey) i = encodeVarintTypes(dAtA, i, uint64(len(m.CAKey))) - i += copy(dAtA[i:], m.CAKey) + i-- + dAtA[i] = 0x12 } - if len(m.CrossSignedCACert) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.CrossSignedCACert))) - i += copy(dAtA[i:], m.CrossSignedCACert) + if len(m.CACert) > 0 { + i -= len(m.CACert) + copy(dAtA[i:], m.CACert) + i = encodeVarintTypes(dAtA, i, uint64(len(m.CACert))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Privileges) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8443,37 +8595,46 @@ func (m *Privileges) Marshal() (dAtA []byte, err error) { } func (m *Privileges) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Privileges) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.CredentialSpec != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.CredentialSpec.Size())) - n47, err := m.CredentialSpec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n47 - } if m.SELinuxContext != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.SELinuxContext.Size())) - n48, err := m.SELinuxContext.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.SELinuxContext.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - i += n48 + i-- + dAtA[i] = 0x12 } - return i, nil + if m.CredentialSpec != nil { + { + size, err := m.CredentialSpec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *Privileges_CredentialSpec) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8481,48 +8642,73 @@ func (m *Privileges_CredentialSpec) Marshal() (dAtA []byte, err error) { } func (m *Privileges_CredentialSpec) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Privileges_CredentialSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Source != nil { - nn49, err := m.Source.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.Source.Size() + i -= size + if _, err := m.Source.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn49 } - return i, nil + return len(dAtA) - i, nil } func (m *Privileges_CredentialSpec_File) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0xa - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Privileges_CredentialSpec_File) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.File) + copy(dAtA[i:], m.File) i = encodeVarintTypes(dAtA, i, uint64(len(m.File))) - i += copy(dAtA[i:], m.File) - return i, nil + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *Privileges_CredentialSpec_Registry) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x12 - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Privileges_CredentialSpec_Registry) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Registry) + copy(dAtA[i:], m.Registry) i = encodeVarintTypes(dAtA, i, uint64(len(m.Registry))) - i += copy(dAtA[i:], m.Registry) - return i, nil + i-- + dAtA[i] = 0x12 + return len(dAtA) - i, nil } func (m *Privileges_CredentialSpec_Config) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x1a - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Privileges_CredentialSpec_Config) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Config) + copy(dAtA[i:], m.Config) i = encodeVarintTypes(dAtA, i, uint64(len(m.Config))) - i += copy(dAtA[i:], m.Config) - return i, nil + i-- + dAtA[i] = 0x1a + return len(dAtA) - i, nil } func (m *Privileges_SELinuxContext) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8530,51 +8716,60 @@ func (m *Privileges_SELinuxContext) Marshal() (dAtA []byte, err error) { } func (m *Privileges_SELinuxContext) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Privileges_SELinuxContext) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if len(m.Level) > 0 { + i -= len(m.Level) + copy(dAtA[i:], m.Level) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Level))) + i-- + dAtA[i] = 0x2a + } + if len(m.Type) > 0 { + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0x22 + } + if len(m.Role) > 0 { + i -= len(m.Role) + copy(dAtA[i:], m.Role) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Role))) + i-- + dAtA[i] = 0x1a + } + if len(m.User) > 0 { + i -= len(m.User) + copy(dAtA[i:], m.User) + i = encodeVarintTypes(dAtA, i, uint64(len(m.User))) + i-- + dAtA[i] = 0x12 + } if m.Disable { - dAtA[i] = 0x8 - i++ + i-- if m.Disable { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x8 } - if len(m.User) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.User))) - i += copy(dAtA[i:], m.User) - } - if len(m.Role) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Role))) - i += copy(dAtA[i:], m.Role) - } - if len(m.Type) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Type))) - i += copy(dAtA[i:], m.Type) - } - if len(m.Level) > 0 { - dAtA[i] = 0x2a - i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Level))) - i += copy(dAtA[i:], m.Level) - } - return i, nil + return len(dAtA) - i, nil } func (m *JobStatus) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -8582,39 +8777,50 @@ func (m *JobStatus) Marshal() (dAtA []byte, err error) { } func (m *JobStatus) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *JobStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.JobIteration.Size())) - n50, err := m.JobIteration.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n50 if m.LastExecution != nil { + { + size, err := m.LastExecution.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.LastExecution.Size())) - n51, err := m.LastExecution.MarshalTo(dAtA[i:]) + } + { + size, err := m.JobIteration.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n51 + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } - return i, nil + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { + offset -= sovTypes(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *Version) Size() (n int) { if m == nil { @@ -10051,14 +10257,7 @@ func (m *JobStatus) Size() (n int) { } func sovTypes(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozTypes(x uint64) (n int) { return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -10088,6 +10287,11 @@ func (this *Annotations) String() string { if this == nil { return "nil" } + repeatedStringForIndices := "[]IndexEntry{" + for _, f := range this.Indices { + repeatedStringForIndices += strings.Replace(strings.Replace(f.String(), "IndexEntry", "IndexEntry", 1), `&`, ``, 1) + "," + } + repeatedStringForIndices += "}" keysForLabels := make([]string, 0, len(this.Labels)) for k, _ := range this.Labels { keysForLabels = append(keysForLabels, k) @@ -10101,7 +10305,7 @@ func (this *Annotations) String() string { s := strings.Join([]string{`&Annotations{`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`, `Labels:` + mapStringForLabels + `,`, - `Indices:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Indices), "IndexEntry", "IndexEntry", 1), `&`, ``, 1) + `,`, + `Indices:` + repeatedStringForIndices + `,`, `}`, }, "") return s @@ -10162,10 +10366,15 @@ func (this *Resources) String() string { if this == nil { return "nil" } + repeatedStringForGeneric := "[]*GenericResource{" + for _, f := range this.Generic { + repeatedStringForGeneric += strings.Replace(f.String(), "GenericResource", "GenericResource", 1) + "," + } + repeatedStringForGeneric += "}" s := strings.Join([]string{`&Resources{`, `NanoCPUs:` + fmt.Sprintf("%v", this.NanoCPUs) + `,`, `MemoryBytes:` + fmt.Sprintf("%v", this.MemoryBytes) + `,`, - `Generic:` + strings.Replace(fmt.Sprintf("%v", this.Generic), "GenericResource", "GenericResource", 1) + `,`, + `Generic:` + repeatedStringForGeneric + `,`, `}`, }, "") return s @@ -10175,8 +10384,8 @@ func (this *ResourceRequirements) String() string { return "nil" } s := strings.Join([]string{`&ResourceRequirements{`, - `Limits:` + strings.Replace(fmt.Sprintf("%v", this.Limits), "Resources", "Resources", 1) + `,`, - `Reservations:` + strings.Replace(fmt.Sprintf("%v", this.Reservations), "Resources", "Resources", 1) + `,`, + `Limits:` + strings.Replace(this.Limits.String(), "Resources", "Resources", 1) + `,`, + `Reservations:` + strings.Replace(this.Reservations.String(), "Resources", "Resources", 1) + `,`, `SwapBytes:` + strings.Replace(fmt.Sprintf("%v", this.SwapBytes), "Int64Value", "types.Int64Value", 1) + `,`, `MemorySwappiness:` + strings.Replace(fmt.Sprintf("%v", this.MemorySwappiness), "Int64Value", "types.Int64Value", 1) + `,`, `}`, @@ -10209,6 +10418,11 @@ func (this *EngineDescription) String() string { if this == nil { return "nil" } + repeatedStringForPlugins := "[]PluginDescription{" + for _, f := range this.Plugins { + repeatedStringForPlugins += strings.Replace(strings.Replace(f.String(), "PluginDescription", "PluginDescription", 1), `&`, ``, 1) + "," + } + repeatedStringForPlugins += "}" keysForLabels := make([]string, 0, len(this.Labels)) for k, _ := range this.Labels { keysForLabels = append(keysForLabels, k) @@ -10222,7 +10436,7 @@ func (this *EngineDescription) String() string { s := strings.Join([]string{`&EngineDescription{`, `EngineVersion:` + fmt.Sprintf("%v", this.EngineVersion) + `,`, `Labels:` + mapStringForLabels + `,`, - `Plugins:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Plugins), "PluginDescription", "PluginDescription", 1), `&`, ``, 1) + `,`, + `Plugins:` + repeatedStringForPlugins + `,`, `}`, }, "") return s @@ -10233,10 +10447,10 @@ func (this *NodeDescription) String() string { } s := strings.Join([]string{`&NodeDescription{`, `Hostname:` + fmt.Sprintf("%v", this.Hostname) + `,`, - `Platform:` + strings.Replace(fmt.Sprintf("%v", this.Platform), "Platform", "Platform", 1) + `,`, - `Resources:` + strings.Replace(fmt.Sprintf("%v", this.Resources), "Resources", "Resources", 1) + `,`, - `Engine:` + strings.Replace(fmt.Sprintf("%v", this.Engine), "EngineDescription", "EngineDescription", 1) + `,`, - `TLSInfo:` + strings.Replace(fmt.Sprintf("%v", this.TLSInfo), "NodeTLSInfo", "NodeTLSInfo", 1) + `,`, + `Platform:` + strings.Replace(this.Platform.String(), "Platform", "Platform", 1) + `,`, + `Resources:` + strings.Replace(this.Resources.String(), "Resources", "Resources", 1) + `,`, + `Engine:` + strings.Replace(this.Engine.String(), "EngineDescription", "EngineDescription", 1) + `,`, + `TLSInfo:` + strings.Replace(this.TLSInfo.String(), "NodeTLSInfo", "NodeTLSInfo", 1) + `,`, `FIPS:` + fmt.Sprintf("%v", this.FIPS) + `,`, `}`, }, "") @@ -10333,7 +10547,7 @@ func (this *Mount_VolumeOptions) String() string { s := strings.Join([]string{`&Mount_VolumeOptions{`, `NoCopy:` + fmt.Sprintf("%v", this.NoCopy) + `,`, `Labels:` + mapStringForLabels + `,`, - `DriverConfig:` + strings.Replace(fmt.Sprintf("%v", this.DriverConfig), "Driver", "Driver", 1) + `,`, + `DriverConfig:` + strings.Replace(this.DriverConfig.String(), "Driver", "Driver", 1) + `,`, `}`, }, "") return s @@ -10369,7 +10583,7 @@ func (this *UpdateConfig) String() string { } s := strings.Join([]string{`&UpdateConfig{`, `Parallelism:` + fmt.Sprintf("%v", this.Parallelism) + `,`, - `Delay:` + strings.Replace(strings.Replace(this.Delay.String(), "Duration", "types.Duration", 1), `&`, ``, 1) + `,`, + `Delay:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Delay), "Duration", "types.Duration", 1), `&`, ``, 1) + `,`, `FailureAction:` + fmt.Sprintf("%v", this.FailureAction) + `,`, `Monitor:` + strings.Replace(fmt.Sprintf("%v", this.Monitor), "Duration", "types.Duration", 1) + `,`, `MaxFailureRatio:` + fmt.Sprintf("%v", this.MaxFailureRatio) + `,`, @@ -10407,8 +10621,13 @@ func (this *PortStatus) String() string { if this == nil { return "nil" } + repeatedStringForPorts := "[]*PortConfig{" + for _, f := range this.Ports { + repeatedStringForPorts += strings.Replace(f.String(), "PortConfig", "PortConfig", 1) + "," + } + repeatedStringForPorts += "}" s := strings.Join([]string{`&PortStatus{`, - `Ports:` + strings.Replace(fmt.Sprintf("%v", this.Ports), "PortConfig", "PortConfig", 1) + `,`, + `Ports:` + repeatedStringForPorts + `,`, `}`, }, "") return s @@ -10423,7 +10642,7 @@ func (this *TaskStatus) String() string { `Message:` + fmt.Sprintf("%v", this.Message) + `,`, `Err:` + fmt.Sprintf("%v", this.Err) + `,`, `RuntimeStatus:` + fmt.Sprintf("%v", this.RuntimeStatus) + `,`, - `PortStatus:` + strings.Replace(fmt.Sprintf("%v", this.PortStatus), "PortStatus", "PortStatus", 1) + `,`, + `PortStatus:` + strings.Replace(this.PortStatus.String(), "PortStatus", "PortStatus", 1) + `,`, `AppliedBy:` + fmt.Sprintf("%v", this.AppliedBy) + `,`, `AppliedAt:` + strings.Replace(fmt.Sprintf("%v", this.AppliedAt), "Timestamp", "types.Timestamp", 1) + `,`, `}`, @@ -10526,9 +10745,14 @@ func (this *IPAMOptions) String() string { if this == nil { return "nil" } + repeatedStringForConfigs := "[]*IPAMConfig{" + for _, f := range this.Configs { + repeatedStringForConfigs += strings.Replace(f.String(), "IPAMConfig", "IPAMConfig", 1) + "," + } + repeatedStringForConfigs += "}" s := strings.Join([]string{`&IPAMOptions{`, - `Driver:` + strings.Replace(fmt.Sprintf("%v", this.Driver), "Driver", "Driver", 1) + `,`, - `Configs:` + strings.Replace(fmt.Sprintf("%v", this.Configs), "IPAMConfig", "IPAMConfig", 1) + `,`, + `Driver:` + strings.Replace(this.Driver.String(), "Driver", "Driver", 1) + `,`, + `Configs:` + repeatedStringForConfigs + `,`, `}`, }, "") return s @@ -10549,7 +10773,7 @@ func (this *WeightedPeer) String() string { return "nil" } s := strings.Join([]string{`&WeightedPeer{`, - `Peer:` + strings.Replace(fmt.Sprintf("%v", this.Peer), "Peer", "Peer", 1) + `,`, + `Peer:` + strings.Replace(this.Peer.String(), "Peer", "Peer", 1) + `,`, `Weight:` + fmt.Sprintf("%v", this.Weight) + `,`, `}`, }, "") @@ -10570,8 +10794,13 @@ func (this *AcceptancePolicy) String() string { if this == nil { return "nil" } + repeatedStringForPolicies := "[]*AcceptancePolicy_RoleAdmissionPolicy{" + for _, f := range this.Policies { + repeatedStringForPolicies += strings.Replace(fmt.Sprintf("%v", f), "AcceptancePolicy_RoleAdmissionPolicy", "AcceptancePolicy_RoleAdmissionPolicy", 1) + "," + } + repeatedStringForPolicies += "}" s := strings.Join([]string{`&AcceptancePolicy{`, - `Policies:` + strings.Replace(fmt.Sprintf("%v", this.Policies), "AcceptancePolicy_RoleAdmissionPolicy", "AcceptancePolicy_RoleAdmissionPolicy", 1) + `,`, + `Policies:` + repeatedStringForPolicies + `,`, `}`, }, "") return s @@ -10626,9 +10855,14 @@ func (this *CAConfig) String() string { if this == nil { return "nil" } + repeatedStringForExternalCAs := "[]*ExternalCA{" + for _, f := range this.ExternalCAs { + repeatedStringForExternalCAs += strings.Replace(f.String(), "ExternalCA", "ExternalCA", 1) + "," + } + repeatedStringForExternalCAs += "}" s := strings.Join([]string{`&CAConfig{`, `NodeCertExpiry:` + strings.Replace(fmt.Sprintf("%v", this.NodeCertExpiry), "Duration", "types.Duration", 1) + `,`, - `ExternalCAs:` + strings.Replace(fmt.Sprintf("%v", this.ExternalCAs), "ExternalCA", "ExternalCA", 1) + `,`, + `ExternalCAs:` + repeatedStringForExternalCAs + `,`, `SigningCACert:` + fmt.Sprintf("%v", this.SigningCACert) + `,`, `SigningCAKey:` + fmt.Sprintf("%v", this.SigningCAKey) + `,`, `ForceRotate:` + fmt.Sprintf("%v", this.ForceRotate) + `,`, @@ -10651,7 +10885,7 @@ func (this *TaskDefaults) String() string { return "nil" } s := strings.Join([]string{`&TaskDefaults{`, - `LogDriver:` + strings.Replace(fmt.Sprintf("%v", this.LogDriver), "Driver", "Driver", 1) + `,`, + `LogDriver:` + strings.Replace(this.LogDriver.String(), "Driver", "Driver", 1) + `,`, `}`, }, "") return s @@ -10724,10 +10958,20 @@ func (this *Placement) String() string { if this == nil { return "nil" } + repeatedStringForPreferences := "[]*PlacementPreference{" + for _, f := range this.Preferences { + repeatedStringForPreferences += strings.Replace(f.String(), "PlacementPreference", "PlacementPreference", 1) + "," + } + repeatedStringForPreferences += "}" + repeatedStringForPlatforms := "[]*Platform{" + for _, f := range this.Platforms { + repeatedStringForPlatforms += strings.Replace(f.String(), "Platform", "Platform", 1) + "," + } + repeatedStringForPlatforms += "}" s := strings.Join([]string{`&Placement{`, `Constraints:` + fmt.Sprintf("%v", this.Constraints) + `,`, - `Preferences:` + strings.Replace(fmt.Sprintf("%v", this.Preferences), "PlacementPreference", "PlacementPreference", 1) + `,`, - `Platforms:` + strings.Replace(fmt.Sprintf("%v", this.Platforms), "Platform", "Platform", 1) + `,`, + `Preferences:` + repeatedStringForPreferences + `,`, + `Platforms:` + repeatedStringForPlatforms + `,`, `MaxReplicas:` + fmt.Sprintf("%v", this.MaxReplicas) + `,`, `}`, }, "") @@ -10753,7 +10997,7 @@ func (this *RootCA) String() string { `CACert:` + fmt.Sprintf("%v", this.CACert) + `,`, `CACertHash:` + fmt.Sprintf("%v", this.CACertHash) + `,`, `JoinTokens:` + strings.Replace(strings.Replace(this.JoinTokens.String(), "JoinTokens", "JoinTokens", 1), `&`, ``, 1) + `,`, - `RootRotation:` + strings.Replace(fmt.Sprintf("%v", this.RootRotation), "RootRotation", "RootRotation", 1) + `,`, + `RootRotation:` + strings.Replace(this.RootRotation.String(), "RootRotation", "RootRotation", 1) + `,`, `LastForcedRotation:` + fmt.Sprintf("%v", this.LastForcedRotation) + `,`, `}`, }, "") @@ -11061,10 +11305,7 @@ func (m *Version) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -11178,10 +11419,7 @@ func (m *IndexEntry) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -11373,7 +11611,7 @@ func (m *Annotations) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > postIndex { @@ -11424,10 +11662,7 @@ func (m *Annotations) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -11541,10 +11776,7 @@ func (m *NamedGenericResource) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -11645,10 +11877,7 @@ func (m *DiscreteGenericResource) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -11768,10 +11997,7 @@ func (m *GenericResource) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -11893,10 +12119,7 @@ func (m *Resources) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -12090,10 +12313,7 @@ func (m *ResourceRequirements) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -12207,10 +12427,7 @@ func (m *Platform) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -12324,10 +12541,7 @@ func (m *PluginDescription) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -12519,7 +12733,7 @@ func (m *EngineDescription) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > postIndex { @@ -12570,10 +12784,7 @@ func (m *EngineDescription) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -12819,10 +13030,7 @@ func (m *NodeDescription) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -12974,10 +13182,7 @@ func (m *NodeTLSInfo) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -13098,10 +13303,7 @@ func (m *RaftMemberStatus) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -13234,10 +13436,7 @@ func (m *NodeStatus) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -13319,10 +13518,7 @@ func (m *Image) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -13602,10 +13798,7 @@ func (m *Mount) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -13694,10 +13887,7 @@ func (m *Mount_BindOptions) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -13877,7 +14067,7 @@ func (m *Mount_VolumeOptions) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > postIndex { @@ -13930,10 +14120,7 @@ func (m *Mount_VolumeOptions) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -14053,10 +14240,7 @@ func (m *Mount_TmpfsOptions) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -14216,10 +14400,7 @@ func (m *RestartPolicy) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -14406,10 +14587,7 @@ func (m *UpdateConfig) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -14582,10 +14760,7 @@ func (m *UpdateStatus) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -14705,10 +14880,7 @@ func (m *ContainerStatus) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -14792,10 +14964,7 @@ func (m *PortStatus) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -15103,10 +15272,7 @@ func (m *TaskStatus) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -15362,7 +15528,7 @@ func (m *NetworkAttachmentConfig) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > postIndex { @@ -15379,10 +15545,7 @@ func (m *NetworkAttachmentConfig) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -15657,7 +15820,7 @@ func (m *IPAMConfig) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > postIndex { @@ -15674,10 +15837,7 @@ func (m *IPAMConfig) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -15835,10 +15995,7 @@ func (m *PortConfig) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -16030,7 +16187,7 @@ func (m *Driver) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > postIndex { @@ -16047,10 +16204,7 @@ func (m *Driver) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -16170,10 +16324,7 @@ func (m *IPAMOptions) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -16287,10 +16438,7 @@ func (m *Peer) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -16395,10 +16543,7 @@ func (m *WeightedPeer) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -16499,10 +16644,7 @@ func (m *IssuanceStatus) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -16586,10 +16728,7 @@ func (m *AcceptancePolicy) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -16714,10 +16853,7 @@ func (m *AcceptancePolicy_RoleAdmissionPolicy) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -16833,10 +16969,7 @@ func (m *AcceptancePolicy_RoleAdmissionPolicy_Secret) Unmarshal(dAtA []byte) err if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -17047,7 +17180,7 @@ func (m *ExternalCA) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > postIndex { @@ -17098,10 +17231,7 @@ func (m *ExternalCA) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -17308,10 +17438,7 @@ func (m *CAConfig) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -17380,10 +17507,7 @@ func (m *OrchestrationConfig) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -17469,10 +17593,7 @@ func (m *TaskDefaults) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -17558,10 +17679,7 @@ func (m *DispatcherConfig) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -17706,10 +17824,7 @@ func (m *RaftConfig) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -17779,10 +17894,7 @@ func (m *EncryptionConfig) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -17864,10 +17976,7 @@ func (m *SpreadOver) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -17952,10 +18061,7 @@ func (m *PlacementPreference) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -18124,10 +18230,7 @@ func (m *Placement) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -18241,10 +18344,7 @@ func (m *JoinTokens) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -18482,10 +18582,7 @@ func (m *RootCA) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -18687,10 +18784,7 @@ func (m *Certificate) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -18844,10 +18938,7 @@ func (m *EncryptionKey) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -18987,10 +19078,7 @@ func (m *ManagerStatus) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -19155,10 +19243,7 @@ func (m *FileTarget) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -19208,10 +19293,7 @@ func (m *RuntimeTarget) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -19360,10 +19442,7 @@ func (m *SecretReference) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -19547,10 +19626,7 @@ func (m *ConfigReference) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -19636,10 +19712,7 @@ func (m *BlacklistedCertificate) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -19848,10 +19921,7 @@ func (m *HealthConfig) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -19988,10 +20058,7 @@ func (m *MaybeEncryptedRecord) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -20143,10 +20210,7 @@ func (m *RootRotation) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -20268,10 +20332,7 @@ func (m *Privileges) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -20417,10 +20478,7 @@ func (m *Privileges_CredentialSpec) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -20618,10 +20676,7 @@ func (m *Privileges_SELinuxContext) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -20740,10 +20795,7 @@ func (m *JobStatus) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { @@ -20761,6 +20813,7 @@ func (m *JobStatus) Unmarshal(dAtA []byte) error { func skipTypes(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -20792,10 +20845,8 @@ func skipTypes(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -20816,55 +20867,30 @@ func skipTypes(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthTypes } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipTypes(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTypes + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthTypes + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") ) diff --git a/vendor/github.com/docker/swarmkit/api/watch.pb.go b/vendor/github.com/docker/swarmkit/api/watch.pb.go index c3b7b75c4b..cdae947d60 100644 --- a/vendor/github.com/docker/swarmkit/api/watch.pb.go +++ b/vendor/github.com/docker/swarmkit/api/watch.pb.go @@ -18,6 +18,7 @@ import ( status "google.golang.org/grpc/status" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" rafttime "time" @@ -32,7 +33,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // WatchActionKind distinguishes between creations, updates, and removals. It // is structured as a bitmap so multiple kinds of events can be requested with @@ -95,7 +96,7 @@ func (m *Object) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Object.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -121,31 +122,31 @@ type isObject_Object interface { } type Object_Node struct { - Node *Node `protobuf:"bytes,1,opt,name=node,proto3,oneof"` + Node *Node `protobuf:"bytes,1,opt,name=node,proto3,oneof" json:"node,omitempty"` } type Object_Service struct { - Service *Service `protobuf:"bytes,2,opt,name=service,proto3,oneof"` + Service *Service `protobuf:"bytes,2,opt,name=service,proto3,oneof" json:"service,omitempty"` } type Object_Network struct { - Network *Network `protobuf:"bytes,3,opt,name=network,proto3,oneof"` + Network *Network `protobuf:"bytes,3,opt,name=network,proto3,oneof" json:"network,omitempty"` } type Object_Task struct { - Task *Task `protobuf:"bytes,4,opt,name=task,proto3,oneof"` + Task *Task `protobuf:"bytes,4,opt,name=task,proto3,oneof" json:"task,omitempty"` } type Object_Cluster struct { - Cluster *Cluster `protobuf:"bytes,5,opt,name=cluster,proto3,oneof"` + Cluster *Cluster `protobuf:"bytes,5,opt,name=cluster,proto3,oneof" json:"cluster,omitempty"` } type Object_Secret struct { - Secret *Secret `protobuf:"bytes,6,opt,name=secret,proto3,oneof"` + Secret *Secret `protobuf:"bytes,6,opt,name=secret,proto3,oneof" json:"secret,omitempty"` } type Object_Resource struct { - Resource *Resource `protobuf:"bytes,7,opt,name=resource,proto3,oneof"` + Resource *Resource `protobuf:"bytes,7,opt,name=resource,proto3,oneof" json:"resource,omitempty"` } type Object_Extension struct { - Extension *Extension `protobuf:"bytes,8,opt,name=extension,proto3,oneof"` + Extension *Extension `protobuf:"bytes,8,opt,name=extension,proto3,oneof" json:"extension,omitempty"` } type Object_Config struct { - Config *Config `protobuf:"bytes,9,opt,name=config,proto3,oneof"` + Config *Config `protobuf:"bytes,9,opt,name=config,proto3,oneof" json:"config,omitempty"` } func (*Object_Node) isObject_Object() {} @@ -228,9 +229,9 @@ func (m *Object) GetConfig() *Config { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*Object) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _Object_OneofMarshaler, _Object_OneofUnmarshaler, _Object_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*Object) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*Object_Node)(nil), (*Object_Service)(nil), (*Object_Network)(nil), @@ -243,198 +244,6 @@ func (*Object) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, } } -func _Object_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*Object) - // Object - switch x := m.Object.(type) { - case *Object_Node: - _ = b.EncodeVarint(1<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Node); err != nil { - return err - } - case *Object_Service: - _ = b.EncodeVarint(2<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Service); err != nil { - return err - } - case *Object_Network: - _ = b.EncodeVarint(3<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Network); err != nil { - return err - } - case *Object_Task: - _ = b.EncodeVarint(4<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Task); err != nil { - return err - } - case *Object_Cluster: - _ = b.EncodeVarint(5<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Cluster); err != nil { - return err - } - case *Object_Secret: - _ = b.EncodeVarint(6<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Secret); err != nil { - return err - } - case *Object_Resource: - _ = b.EncodeVarint(7<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Resource); err != nil { - return err - } - case *Object_Extension: - _ = b.EncodeVarint(8<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Extension); err != nil { - return err - } - case *Object_Config: - _ = b.EncodeVarint(9<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Config); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("Object.Object has unexpected type %T", x) - } - return nil -} - -func _Object_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*Object) - switch tag { - case 1: // Object.node - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Node) - err := b.DecodeMessage(msg) - m.Object = &Object_Node{msg} - return true, err - case 2: // Object.service - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Service) - err := b.DecodeMessage(msg) - m.Object = &Object_Service{msg} - return true, err - case 3: // Object.network - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Network) - err := b.DecodeMessage(msg) - m.Object = &Object_Network{msg} - return true, err - case 4: // Object.task - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Task) - err := b.DecodeMessage(msg) - m.Object = &Object_Task{msg} - return true, err - case 5: // Object.cluster - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Cluster) - err := b.DecodeMessage(msg) - m.Object = &Object_Cluster{msg} - return true, err - case 6: // Object.secret - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Secret) - err := b.DecodeMessage(msg) - m.Object = &Object_Secret{msg} - return true, err - case 7: // Object.resource - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Resource) - err := b.DecodeMessage(msg) - m.Object = &Object_Resource{msg} - return true, err - case 8: // Object.extension - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Extension) - err := b.DecodeMessage(msg) - m.Object = &Object_Extension{msg} - return true, err - case 9: // Object.config - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Config) - err := b.DecodeMessage(msg) - m.Object = &Object_Config{msg} - return true, err - default: - return false, nil - } -} - -func _Object_OneofSizer(msg proto.Message) (n int) { - m := msg.(*Object) - // Object - switch x := m.Object.(type) { - case *Object_Node: - s := proto.Size(x.Node) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *Object_Service: - s := proto.Size(x.Service) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *Object_Network: - s := proto.Size(x.Network) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *Object_Task: - s := proto.Size(x.Task) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *Object_Cluster: - s := proto.Size(x.Cluster) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *Object_Secret: - s := proto.Size(x.Secret) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *Object_Resource: - s := proto.Size(x.Resource) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *Object_Extension: - s := proto.Size(x.Extension) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *Object_Config: - s := proto.Size(x.Config) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - // FIXME(aaronl): These messages should ideally be embedded in SelectBy, but // protoc generates bad code for that. type SelectBySlot struct { @@ -455,7 +264,7 @@ func (m *SelectBySlot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_SelectBySlot.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -493,7 +302,7 @@ func (m *SelectByCustom) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return xxx_messageInfo_SelectByCustom.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -550,7 +359,7 @@ func (m *SelectBy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_SelectBy.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -576,52 +385,52 @@ type isSelectBy_By interface { } type SelectBy_ID struct { - ID string `protobuf:"bytes,1,opt,name=id,proto3,oneof"` + ID string `protobuf:"bytes,1,opt,name=id,proto3,oneof" json:"id,omitempty"` } type SelectBy_IDPrefix struct { - IDPrefix string `protobuf:"bytes,2,opt,name=id_prefix,json=idPrefix,proto3,oneof"` + IDPrefix string `protobuf:"bytes,2,opt,name=id_prefix,json=idPrefix,proto3,oneof" json:"id_prefix,omitempty"` } type SelectBy_Name struct { - Name string `protobuf:"bytes,3,opt,name=name,proto3,oneof"` + Name string `protobuf:"bytes,3,opt,name=name,proto3,oneof" json:"name,omitempty"` } type SelectBy_NamePrefix struct { - NamePrefix string `protobuf:"bytes,4,opt,name=name_prefix,json=namePrefix,proto3,oneof"` + NamePrefix string `protobuf:"bytes,4,opt,name=name_prefix,json=namePrefix,proto3,oneof" json:"name_prefix,omitempty"` } type SelectBy_Custom struct { - Custom *SelectByCustom `protobuf:"bytes,5,opt,name=custom,proto3,oneof"` + Custom *SelectByCustom `protobuf:"bytes,5,opt,name=custom,proto3,oneof" json:"custom,omitempty"` } type SelectBy_CustomPrefix struct { - CustomPrefix *SelectByCustom `protobuf:"bytes,6,opt,name=custom_prefix,json=customPrefix,proto3,oneof"` + CustomPrefix *SelectByCustom `protobuf:"bytes,6,opt,name=custom_prefix,json=customPrefix,proto3,oneof" json:"custom_prefix,omitempty"` } type SelectBy_ServiceID struct { - ServiceID string `protobuf:"bytes,7,opt,name=service_id,json=serviceId,proto3,oneof"` + ServiceID string `protobuf:"bytes,7,opt,name=service_id,json=serviceId,proto3,oneof" json:"service_id,omitempty"` } type SelectBy_NodeID struct { - NodeID string `protobuf:"bytes,8,opt,name=node_id,json=nodeId,proto3,oneof"` + NodeID string `protobuf:"bytes,8,opt,name=node_id,json=nodeId,proto3,oneof" json:"node_id,omitempty"` } type SelectBy_Slot struct { - Slot *SelectBySlot `protobuf:"bytes,9,opt,name=slot,proto3,oneof"` + Slot *SelectBySlot `protobuf:"bytes,9,opt,name=slot,proto3,oneof" json:"slot,omitempty"` } type SelectBy_DesiredState struct { - DesiredState TaskState `protobuf:"varint,10,opt,name=desired_state,json=desiredState,proto3,enum=docker.swarmkit.v1.TaskState,oneof"` + DesiredState TaskState `protobuf:"varint,10,opt,name=desired_state,json=desiredState,proto3,enum=docker.swarmkit.v1.TaskState,oneof" json:"desired_state,omitempty"` } type SelectBy_Role struct { - Role NodeRole `protobuf:"varint,11,opt,name=role,proto3,enum=docker.swarmkit.v1.NodeRole,oneof"` + Role NodeRole `protobuf:"varint,11,opt,name=role,proto3,enum=docker.swarmkit.v1.NodeRole,oneof" json:"role,omitempty"` } type SelectBy_Membership struct { - Membership NodeSpec_Membership `protobuf:"varint,12,opt,name=membership,proto3,enum=docker.swarmkit.v1.NodeSpec_Membership,oneof"` + Membership NodeSpec_Membership `protobuf:"varint,12,opt,name=membership,proto3,enum=docker.swarmkit.v1.NodeSpec_Membership,oneof" json:"membership,omitempty"` } type SelectBy_ReferencedNetworkID struct { - ReferencedNetworkID string `protobuf:"bytes,13,opt,name=referenced_network_id,json=referencedNetworkId,proto3,oneof"` + ReferencedNetworkID string `protobuf:"bytes,13,opt,name=referenced_network_id,json=referencedNetworkId,proto3,oneof" json:"referenced_network_id,omitempty"` } type SelectBy_ReferencedSecretID struct { - ReferencedSecretID string `protobuf:"bytes,14,opt,name=referenced_secret_id,json=referencedSecretId,proto3,oneof"` + ReferencedSecretID string `protobuf:"bytes,14,opt,name=referenced_secret_id,json=referencedSecretId,proto3,oneof" json:"referenced_secret_id,omitempty"` } type SelectBy_ReferencedConfigID struct { - ReferencedConfigID string `protobuf:"bytes,16,opt,name=referenced_config_id,json=referencedConfigId,proto3,oneof"` + ReferencedConfigID string `protobuf:"bytes,16,opt,name=referenced_config_id,json=referencedConfigId,proto3,oneof" json:"referenced_config_id,omitempty"` } type SelectBy_Kind struct { - Kind string `protobuf:"bytes,15,opt,name=kind,proto3,oneof"` + Kind string `protobuf:"bytes,15,opt,name=kind,proto3,oneof" json:"kind,omitempty"` } func (*SelectBy_ID) isSelectBy_By() {} @@ -760,9 +569,9 @@ func (m *SelectBy) GetKind() string { return "" } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*SelectBy) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _SelectBy_OneofMarshaler, _SelectBy_OneofUnmarshaler, _SelectBy_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*SelectBy) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*SelectBy_ID)(nil), (*SelectBy_IDPrefix)(nil), (*SelectBy_Name)(nil), @@ -782,269 +591,6 @@ func (*SelectBy) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) erro } } -func _SelectBy_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*SelectBy) - // By - switch x := m.By.(type) { - case *SelectBy_ID: - _ = b.EncodeVarint(1<<3 | proto.WireBytes) - _ = b.EncodeStringBytes(x.ID) - case *SelectBy_IDPrefix: - _ = b.EncodeVarint(2<<3 | proto.WireBytes) - _ = b.EncodeStringBytes(x.IDPrefix) - case *SelectBy_Name: - _ = b.EncodeVarint(3<<3 | proto.WireBytes) - _ = b.EncodeStringBytes(x.Name) - case *SelectBy_NamePrefix: - _ = b.EncodeVarint(4<<3 | proto.WireBytes) - _ = b.EncodeStringBytes(x.NamePrefix) - case *SelectBy_Custom: - _ = b.EncodeVarint(5<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Custom); err != nil { - return err - } - case *SelectBy_CustomPrefix: - _ = b.EncodeVarint(6<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.CustomPrefix); err != nil { - return err - } - case *SelectBy_ServiceID: - _ = b.EncodeVarint(7<<3 | proto.WireBytes) - _ = b.EncodeStringBytes(x.ServiceID) - case *SelectBy_NodeID: - _ = b.EncodeVarint(8<<3 | proto.WireBytes) - _ = b.EncodeStringBytes(x.NodeID) - case *SelectBy_Slot: - _ = b.EncodeVarint(9<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Slot); err != nil { - return err - } - case *SelectBy_DesiredState: - _ = b.EncodeVarint(10<<3 | proto.WireVarint) - _ = b.EncodeVarint(uint64(x.DesiredState)) - case *SelectBy_Role: - _ = b.EncodeVarint(11<<3 | proto.WireVarint) - _ = b.EncodeVarint(uint64(x.Role)) - case *SelectBy_Membership: - _ = b.EncodeVarint(12<<3 | proto.WireVarint) - _ = b.EncodeVarint(uint64(x.Membership)) - case *SelectBy_ReferencedNetworkID: - _ = b.EncodeVarint(13<<3 | proto.WireBytes) - _ = b.EncodeStringBytes(x.ReferencedNetworkID) - case *SelectBy_ReferencedSecretID: - _ = b.EncodeVarint(14<<3 | proto.WireBytes) - _ = b.EncodeStringBytes(x.ReferencedSecretID) - case *SelectBy_ReferencedConfigID: - _ = b.EncodeVarint(16<<3 | proto.WireBytes) - _ = b.EncodeStringBytes(x.ReferencedConfigID) - case *SelectBy_Kind: - _ = b.EncodeVarint(15<<3 | proto.WireBytes) - _ = b.EncodeStringBytes(x.Kind) - case nil: - default: - return fmt.Errorf("SelectBy.By has unexpected type %T", x) - } - return nil -} - -func _SelectBy_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*SelectBy) - switch tag { - case 1: // By.id - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeStringBytes() - m.By = &SelectBy_ID{x} - return true, err - case 2: // By.id_prefix - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeStringBytes() - m.By = &SelectBy_IDPrefix{x} - return true, err - case 3: // By.name - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeStringBytes() - m.By = &SelectBy_Name{x} - return true, err - case 4: // By.name_prefix - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeStringBytes() - m.By = &SelectBy_NamePrefix{x} - return true, err - case 5: // By.custom - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(SelectByCustom) - err := b.DecodeMessage(msg) - m.By = &SelectBy_Custom{msg} - return true, err - case 6: // By.custom_prefix - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(SelectByCustom) - err := b.DecodeMessage(msg) - m.By = &SelectBy_CustomPrefix{msg} - return true, err - case 7: // By.service_id - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeStringBytes() - m.By = &SelectBy_ServiceID{x} - return true, err - case 8: // By.node_id - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeStringBytes() - m.By = &SelectBy_NodeID{x} - return true, err - case 9: // By.slot - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(SelectBySlot) - err := b.DecodeMessage(msg) - m.By = &SelectBy_Slot{msg} - return true, err - case 10: // By.desired_state - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeVarint() - m.By = &SelectBy_DesiredState{TaskState(x)} - return true, err - case 11: // By.role - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeVarint() - m.By = &SelectBy_Role{NodeRole(x)} - return true, err - case 12: // By.membership - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeVarint() - m.By = &SelectBy_Membership{NodeSpec_Membership(x)} - return true, err - case 13: // By.referenced_network_id - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeStringBytes() - m.By = &SelectBy_ReferencedNetworkID{x} - return true, err - case 14: // By.referenced_secret_id - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeStringBytes() - m.By = &SelectBy_ReferencedSecretID{x} - return true, err - case 16: // By.referenced_config_id - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeStringBytes() - m.By = &SelectBy_ReferencedConfigID{x} - return true, err - case 15: // By.kind - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeStringBytes() - m.By = &SelectBy_Kind{x} - return true, err - default: - return false, nil - } -} - -func _SelectBy_OneofSizer(msg proto.Message) (n int) { - m := msg.(*SelectBy) - // By - switch x := m.By.(type) { - case *SelectBy_ID: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(len(x.ID))) - n += len(x.ID) - case *SelectBy_IDPrefix: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(len(x.IDPrefix))) - n += len(x.IDPrefix) - case *SelectBy_Name: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(len(x.Name))) - n += len(x.Name) - case *SelectBy_NamePrefix: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(len(x.NamePrefix))) - n += len(x.NamePrefix) - case *SelectBy_Custom: - s := proto.Size(x.Custom) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *SelectBy_CustomPrefix: - s := proto.Size(x.CustomPrefix) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *SelectBy_ServiceID: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(len(x.ServiceID))) - n += len(x.ServiceID) - case *SelectBy_NodeID: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(len(x.NodeID))) - n += len(x.NodeID) - case *SelectBy_Slot: - s := proto.Size(x.Slot) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *SelectBy_DesiredState: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(x.DesiredState)) - case *SelectBy_Role: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(x.Role)) - case *SelectBy_Membership: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(x.Membership)) - case *SelectBy_ReferencedNetworkID: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(len(x.ReferencedNetworkID))) - n += len(x.ReferencedNetworkID) - case *SelectBy_ReferencedSecretID: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(len(x.ReferencedSecretID))) - n += len(x.ReferencedSecretID) - case *SelectBy_ReferencedConfigID: - n += 2 // tag and wire - n += proto.SizeVarint(uint64(len(x.ReferencedConfigID))) - n += len(x.ReferencedConfigID) - case *SelectBy_Kind: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(len(x.Kind))) - n += len(x.Kind) - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - type WatchRequest struct { // Multiple entries are combined using OR logic - i.e. if an event // matches all of the selectors specified in any single watch entry, @@ -1076,7 +622,7 @@ func (m *WatchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_WatchRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1120,7 +666,7 @@ func (m *WatchRequest_WatchEntry) XXX_Marshal(b []byte, deterministic bool) ([]b return xxx_messageInfo_WatchRequest_WatchEntry.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1162,7 +708,7 @@ func (m *WatchMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_WatchMessage.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1207,7 +753,7 @@ func (m *WatchMessage_Event) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_WatchMessage_Event.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1718,6 +1264,14 @@ type WatchServer interface { Watch(*WatchRequest, Watch_WatchServer) error } +// UnimplementedWatchServer can be embedded to have forward compatible implementations. +type UnimplementedWatchServer struct { +} + +func (*UnimplementedWatchServer) Watch(req *WatchRequest, srv Watch_WatchServer) error { + return status.Errorf(codes.Unimplemented, "method Watch not implemented") +} + func RegisterWatchServer(s *grpc.Server, srv WatchServer) { s.RegisterService(&_Watch_serviceDesc, srv) } @@ -1760,7 +1314,7 @@ var _Watch_serviceDesc = grpc.ServiceDesc{ func (m *Object) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1768,150 +1322,220 @@ func (m *Object) Marshal() (dAtA []byte, err error) { } func (m *Object) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Object) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.Object != nil { - nn1, err := m.Object.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.Object.Size() + i -= size + if _, err := m.Object.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn1 } - return i, nil + return len(dAtA) - i, nil } func (m *Object_Node) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Object_Node) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Node != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintWatch(dAtA, i, uint64(m.Node.Size())) - n2, err := m.Node.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Node.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWatch(dAtA, i, uint64(size)) } - i += n2 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Object_Service) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Object_Service) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Service != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintWatch(dAtA, i, uint64(m.Service.Size())) - n3, err := m.Service.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Service.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWatch(dAtA, i, uint64(size)) } - i += n3 + i-- + dAtA[i] = 0x12 } - return i, nil + return len(dAtA) - i, nil } func (m *Object_Network) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Object_Network) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Network != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintWatch(dAtA, i, uint64(m.Network.Size())) - n4, err := m.Network.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Network.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWatch(dAtA, i, uint64(size)) } - i += n4 + i-- + dAtA[i] = 0x1a } - return i, nil + return len(dAtA) - i, nil } func (m *Object_Task) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Object_Task) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Task != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintWatch(dAtA, i, uint64(m.Task.Size())) - n5, err := m.Task.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Task.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWatch(dAtA, i, uint64(size)) } - i += n5 + i-- + dAtA[i] = 0x22 } - return i, nil + return len(dAtA) - i, nil } func (m *Object_Cluster) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Object_Cluster) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Cluster != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintWatch(dAtA, i, uint64(m.Cluster.Size())) - n6, err := m.Cluster.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Cluster.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWatch(dAtA, i, uint64(size)) } - i += n6 + i-- + dAtA[i] = 0x2a } - return i, nil + return len(dAtA) - i, nil } func (m *Object_Secret) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Object_Secret) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Secret != nil { - dAtA[i] = 0x32 - i++ - i = encodeVarintWatch(dAtA, i, uint64(m.Secret.Size())) - n7, err := m.Secret.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Secret.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWatch(dAtA, i, uint64(size)) } - i += n7 + i-- + dAtA[i] = 0x32 } - return i, nil + return len(dAtA) - i, nil } func (m *Object_Resource) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Object_Resource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Resource != nil { - dAtA[i] = 0x3a - i++ - i = encodeVarintWatch(dAtA, i, uint64(m.Resource.Size())) - n8, err := m.Resource.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Resource.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWatch(dAtA, i, uint64(size)) } - i += n8 + i-- + dAtA[i] = 0x3a } - return i, nil + return len(dAtA) - i, nil } func (m *Object_Extension) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Object_Extension) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Extension != nil { - dAtA[i] = 0x42 - i++ - i = encodeVarintWatch(dAtA, i, uint64(m.Extension.Size())) - n9, err := m.Extension.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Extension.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWatch(dAtA, i, uint64(size)) } - i += n9 + i-- + dAtA[i] = 0x42 } - return i, nil + return len(dAtA) - i, nil } func (m *Object_Config) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Object_Config) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Config != nil { - dAtA[i] = 0x4a - i++ - i = encodeVarintWatch(dAtA, i, uint64(m.Config.Size())) - n10, err := m.Config.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Config.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWatch(dAtA, i, uint64(size)) } - i += n10 + i-- + dAtA[i] = 0x4a } - return i, nil + return len(dAtA) - i, nil } func (m *SelectBySlot) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1919,28 +1543,34 @@ func (m *SelectBySlot) Marshal() (dAtA []byte, err error) { } func (m *SelectBySlot) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SelectBySlot) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ServiceID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintWatch(dAtA, i, uint64(len(m.ServiceID))) - i += copy(dAtA[i:], m.ServiceID) - } if m.Slot != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintWatch(dAtA, i, uint64(m.Slot)) + i-- + dAtA[i] = 0x10 } - return i, nil + if len(m.ServiceID) > 0 { + i -= len(m.ServiceID) + copy(dAtA[i:], m.ServiceID) + i = encodeVarintWatch(dAtA, i, uint64(len(m.ServiceID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *SelectByCustom) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1948,35 +1578,43 @@ func (m *SelectByCustom) Marshal() (dAtA []byte, err error) { } func (m *SelectByCustom) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SelectByCustom) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Kind) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintWatch(dAtA, i, uint64(len(m.Kind))) - i += copy(dAtA[i:], m.Kind) + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintWatch(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x1a } if len(m.Index) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Index) + copy(dAtA[i:], m.Index) i = encodeVarintWatch(dAtA, i, uint64(len(m.Index))) - i += copy(dAtA[i:], m.Index) + i-- + dAtA[i] = 0x12 } - if len(m.Value) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintWatch(dAtA, i, uint64(len(m.Value))) - i += copy(dAtA[i:], m.Value) + if len(m.Kind) > 0 { + i -= len(m.Kind) + copy(dAtA[i:], m.Kind) + i = encodeVarintWatch(dAtA, i, uint64(len(m.Kind))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *SelectBy) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1984,169 +1622,272 @@ func (m *SelectBy) Marshal() (dAtA []byte, err error) { } func (m *SelectBy) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SelectBy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.By != nil { - nn11, err := m.By.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.By.Size() + i -= size + if _, err := m.By.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn11 } - return i, nil + return len(dAtA) - i, nil } func (m *SelectBy_ID) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0xa - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SelectBy_ID) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.ID) + copy(dAtA[i:], m.ID) i = encodeVarintWatch(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) - return i, nil + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *SelectBy_IDPrefix) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x12 - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SelectBy_IDPrefix) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.IDPrefix) + copy(dAtA[i:], m.IDPrefix) i = encodeVarintWatch(dAtA, i, uint64(len(m.IDPrefix))) - i += copy(dAtA[i:], m.IDPrefix) - return i, nil + i-- + dAtA[i] = 0x12 + return len(dAtA) - i, nil } func (m *SelectBy_Name) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x1a - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SelectBy_Name) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Name) + copy(dAtA[i:], m.Name) i = encodeVarintWatch(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - return i, nil + i-- + dAtA[i] = 0x1a + return len(dAtA) - i, nil } func (m *SelectBy_NamePrefix) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x22 - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SelectBy_NamePrefix) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.NamePrefix) + copy(dAtA[i:], m.NamePrefix) i = encodeVarintWatch(dAtA, i, uint64(len(m.NamePrefix))) - i += copy(dAtA[i:], m.NamePrefix) - return i, nil + i-- + dAtA[i] = 0x22 + return len(dAtA) - i, nil } func (m *SelectBy_Custom) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SelectBy_Custom) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Custom != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintWatch(dAtA, i, uint64(m.Custom.Size())) - n12, err := m.Custom.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Custom.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWatch(dAtA, i, uint64(size)) } - i += n12 + i-- + dAtA[i] = 0x2a } - return i, nil + return len(dAtA) - i, nil } func (m *SelectBy_CustomPrefix) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SelectBy_CustomPrefix) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.CustomPrefix != nil { - dAtA[i] = 0x32 - i++ - i = encodeVarintWatch(dAtA, i, uint64(m.CustomPrefix.Size())) - n13, err := m.CustomPrefix.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.CustomPrefix.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWatch(dAtA, i, uint64(size)) } - i += n13 + i-- + dAtA[i] = 0x32 } - return i, nil + return len(dAtA) - i, nil } func (m *SelectBy_ServiceID) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x3a - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SelectBy_ServiceID) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.ServiceID) + copy(dAtA[i:], m.ServiceID) i = encodeVarintWatch(dAtA, i, uint64(len(m.ServiceID))) - i += copy(dAtA[i:], m.ServiceID) - return i, nil + i-- + dAtA[i] = 0x3a + return len(dAtA) - i, nil } func (m *SelectBy_NodeID) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x42 - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SelectBy_NodeID) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.NodeID) + copy(dAtA[i:], m.NodeID) i = encodeVarintWatch(dAtA, i, uint64(len(m.NodeID))) - i += copy(dAtA[i:], m.NodeID) - return i, nil + i-- + dAtA[i] = 0x42 + return len(dAtA) - i, nil } func (m *SelectBy_Slot) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SelectBy_Slot) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Slot != nil { - dAtA[i] = 0x4a - i++ - i = encodeVarintWatch(dAtA, i, uint64(m.Slot.Size())) - n14, err := m.Slot.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Slot.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWatch(dAtA, i, uint64(size)) } - i += n14 + i-- + dAtA[i] = 0x4a } - return i, nil + return len(dAtA) - i, nil } func (m *SelectBy_DesiredState) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x50 - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SelectBy_DesiredState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) i = encodeVarintWatch(dAtA, i, uint64(m.DesiredState)) - return i, nil + i-- + dAtA[i] = 0x50 + return len(dAtA) - i, nil } func (m *SelectBy_Role) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x58 - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SelectBy_Role) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) i = encodeVarintWatch(dAtA, i, uint64(m.Role)) - return i, nil + i-- + dAtA[i] = 0x58 + return len(dAtA) - i, nil } func (m *SelectBy_Membership) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x60 - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SelectBy_Membership) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) i = encodeVarintWatch(dAtA, i, uint64(m.Membership)) - return i, nil + i-- + dAtA[i] = 0x60 + return len(dAtA) - i, nil } func (m *SelectBy_ReferencedNetworkID) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x6a - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SelectBy_ReferencedNetworkID) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.ReferencedNetworkID) + copy(dAtA[i:], m.ReferencedNetworkID) i = encodeVarintWatch(dAtA, i, uint64(len(m.ReferencedNetworkID))) - i += copy(dAtA[i:], m.ReferencedNetworkID) - return i, nil + i-- + dAtA[i] = 0x6a + return len(dAtA) - i, nil } func (m *SelectBy_ReferencedSecretID) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x72 - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SelectBy_ReferencedSecretID) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.ReferencedSecretID) + copy(dAtA[i:], m.ReferencedSecretID) i = encodeVarintWatch(dAtA, i, uint64(len(m.ReferencedSecretID))) - i += copy(dAtA[i:], m.ReferencedSecretID) - return i, nil + i-- + dAtA[i] = 0x72 + return len(dAtA) - i, nil } func (m *SelectBy_Kind) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x7a - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SelectBy_Kind) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Kind) + copy(dAtA[i:], m.Kind) i = encodeVarintWatch(dAtA, i, uint64(len(m.Kind))) - i += copy(dAtA[i:], m.Kind) - return i, nil + i-- + dAtA[i] = 0x7a + return len(dAtA) - i, nil } func (m *SelectBy_ReferencedConfigID) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x82 - i++ - dAtA[i] = 0x1 - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SelectBy_ReferencedConfigID) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.ReferencedConfigID) + copy(dAtA[i:], m.ReferencedConfigID) i = encodeVarintWatch(dAtA, i, uint64(len(m.ReferencedConfigID))) - i += copy(dAtA[i:], m.ReferencedConfigID) - return i, nil + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + return len(dAtA) - i, nil } func (m *WatchRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2154,49 +1895,58 @@ func (m *WatchRequest) Marshal() (dAtA []byte, err error) { } func (m *WatchRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WatchRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Entries) > 0 { - for _, msg := range m.Entries { - dAtA[i] = 0xa - i++ - i = encodeVarintWatch(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.ResumeFrom != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintWatch(dAtA, i, uint64(m.ResumeFrom.Size())) - n15, err := m.ResumeFrom.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n15 - } if m.IncludeOldObject { - dAtA[i] = 0x18 - i++ + i-- if m.IncludeOldObject { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x18 } - return i, nil + if m.ResumeFrom != nil { + { + size, err := m.ResumeFrom.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWatch(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Entries) > 0 { + for iNdEx := len(m.Entries) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Entries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWatch(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil } func (m *WatchRequest_WatchEntry) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2204,40 +1954,48 @@ func (m *WatchRequest_WatchEntry) Marshal() (dAtA []byte, err error) { } func (m *WatchRequest_WatchEntry) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WatchRequest_WatchEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Kind) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintWatch(dAtA, i, uint64(len(m.Kind))) - i += copy(dAtA[i:], m.Kind) - } - if m.Action != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintWatch(dAtA, i, uint64(m.Action)) - } if len(m.Filters) > 0 { - for _, msg := range m.Filters { - dAtA[i] = 0x1a - i++ - i = encodeVarintWatch(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Filters) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Filters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWatch(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x1a } } - return i, nil + if m.Action != 0 { + i = encodeVarintWatch(dAtA, i, uint64(m.Action)) + i-- + dAtA[i] = 0x10 + } + if len(m.Kind) > 0 { + i -= len(m.Kind) + copy(dAtA[i:], m.Kind) + i = encodeVarintWatch(dAtA, i, uint64(len(m.Kind))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *WatchMessage) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2245,39 +2003,48 @@ func (m *WatchMessage) Marshal() (dAtA []byte, err error) { } func (m *WatchMessage) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WatchMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Events) > 0 { - for _, msg := range m.Events { - dAtA[i] = 0xa - i++ - i = encodeVarintWatch(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + if m.Version != nil { + { + size, err := m.Version.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintWatch(dAtA, i, uint64(size)) } - } - if m.Version != nil { + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintWatch(dAtA, i, uint64(m.Version.Size())) - n16, err := m.Version.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n16 } - return i, nil + if len(m.Events) > 0 { + for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Events[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWatch(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil } func (m *WatchMessage_Event) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2285,46 +2052,57 @@ func (m *WatchMessage_Event) Marshal() (dAtA []byte, err error) { } func (m *WatchMessage_Event) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WatchMessage_Event) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Action != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintWatch(dAtA, i, uint64(m.Action)) + if m.OldObject != nil { + { + size, err := m.OldObject.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWatch(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a } if m.Object != nil { + { + size, err := m.Object.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWatch(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintWatch(dAtA, i, uint64(m.Object.Size())) - n17, err := m.Object.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n17 } - if m.OldObject != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintWatch(dAtA, i, uint64(m.OldObject.Size())) - n18, err := m.OldObject.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n18 + if m.Action != 0 { + i = encodeVarintWatch(dAtA, i, uint64(m.Action)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func encodeVarintWatch(dAtA []byte, offset int, v uint64) int { + offset -= sovWatch(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } type raftProxyWatchServer struct { @@ -2866,14 +2644,7 @@ func (m *WatchMessage_Event) Size() (n int) { } func sovWatch(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozWatch(x uint64) (n int) { return sovWatch(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -3175,8 +2946,13 @@ func (this *WatchRequest) String() string { if this == nil { return "nil" } + repeatedStringForEntries := "[]*WatchRequest_WatchEntry{" + for _, f := range this.Entries { + repeatedStringForEntries += strings.Replace(fmt.Sprintf("%v", f), "WatchRequest_WatchEntry", "WatchRequest_WatchEntry", 1) + "," + } + repeatedStringForEntries += "}" s := strings.Join([]string{`&WatchRequest{`, - `Entries:` + strings.Replace(fmt.Sprintf("%v", this.Entries), "WatchRequest_WatchEntry", "WatchRequest_WatchEntry", 1) + `,`, + `Entries:` + repeatedStringForEntries + `,`, `ResumeFrom:` + strings.Replace(fmt.Sprintf("%v", this.ResumeFrom), "Version", "Version", 1) + `,`, `IncludeOldObject:` + fmt.Sprintf("%v", this.IncludeOldObject) + `,`, `}`, @@ -3187,10 +2963,15 @@ func (this *WatchRequest_WatchEntry) String() string { if this == nil { return "nil" } + repeatedStringForFilters := "[]*SelectBy{" + for _, f := range this.Filters { + repeatedStringForFilters += strings.Replace(f.String(), "SelectBy", "SelectBy", 1) + "," + } + repeatedStringForFilters += "}" s := strings.Join([]string{`&WatchRequest_WatchEntry{`, `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`, `Action:` + fmt.Sprintf("%v", this.Action) + `,`, - `Filters:` + strings.Replace(fmt.Sprintf("%v", this.Filters), "SelectBy", "SelectBy", 1) + `,`, + `Filters:` + repeatedStringForFilters + `,`, `}`, }, "") return s @@ -3199,8 +2980,13 @@ func (this *WatchMessage) String() string { if this == nil { return "nil" } + repeatedStringForEvents := "[]*WatchMessage_Event{" + for _, f := range this.Events { + repeatedStringForEvents += strings.Replace(fmt.Sprintf("%v", f), "WatchMessage_Event", "WatchMessage_Event", 1) + "," + } + repeatedStringForEvents += "}" s := strings.Join([]string{`&WatchMessage{`, - `Events:` + strings.Replace(fmt.Sprintf("%v", this.Events), "WatchMessage_Event", "WatchMessage_Event", 1) + `,`, + `Events:` + repeatedStringForEvents + `,`, `Version:` + strings.Replace(fmt.Sprintf("%v", this.Version), "Version", "Version", 1) + `,`, `}`, }, "") @@ -3212,8 +2998,8 @@ func (this *WatchMessage_Event) String() string { } s := strings.Join([]string{`&WatchMessage_Event{`, `Action:` + fmt.Sprintf("%v", this.Action) + `,`, - `Object:` + strings.Replace(fmt.Sprintf("%v", this.Object), "Object", "Object", 1) + `,`, - `OldObject:` + strings.Replace(fmt.Sprintf("%v", this.OldObject), "Object", "Object", 1) + `,`, + `Object:` + strings.Replace(this.Object.String(), "Object", "Object", 1) + `,`, + `OldObject:` + strings.Replace(this.OldObject.String(), "Object", "Object", 1) + `,`, `}`, }, "") return s @@ -3576,10 +3362,7 @@ func (m *Object) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthWatch - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthWatch } if (iNdEx + skippy) > l { @@ -3680,10 +3463,7 @@ func (m *SelectBySlot) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthWatch - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthWatch } if (iNdEx + skippy) > l { @@ -3829,10 +3609,7 @@ func (m *SelectByCustom) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthWatch - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthWatch } if (iNdEx + skippy) > l { @@ -4367,10 +4144,7 @@ func (m *SelectBy) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthWatch - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthWatch } if (iNdEx + skippy) > l { @@ -4510,10 +4284,7 @@ func (m *WatchRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthWatch - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthWatch } if (iNdEx + skippy) > l { @@ -4648,10 +4419,7 @@ func (m *WatchRequest_WatchEntry) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthWatch - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthWatch } if (iNdEx + skippy) > l { @@ -4771,10 +4539,7 @@ func (m *WatchMessage) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthWatch - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthWatch } if (iNdEx + skippy) > l { @@ -4915,10 +4680,7 @@ func (m *WatchMessage_Event) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthWatch - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthWatch } if (iNdEx + skippy) > l { @@ -4936,6 +4698,7 @@ func (m *WatchMessage_Event) Unmarshal(dAtA []byte) error { func skipWatch(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -4967,10 +4730,8 @@ func skipWatch(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -4991,55 +4752,30 @@ func skipWatch(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthWatch } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthWatch - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowWatch - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipWatch(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthWatch - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupWatch + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthWatch + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthWatch = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowWatch = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthWatch = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowWatch = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupWatch = fmt.Errorf("proto: unexpected end of group") ) diff --git a/vendor/github.com/docker/swarmkit/protobuf/plugin/plugin.pb.go b/vendor/github.com/docker/swarmkit/protobuf/plugin/plugin.pb.go index 5923859722..1ff8cdc382 100644 --- a/vendor/github.com/docker/swarmkit/protobuf/plugin/plugin.pb.go +++ b/vendor/github.com/docker/swarmkit/protobuf/plugin/plugin.pb.go @@ -11,6 +11,7 @@ import ( descriptor "github.com/gogo/protobuf/protoc-gen-gogo/descriptor" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" ) @@ -24,7 +25,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type WatchSelectors struct { // supported by all object types @@ -59,7 +60,7 @@ func (m *WatchSelectors) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return xxx_messageInfo_WatchSelectors.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -95,7 +96,7 @@ func (m *StoreObject) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_StoreObject.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -136,7 +137,7 @@ func (m *TLSAuthorization) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_TLSAuthorization.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -293,7 +294,7 @@ func (m *TLSAuthorization) CopyFrom(src interface{}) { func (m *WatchSelectors) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -301,147 +302,152 @@ func (m *WatchSelectors) Marshal() (dAtA []byte, err error) { } func (m *WatchSelectors) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WatchSelectors) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.ID != nil { - dAtA[i] = 0x8 - i++ - if *m.ID { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.IDPrefix != nil { - dAtA[i] = 0x10 - i++ - if *m.IDPrefix { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.Name != nil { - dAtA[i] = 0x18 - i++ - if *m.Name { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.NamePrefix != nil { - dAtA[i] = 0x20 - i++ - if *m.NamePrefix { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.Custom != nil { - dAtA[i] = 0x28 - i++ - if *m.Custom { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.CustomPrefix != nil { - dAtA[i] = 0x30 - i++ - if *m.CustomPrefix { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.ServiceID != nil { - dAtA[i] = 0x38 - i++ - if *m.ServiceID { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.NodeID != nil { - dAtA[i] = 0x40 - i++ - if *m.NodeID { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.Slot != nil { - dAtA[i] = 0x48 - i++ - if *m.Slot { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.DesiredState != nil { - dAtA[i] = 0x50 - i++ - if *m.DesiredState { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.Role != nil { - dAtA[i] = 0x58 - i++ - if *m.Role { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.Membership != nil { - dAtA[i] = 0x60 - i++ - if *m.Membership { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } if m.Kind != nil { - dAtA[i] = 0x68 - i++ + i-- if *m.Kind { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x68 } - return i, nil + if m.Membership != nil { + i-- + if *m.Membership { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x60 + } + if m.Role != nil { + i-- + if *m.Role { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x58 + } + if m.DesiredState != nil { + i-- + if *m.DesiredState { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x50 + } + if m.Slot != nil { + i-- + if *m.Slot { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x48 + } + if m.NodeID != nil { + i-- + if *m.NodeID { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + } + if m.ServiceID != nil { + i-- + if *m.ServiceID { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + } + if m.CustomPrefix != nil { + i-- + if *m.CustomPrefix { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if m.Custom != nil { + i-- + if *m.Custom { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if m.NamePrefix != nil { + i-- + if *m.NamePrefix { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if m.Name != nil { + i-- + if *m.Name { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if m.IDPrefix != nil { + i-- + if *m.IDPrefix { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if m.ID != nil { + i-- + if *m.ID { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *StoreObject) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -449,29 +455,36 @@ func (m *StoreObject) Marshal() (dAtA []byte, err error) { } func (m *StoreObject) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StoreObject) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.WatchSelectors == nil { return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("watch_selectors") } else { - dAtA[i] = 0xa - i++ - i = encodeVarintPlugin(dAtA, i, uint64(m.WatchSelectors.Size())) - n1, err := m.WatchSelectors.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.WatchSelectors.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintPlugin(dAtA, i, uint64(size)) } - i += n1 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *TLSAuthorization) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -479,46 +492,47 @@ func (m *TLSAuthorization) Marshal() (dAtA []byte, err error) { } func (m *TLSAuthorization) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TLSAuthorization) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Roles) > 0 { - for _, s := range m.Roles { - dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } if m.Insecure != nil { - dAtA[i] = 0x10 - i++ + i-- if *m.Insecure { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x10 } - return i, nil + if len(m.Roles) > 0 { + for iNdEx := len(m.Roles) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Roles[iNdEx]) + copy(dAtA[i:], m.Roles[iNdEx]) + i = encodeVarintPlugin(dAtA, i, uint64(len(m.Roles[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil } func encodeVarintPlugin(dAtA []byte, offset int, v uint64) int { + offset -= sovPlugin(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *WatchSelectors) Size() (n int) { if m == nil { @@ -600,14 +614,7 @@ func (m *TLSAuthorization) Size() (n int) { } func sovPlugin(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozPlugin(x uint64) (n int) { return sovPlugin(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -639,7 +646,7 @@ func (this *StoreObject) String() string { return "nil" } s := strings.Join([]string{`&StoreObject{`, - `WatchSelectors:` + strings.Replace(fmt.Sprintf("%v", this.WatchSelectors), "WatchSelectors", "WatchSelectors", 1) + `,`, + `WatchSelectors:` + strings.Replace(this.WatchSelectors.String(), "WatchSelectors", "WatchSelectors", 1) + `,`, `}`, }, "") return s @@ -971,10 +978,7 @@ func (m *WatchSelectors) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthPlugin - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthPlugin } if (iNdEx + skippy) > l { @@ -1062,10 +1066,7 @@ func (m *StoreObject) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthPlugin - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthPlugin } if (iNdEx + skippy) > l { @@ -1171,10 +1172,7 @@ func (m *TLSAuthorization) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthPlugin - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthPlugin } if (iNdEx + skippy) > l { @@ -1192,6 +1190,7 @@ func (m *TLSAuthorization) Unmarshal(dAtA []byte) error { func skipPlugin(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -1223,10 +1222,8 @@ func skipPlugin(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -1247,55 +1244,30 @@ func skipPlugin(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthPlugin } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthPlugin - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowPlugin - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipPlugin(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthPlugin - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupPlugin + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthPlugin + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthPlugin = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowPlugin = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthPlugin = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowPlugin = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupPlugin = fmt.Errorf("proto: unexpected end of group") ) diff --git a/vendor/github.com/docker/swarmkit/vendor.conf b/vendor/github.com/docker/swarmkit/vendor.conf index 1220bc9f1e..e1c8214a7b 100644 --- a/vendor/github.com/docker/swarmkit/vendor.conf +++ b/vendor/github.com/docker/swarmkit/vendor.conf @@ -8,69 +8,72 @@ # In >=1.11, those errors were brought back but the string had changed again. # After updating GRPC, if integration test failures occur, verify that the # string matching there is correct. -google.golang.org/grpc 25c4f928eaa6d96443009bd842389fb4fa48664e # v1.20.1 -github.com/gogo/protobuf ba06b47c162d49f2af050fb4c75bcbc86a159d5c # v1.2.1 -github.com/golang/protobuf aa810b61a9c79d51363740d207bb46cf8e620ed5 # v1.2.0 -github.com/matttproud/golang_protobuf_extensions c12348ce28de40eed0136aa2b644d0ee0650e56c # v1.0.1 -google.golang.org/genproto 694d95ba50e67b2e363f3483057db5d4910c18f9 +google.golang.org/grpc f495f5b15ae7ccda3b38c53a1bfcde4c1a58a2bc # v1.27.1 +github.com/gogo/protobuf b03c65ea87cdc3521ede29f62fe3ce239267c1bc # v1.3.2 +github.com/golang/protobuf 84668698ea25b64748563aa20726db66a6b8d299 # v1.3.5 +github.com/matttproud/golang_protobuf_extensions c12348ce28de40eed0136aa2b644d0ee0650e56c # v1.0.1 +google.golang.org/genproto 3f1135a288c9a07e340ae8ba4cc6c7065a3160e8 # metrics -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 -github.com/docker/go-metrics d466d4f6fd960e01820085bd7e1a24426ee7ef18 +github.com/grpc-ecosystem/go-grpc-prometheus c225b8c3b01faf2899099b768856a9e916e5087b # v1.2.0 +github.com/docker/go-metrics b619b3592b65de4f087d9f16863a7e6ff905973c # v0.0.1 # etcd/raft -github.com/coreos/etcd d57e8b8d97adfc4a6c224fe116714bf1a1f3beb9 # v3.3.12 -github.com/coreos/go-systemd v17 -github.com/coreos/pkg v3 -github.com/prometheus/client_golang v0.8.0 -github.com/prometheus/client_model 6f3806018612930941127f2a7c6c453ba2c527d2 -github.com/prometheus/common 7600349dcfe1abd18d72d3a1770870d9800a7801 -github.com/prometheus/procfs 7d6f385de8bea29190f15ba9931442a0eaef9af7 +github.com/coreos/etcd 2c834459e1aab78a5d5219c7dfe42335fc4b617a # v3.3.25 -github.com/docker/distribution 0d3efadf0154c2b8a4e7b6621fff9809655cc580 -github.com/docker/docker 827cb09f87964ed38b46502f22a585f2ed4a78e1 -github.com/docker/go-connections 7395e3f8aa162843a74ed6d48e79627d9792ac55 # v0.4.0 -github.com/docker/go-events 9461782956ad83b30282bf90e31fa6a70c255ba9 -github.com/docker/go-units 519db1ee28dcc9fd2474ae59fca29a810482bfb1 # v0.4.0 -github.com/docker/libkv 458977154600b9f23984d9f4b82e79570b5ae12b -github.com/docker/libnetwork 09cdcc8c0eab3946c2d70e8f6225b05baf1e90d1 -github.com/opencontainers/runc 425e105d5a03fabd737a126ad93d62a9eeede87f # v1.0.0-rc8 -github.com/opencontainers/go-digest v1.0.0-rc1 -github.com/opencontainers/image-spec v1.0.1 -github.com/ishidawataru/sctp 6e2cb1366111dcf547c13531e3a263a067715847 +# go-systemd v17 is required by github.com/coreos/pkg/capnslog/journald_formatter.go +github.com/coreos/go-systemd 39ca1b05acc7ad1220e09f133283b8859a8b71ab # v17 +github.com/coreos/pkg 97fdf19511ea361ae1c100dd393cc47f8dcfa1e1 # v4 +github.com/prometheus/client_golang 6edbbd9e560190e318cdc5b4d3e630b442858380 # v1.6.0 +github.com/prometheus/client_model 7bc5445566f0fe75b15de23e6b93886e982d7bf9 # v0.2.0 +github.com/prometheus/common d978bcb1309602d68bb4ba69cf3f8ed900e07308 # v0.9.1 +github.com/prometheus/procfs 46159f73e74d1cb8dc223deef9b2d049286f46b1 # v0.0.11 +github.com/cespare/xxhash/v2 d7df74196a9e781ede915320c11c378c1b2f3a1f # v2.1.1 -github.com/davecgh/go-spew 8991bc29aa16c548c550c7ff78260e27b9ab7c73 # v1.1.1 -github.com/Microsoft/go-winio 6c72808b55902eae4c5943626030429ff20f3b63 # v0.4.14 -github.com/sirupsen/logrus 8bdbc7bcc01dcbb8ec23dc8a28e332258d25251f # v1.4.1 -github.com/beorn7/perks 37c8de3658fcb183f997c4e13e8337516ab753e6 # v1.0.1 -github.com/cloudflare/cfssl 1.3.2 -github.com/dustin/go-humanize 9f541cc9db5d55bce703bd99987c9d5cb8eea45e # v1.0.0 -github.com/fernet/fernet-go 9eac43b88a5efb8651d24de9b68e87567e029736 -github.com/google/certificate-transparency-go v1.0.20 -github.com/hashicorp/go-immutable-radix 826af9ccf0feeee615d546d69b11f8e98da8c8f1 git://github.com/tonistiigi/go-immutable-radix.git -github.com/hashicorp/go-memdb cb9a474f84cc5e41b273b20c6927680b2a8776ad -github.com/hashicorp/golang-lru 7087cb70de9f7a8bc0a10c375cb0d2280a8edf9c # v0.5.1 -github.com/inconshreveable/mousetrap 76626ae9c91c4f2a10f34cad8ce83ea42c93bb75 -github.com/phayes/permbits f7e3ac5e859d0b919c5068d581cc4c5d4f4f9bc5 -code.cloudfoundry.org/clock 02e53af36e6c978af692887ed449b74026d76fec -github.com/pkg/errors ba968bfe8b2f7e042a574c888954fccecfa385b4 # v0.8.1 -github.com/pmezard/go-difflib 792786c7400a136282c1664665ae0a8db921c6c2 # v1.0.0 -github.com/rcrowley/go-metrics 51425a2415d21afadfd55cd93432c0bc69e9598d -github.com/spf13/cobra 8e91712f174ced10270cf66615e0a9127e7c4de5 -github.com/spf13/pflag 7f60f83a2c81bc3c3c0d5297f61ddfa68da9d3b7 -github.com/stretchr/testify ffdc059bfe9ce6a4e144ba849dbedead332c6053 # v1.3.0 -go.etcd.io/bbolt a0458a2b35708eef59eb5f620ceb3cd1c01a824d # v1.3.3 -golang.org/x/crypto 88737f569e3a9c7ab309cdc09a07fe7fc87233c3 -golang.org/x/net f3200d17e092c607f615320ecaad13d87ad9a2b3 -golang.org/x/sys 9eafafc0a87e0fd0aeeba439a4573537970c44c7 -golang.org/x/text f21a4dfb5e38f5895301dc265a8def02365cc3d0 # v0.3.0 -golang.org/x/time fbb02b2291d28baffd63558aa44b4b56f178d650 +github.com/docker/distribution 0d3efadf0154c2b8a4e7b6621fff9809655cc580 +github.com/docker/docker 0ad2293d0e5bbf4c966a0e8b27c3ac3835265577 # master / v21.xx-dev +github.com/docker/go-connections 7395e3f8aa162843a74ed6d48e79627d9792ac55 # v0.4.0 +github.com/docker/go-events e31b211e4f1cd09aa76fe4ac244571fab96ae47f +github.com/docker/go-units 519db1ee28dcc9fd2474ae59fca29a810482bfb1 # v0.4.0 +github.com/docker/libkv 458977154600b9f23984d9f4b82e79570b5ae12b +github.com/opencontainers/runc b9ee9c6314599f1b4a7f497e1f1f856fe433d3b7 # v1.0.0-rc95 +github.com/opencontainers/go-digest ea51bea511f75cfa3ef6098cc253c5c3609b037a # v1.0.0 +github.com/opencontainers/image-spec d60099175f88c47cd379c4738d158884749ed235 # v1.0.1 +github.com/ishidawataru/sctp f2269e66cdee387bd321445d5d300893449805be +github.com/containerd/containerd 36cc874494a56a253cd181a1a685b44b58a2e34a # v1.5.2 + +github.com/davecgh/go-spew 8991bc29aa16c548c550c7ff78260e27b9ab7c73 # v1.1.1 +github.com/Microsoft/go-winio 5b44b70ab3ab4d291a7c1d28afe7b4afeced0ed4 # v0.4.15 +github.com/sirupsen/logrus 6699a89a232f3db797f2e280639854bbc4b89725 # v1.7.0 +github.com/beorn7/perks 37c8de3658fcb183f997c4e13e8337516ab753e6 # v1.0.1 +github.com/cloudflare/cfssl 5d63dbd981b5c408effbb58c442d54761ff94fbd # 1.3.2 +github.com/dustin/go-humanize 9f541cc9db5d55bce703bd99987c9d5cb8eea45e # v1.0.0 +github.com/fernet/fernet-go 9eac43b88a5efb8651d24de9b68e87567e029736 +github.com/google/certificate-transparency-go 37a384cd035e722ea46e55029093e26687138edf # v1.0.20 +github.com/hashicorp/go-immutable-radix 826af9ccf0feeee615d546d69b11f8e98da8c8f1 git://github.com/tonistiigi/go-immutable-radix.git +github.com/hashicorp/go-memdb cb9a474f84cc5e41b273b20c6927680b2a8776ad +github.com/hashicorp/golang-lru 7f827b33c0f158ec5dfbba01bb0b14a4541fd81d # v0.5.3 +github.com/inconshreveable/mousetrap 76626ae9c91c4f2a10f34cad8ce83ea42c93bb75 # v1.0.0 +github.com/phayes/permbits f7e3ac5e859d0b919c5068d581cc4c5d4f4f9bc5 +code.cloudfoundry.org/clock 02e53af36e6c978af692887ed449b74026d76fec # v1.0.0 +github.com/pkg/errors 614d223910a179a466c1767a985424175c39b465 # v0.9.1 +github.com/pmezard/go-difflib 792786c7400a136282c1664665ae0a8db921c6c2 # v1.0.0 +github.com/rcrowley/go-metrics 51425a2415d21afadfd55cd93432c0bc69e9598d +github.com/spf13/cobra 8380ddd3132bdf8fd77731725b550c181dda0aa8 # v1.1.3 +github.com/spf13/pflag 2e9d26c8c37aae03e3f9d4e90b7116f5accb7cab # v1.0.5 +github.com/stretchr/testify ffdc059bfe9ce6a4e144ba849dbedead332c6053 # v1.3.0 +go.etcd.io/bbolt 232d8fc87f50244f9c808f4745759e08a304c029 # v1.3.5 +golang.org/x/crypto c1f2f97bffc9c53fc40a1a28a5b460094c0050d9 +golang.org/x/net 6772e930b67bb09bf22262c7378e7d2f67cf59d1 +golang.org/x/sys d19ff857e887eacb631721f188c7d365c2331456 +golang.org/x/text 23ae387dee1f90d29a23c0e87ee0b46038fbed0e # v0.3.3 +golang.org/x/time 555d28b269f0569763d25dbe1a237ae74c6bcc82 # ginkgo is used for testing in some places in the code. this is it and its # sub-dependencies. -github.com/onsi/ginkgo v1.8.0 -github.com/onsi/gomega v1.5.0 -gopkg.in/yaml.v2 v2.2.1 -github.com/hpcloud/tail v1.0.0 -gopkg.in/fsnotify.v1 v1.4.7 -gopkg.in/tomb.v1 v1 +github.com/onsi/ginkgo eea6ad008b96acdaa524f5b409513bf062b500ad # v1.8.0 +github.com/onsi/gomega 90e289841c1ed79b7a598a7cd9959750cb5e89e2 # v1.5.0 +gopkg.in/yaml.v2 7649d4548cb53a614db133b2a8ac1f31859dda8c # v2.4.0 +github.com/hpcloud/tail a30252cb686a21eb2d0b98132633053ec2f7f1e5 # v1.0.0 +gopkg.in/fsnotify.v1 c2828203cd70a50dcccfb2761f8b1f8ceef9a8e9 # v1.4.7 +gopkg.in/tomb.v1 dd632973f1e7218eb1089048e0798ec9ae7dceb8 # v1