gitee.com/lh-her-team/common@v1.5.1/shardingbirdsnest/pb/serialize.pb.go (about)

     1  // Code generated by protoc-gen-gogo. DO NOT EDIT.
     2  // source: serialize.proto
     3  
     4  package pb
     5  
     6  import (
     7  	fmt "fmt"
     8  	io "io"
     9  	math "math"
    10  	math_bits "math/bits"
    11  
    12  	proto "github.com/gogo/protobuf/proto"
    13  )
    14  
    15  // Reference imports to suppress errors if they are not otherwise used.
    16  var _ = proto.Marshal
    17  var _ = fmt.Errorf
    18  var _ = math.Inf
    19  
    20  // This is a compile-time assertion to ensure that this generated file
    21  // is compatible with the proto package it is being compiled against.
    22  // A compilation error at this line likely means your copy of the
    23  // proto package needs to be updated.
    24  const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
    25  
    26  // Sharding Bird's Nest
    27  type ShardingBirdsNest struct {
    28  	Length uint32 `protobuf:"varint,1,opt,name=length,proto3" json:"length,omitempty"`
    29  	// The final height
    30  	Height uint64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"`
    31  	// Bird's Nest config
    32  	Config []byte `protobuf:"bytes,3,opt,name=config,proto3" json:"config,omitempty"`
    33  }
    34  
    35  func (m *ShardingBirdsNest) Reset()         { *m = ShardingBirdsNest{} }
    36  func (m *ShardingBirdsNest) String() string { return proto.CompactTextString(m) }
    37  func (*ShardingBirdsNest) ProtoMessage()    {}
    38  func (*ShardingBirdsNest) Descriptor() ([]byte, []int) {
    39  	return fileDescriptor_f1a7c2bf0e2dbbf4, []int{0}
    40  }
    41  func (m *ShardingBirdsNest) XXX_Unmarshal(b []byte) error {
    42  	return m.Unmarshal(b)
    43  }
    44  func (m *ShardingBirdsNest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
    45  	if deterministic {
    46  		return xxx_messageInfo_ShardingBirdsNest.Marshal(b, m, deterministic)
    47  	} else {
    48  		b = b[:cap(b)]
    49  		n, err := m.MarshalToSizedBuffer(b)
    50  		if err != nil {
    51  			return nil, err
    52  		}
    53  		return b[:n], nil
    54  	}
    55  }
    56  func (m *ShardingBirdsNest) XXX_Merge(src proto.Message) {
    57  	xxx_messageInfo_ShardingBirdsNest.Merge(m, src)
    58  }
    59  func (m *ShardingBirdsNest) XXX_Size() int {
    60  	return m.Size()
    61  }
    62  func (m *ShardingBirdsNest) XXX_DiscardUnknown() {
    63  	xxx_messageInfo_ShardingBirdsNest.DiscardUnknown(m)
    64  }
    65  
    66  var xxx_messageInfo_ShardingBirdsNest proto.InternalMessageInfo
    67  
    68  func (m *ShardingBirdsNest) GetLength() uint32 {
    69  	if m != nil {
    70  		return m.Length
    71  	}
    72  	return 0
    73  }
    74  
    75  func (m *ShardingBirdsNest) GetHeight() uint64 {
    76  	if m != nil {
    77  		return m.Height
    78  	}
    79  	return 0
    80  }
    81  
    82  func (m *ShardingBirdsNest) GetConfig() []byte {
    83  	if m != nil {
    84  		return m.Config
    85  	}
    86  	return nil
    87  }
    88  
    89  func init() {
    90  	proto.RegisterType((*ShardingBirdsNest)(nil), "pb.ShardingBirdsNest")
    91  }
    92  
    93  func init() { proto.RegisterFile("serialize.proto", fileDescriptor_f1a7c2bf0e2dbbf4) }
    94  
    95  var fileDescriptor_f1a7c2bf0e2dbbf4 = []byte{
    96  	// 151 bytes of a gzipped FileDescriptorProto
    97  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2f, 0x4e, 0x2d, 0xca,
    98  	0x4c, 0xcc, 0xc9, 0xac, 0x4a, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x2a, 0x48, 0x52,
    99  	0x8a, 0xe6, 0x12, 0x0c, 0xce, 0x48, 0x2c, 0x4a, 0xc9, 0xcc, 0x4b, 0x77, 0xca, 0x2c, 0x4a, 0x29,
   100  	0xf6, 0x4b, 0x2d, 0x2e, 0x11, 0x12, 0xe3, 0x62, 0xcb, 0x49, 0xcd, 0x4b, 0x2f, 0xc9, 0x90, 0x60,
   101  	0x54, 0x60, 0xd4, 0xe0, 0x0d, 0x82, 0xf2, 0x40, 0xe2, 0x19, 0xa9, 0x99, 0xe9, 0x19, 0x25, 0x12,
   102  	0x4c, 0x0a, 0x8c, 0x1a, 0x2c, 0x41, 0x50, 0x1e, 0x48, 0x3c, 0x39, 0x3f, 0x2f, 0x2d, 0x33, 0x5d,
   103  	0x82, 0x59, 0x81, 0x51, 0x83, 0x27, 0x08, 0xca, 0x73, 0x92, 0x38, 0xf1, 0x48, 0x8e, 0xf1, 0xc2,
   104  	0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1,
   105  	0xc6, 0x63, 0x39, 0x86, 0x24, 0x36, 0xb0, 0x0b, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x08,
   106  	0x7a, 0x63, 0x5f, 0x94, 0x00, 0x00, 0x00,
   107  }
   108  
   109  func (m *ShardingBirdsNest) Marshal() (dAtA []byte, err error) {
   110  	size := m.Size()
   111  	dAtA = make([]byte, size)
   112  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   113  	if err != nil {
   114  		return nil, err
   115  	}
   116  	return dAtA[:n], nil
   117  }
   118  
   119  func (m *ShardingBirdsNest) MarshalTo(dAtA []byte) (int, error) {
   120  	size := m.Size()
   121  	return m.MarshalToSizedBuffer(dAtA[:size])
   122  }
   123  
   124  func (m *ShardingBirdsNest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   125  	i := len(dAtA)
   126  	_ = i
   127  	var l int
   128  	_ = l
   129  	if len(m.Config) > 0 {
   130  		i -= len(m.Config)
   131  		copy(dAtA[i:], m.Config)
   132  		i = encodeVarintSerialize(dAtA, i, uint64(len(m.Config)))
   133  		i--
   134  		dAtA[i] = 0x1a
   135  	}
   136  	if m.Height != 0 {
   137  		i = encodeVarintSerialize(dAtA, i, uint64(m.Height))
   138  		i--
   139  		dAtA[i] = 0x10
   140  	}
   141  	if m.Length != 0 {
   142  		i = encodeVarintSerialize(dAtA, i, uint64(m.Length))
   143  		i--
   144  		dAtA[i] = 0x8
   145  	}
   146  	return len(dAtA) - i, nil
   147  }
   148  
   149  func encodeVarintSerialize(dAtA []byte, offset int, v uint64) int {
   150  	offset -= sovSerialize(v)
   151  	base := offset
   152  	for v >= 1<<7 {
   153  		dAtA[offset] = uint8(v&0x7f | 0x80)
   154  		v >>= 7
   155  		offset++
   156  	}
   157  	dAtA[offset] = uint8(v)
   158  	return base
   159  }
   160  func (m *ShardingBirdsNest) Size() (n int) {
   161  	if m == nil {
   162  		return 0
   163  	}
   164  	var l int
   165  	_ = l
   166  	if m.Length != 0 {
   167  		n += 1 + sovSerialize(uint64(m.Length))
   168  	}
   169  	if m.Height != 0 {
   170  		n += 1 + sovSerialize(uint64(m.Height))
   171  	}
   172  	l = len(m.Config)
   173  	if l > 0 {
   174  		n += 1 + l + sovSerialize(uint64(l))
   175  	}
   176  	return n
   177  }
   178  
   179  func sovSerialize(x uint64) (n int) {
   180  	return (math_bits.Len64(x|1) + 6) / 7
   181  }
   182  func sozSerialize(x uint64) (n int) {
   183  	return sovSerialize(uint64((x << 1) ^ uint64((int64(x) >> 63))))
   184  }
   185  func (m *ShardingBirdsNest) Unmarshal(dAtA []byte) error {
   186  	l := len(dAtA)
   187  	iNdEx := 0
   188  	for iNdEx < l {
   189  		preIndex := iNdEx
   190  		var wire uint64
   191  		for shift := uint(0); ; shift += 7 {
   192  			if shift >= 64 {
   193  				return ErrIntOverflowSerialize
   194  			}
   195  			if iNdEx >= l {
   196  				return io.ErrUnexpectedEOF
   197  			}
   198  			b := dAtA[iNdEx]
   199  			iNdEx++
   200  			wire |= uint64(b&0x7F) << shift
   201  			if b < 0x80 {
   202  				break
   203  			}
   204  		}
   205  		fieldNum := int32(wire >> 3)
   206  		wireType := int(wire & 0x7)
   207  		if wireType == 4 {
   208  			return fmt.Errorf("proto: ShardingBirdsNest: wiretype end group for non-group")
   209  		}
   210  		if fieldNum <= 0 {
   211  			return fmt.Errorf("proto: ShardingBirdsNest: illegal tag %d (wire type %d)", fieldNum, wire)
   212  		}
   213  		switch fieldNum {
   214  		case 1:
   215  			if wireType != 0 {
   216  				return fmt.Errorf("proto: wrong wireType = %d for field Length", wireType)
   217  			}
   218  			m.Length = 0
   219  			for shift := uint(0); ; shift += 7 {
   220  				if shift >= 64 {
   221  					return ErrIntOverflowSerialize
   222  				}
   223  				if iNdEx >= l {
   224  					return io.ErrUnexpectedEOF
   225  				}
   226  				b := dAtA[iNdEx]
   227  				iNdEx++
   228  				m.Length |= uint32(b&0x7F) << shift
   229  				if b < 0x80 {
   230  					break
   231  				}
   232  			}
   233  		case 2:
   234  			if wireType != 0 {
   235  				return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType)
   236  			}
   237  			m.Height = 0
   238  			for shift := uint(0); ; shift += 7 {
   239  				if shift >= 64 {
   240  					return ErrIntOverflowSerialize
   241  				}
   242  				if iNdEx >= l {
   243  					return io.ErrUnexpectedEOF
   244  				}
   245  				b := dAtA[iNdEx]
   246  				iNdEx++
   247  				m.Height |= uint64(b&0x7F) << shift
   248  				if b < 0x80 {
   249  					break
   250  				}
   251  			}
   252  		case 3:
   253  			if wireType != 2 {
   254  				return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType)
   255  			}
   256  			var byteLen int
   257  			for shift := uint(0); ; shift += 7 {
   258  				if shift >= 64 {
   259  					return ErrIntOverflowSerialize
   260  				}
   261  				if iNdEx >= l {
   262  					return io.ErrUnexpectedEOF
   263  				}
   264  				b := dAtA[iNdEx]
   265  				iNdEx++
   266  				byteLen |= int(b&0x7F) << shift
   267  				if b < 0x80 {
   268  					break
   269  				}
   270  			}
   271  			if byteLen < 0 {
   272  				return ErrInvalidLengthSerialize
   273  			}
   274  			postIndex := iNdEx + byteLen
   275  			if postIndex < 0 {
   276  				return ErrInvalidLengthSerialize
   277  			}
   278  			if postIndex > l {
   279  				return io.ErrUnexpectedEOF
   280  			}
   281  			m.Config = append(m.Config[:0], dAtA[iNdEx:postIndex]...)
   282  			if m.Config == nil {
   283  				m.Config = []byte{}
   284  			}
   285  			iNdEx = postIndex
   286  		default:
   287  			iNdEx = preIndex
   288  			skippy, err := skipSerialize(dAtA[iNdEx:])
   289  			if err != nil {
   290  				return err
   291  			}
   292  			if (skippy < 0) || (iNdEx+skippy) < 0 {
   293  				return ErrInvalidLengthSerialize
   294  			}
   295  			if (iNdEx + skippy) > l {
   296  				return io.ErrUnexpectedEOF
   297  			}
   298  			iNdEx += skippy
   299  		}
   300  	}
   301  
   302  	if iNdEx > l {
   303  		return io.ErrUnexpectedEOF
   304  	}
   305  	return nil
   306  }
   307  func skipSerialize(dAtA []byte) (n int, err error) {
   308  	l := len(dAtA)
   309  	iNdEx := 0
   310  	depth := 0
   311  	for iNdEx < l {
   312  		var wire uint64
   313  		for shift := uint(0); ; shift += 7 {
   314  			if shift >= 64 {
   315  				return 0, ErrIntOverflowSerialize
   316  			}
   317  			if iNdEx >= l {
   318  				return 0, io.ErrUnexpectedEOF
   319  			}
   320  			b := dAtA[iNdEx]
   321  			iNdEx++
   322  			wire |= (uint64(b) & 0x7F) << shift
   323  			if b < 0x80 {
   324  				break
   325  			}
   326  		}
   327  		wireType := int(wire & 0x7)
   328  		switch wireType {
   329  		case 0:
   330  			for shift := uint(0); ; shift += 7 {
   331  				if shift >= 64 {
   332  					return 0, ErrIntOverflowSerialize
   333  				}
   334  				if iNdEx >= l {
   335  					return 0, io.ErrUnexpectedEOF
   336  				}
   337  				iNdEx++
   338  				if dAtA[iNdEx-1] < 0x80 {
   339  					break
   340  				}
   341  			}
   342  		case 1:
   343  			iNdEx += 8
   344  		case 2:
   345  			var length int
   346  			for shift := uint(0); ; shift += 7 {
   347  				if shift >= 64 {
   348  					return 0, ErrIntOverflowSerialize
   349  				}
   350  				if iNdEx >= l {
   351  					return 0, io.ErrUnexpectedEOF
   352  				}
   353  				b := dAtA[iNdEx]
   354  				iNdEx++
   355  				length |= (int(b) & 0x7F) << shift
   356  				if b < 0x80 {
   357  					break
   358  				}
   359  			}
   360  			if length < 0 {
   361  				return 0, ErrInvalidLengthSerialize
   362  			}
   363  			iNdEx += length
   364  		case 3:
   365  			depth++
   366  		case 4:
   367  			if depth == 0 {
   368  				return 0, ErrUnexpectedEndOfGroupSerialize
   369  			}
   370  			depth--
   371  		case 5:
   372  			iNdEx += 4
   373  		default:
   374  			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
   375  		}
   376  		if iNdEx < 0 {
   377  			return 0, ErrInvalidLengthSerialize
   378  		}
   379  		if depth == 0 {
   380  			return iNdEx, nil
   381  		}
   382  	}
   383  	return 0, io.ErrUnexpectedEOF
   384  }
   385  
   386  var (
   387  	ErrInvalidLengthSerialize        = fmt.Errorf("proto: negative length found during unmarshaling")
   388  	ErrIntOverflowSerialize          = fmt.Errorf("proto: integer overflow")
   389  	ErrUnexpectedEndOfGroupSerialize = fmt.Errorf("proto: unexpected end of group")
   390  )