github.com/cockroachdb/errors@v1.11.1/errbase/internal/unknown.pb.go (about)

     1  // Code generated by protoc-gen-gogo. DO NOT EDIT.
     2  // source: errbase/internal/unknown.proto
     3  
     4  package internal
     5  
     6  import (
     7  	fmt "fmt"
     8  	proto "github.com/gogo/protobuf/proto"
     9  	io "io"
    10  	math "math"
    11  	math_bits "math/bits"
    12  )
    13  
    14  // Reference imports to suppress errors if they are not otherwise used.
    15  var _ = proto.Marshal
    16  var _ = fmt.Errorf
    17  var _ = math.Inf
    18  
    19  // This is a compile-time assertion to ensure that this generated file
    20  // is compatible with the proto package it is being compiled against.
    21  // A compilation error at this line likely means your copy of the
    22  // proto package needs to be updated.
    23  const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
    24  
    25  type MyPayload struct {
    26  	Val int32 `protobuf:"varint,1,opt,name=val,proto3" json:"val,omitempty"`
    27  }
    28  
    29  func (m *MyPayload) Reset()         { *m = MyPayload{} }
    30  func (m *MyPayload) String() string { return proto.CompactTextString(m) }
    31  func (*MyPayload) ProtoMessage()    {}
    32  func (*MyPayload) Descriptor() ([]byte, []int) {
    33  	return fileDescriptor_bba822a4a2c59a28, []int{0}
    34  }
    35  func (m *MyPayload) XXX_Unmarshal(b []byte) error {
    36  	return m.Unmarshal(b)
    37  }
    38  func (m *MyPayload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
    39  	b = b[:cap(b)]
    40  	n, err := m.MarshalToSizedBuffer(b)
    41  	if err != nil {
    42  		return nil, err
    43  	}
    44  	return b[:n], nil
    45  }
    46  func (m *MyPayload) XXX_Merge(src proto.Message) {
    47  	xxx_messageInfo_MyPayload.Merge(m, src)
    48  }
    49  func (m *MyPayload) XXX_Size() int {
    50  	return m.Size()
    51  }
    52  func (m *MyPayload) XXX_DiscardUnknown() {
    53  	xxx_messageInfo_MyPayload.DiscardUnknown(m)
    54  }
    55  
    56  var xxx_messageInfo_MyPayload proto.InternalMessageInfo
    57  
    58  func init() {
    59  	proto.RegisterType((*MyPayload)(nil), "cockroach.errors.errbase.internal.MyPayload")
    60  }
    61  
    62  func init() { proto.RegisterFile("errbase/internal/unknown.proto", fileDescriptor_bba822a4a2c59a28) }
    63  
    64  var fileDescriptor_bba822a4a2c59a28 = []byte{
    65  	// 154 bytes of a gzipped FileDescriptorProto
    66  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4b, 0x2d, 0x2a, 0x4a,
    67  	0x4a, 0x2c, 0x4e, 0xd5, 0xcf, 0xcc, 0x2b, 0x49, 0x2d, 0xca, 0x4b, 0xcc, 0xd1, 0x2f, 0xcd, 0xcb,
    68  	0xce, 0xcb, 0x2f, 0xcf, 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x52, 0x4c, 0xce, 0x4f, 0xce,
    69  	0x2e, 0xca, 0x4f, 0x4c, 0xce, 0xd0, 0x4b, 0x2d, 0x2a, 0xca, 0x2f, 0x2a, 0xd6, 0x83, 0x6a, 0xd0,
    70  	0x83, 0x69, 0x50, 0x92, 0xe5, 0xe2, 0xf4, 0xad, 0x0c, 0x48, 0xac, 0xcc, 0xc9, 0x4f, 0x4c, 0x11,
    71  	0x12, 0xe0, 0x62, 0x2e, 0x4b, 0xcc, 0x91, 0x60, 0x54, 0x60, 0xd4, 0x60, 0x0d, 0x02, 0x31, 0x9d,
    72  	0xb4, 0x4e, 0x3c, 0x94, 0x63, 0x38, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x1b, 0x8f,
    73  	0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b,
    74  	0x8f, 0xe5, 0x18, 0xa2, 0x38, 0x60, 0x46, 0x25, 0xb1, 0x81, 0x2d, 0x35, 0x06, 0x04, 0x00, 0x00,
    75  	0xff, 0xff, 0x64, 0x6f, 0xf2, 0xc7, 0x96, 0x00, 0x00, 0x00,
    76  }
    77  
    78  func (m *MyPayload) Marshal() (dAtA []byte, err error) {
    79  	size := m.Size()
    80  	dAtA = make([]byte, size)
    81  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
    82  	if err != nil {
    83  		return nil, err
    84  	}
    85  	return dAtA[:n], nil
    86  }
    87  
    88  func (m *MyPayload) MarshalTo(dAtA []byte) (int, error) {
    89  	size := m.Size()
    90  	return m.MarshalToSizedBuffer(dAtA[:size])
    91  }
    92  
    93  func (m *MyPayload) MarshalToSizedBuffer(dAtA []byte) (int, error) {
    94  	i := len(dAtA)
    95  	_ = i
    96  	var l int
    97  	_ = l
    98  	if m.Val != 0 {
    99  		i = encodeVarintUnknown(dAtA, i, uint64(m.Val))
   100  		i--
   101  		dAtA[i] = 0x8
   102  	}
   103  	return len(dAtA) - i, nil
   104  }
   105  
   106  func encodeVarintUnknown(dAtA []byte, offset int, v uint64) int {
   107  	offset -= sovUnknown(v)
   108  	base := offset
   109  	for v >= 1<<7 {
   110  		dAtA[offset] = uint8(v&0x7f | 0x80)
   111  		v >>= 7
   112  		offset++
   113  	}
   114  	dAtA[offset] = uint8(v)
   115  	return base
   116  }
   117  func (m *MyPayload) Size() (n int) {
   118  	if m == nil {
   119  		return 0
   120  	}
   121  	var l int
   122  	_ = l
   123  	if m.Val != 0 {
   124  		n += 1 + sovUnknown(uint64(m.Val))
   125  	}
   126  	return n
   127  }
   128  
   129  func sovUnknown(x uint64) (n int) {
   130  	return (math_bits.Len64(x|1) + 6) / 7
   131  }
   132  func sozUnknown(x uint64) (n int) {
   133  	return sovUnknown(uint64((x << 1) ^ uint64((int64(x) >> 63))))
   134  }
   135  func (m *MyPayload) Unmarshal(dAtA []byte) error {
   136  	l := len(dAtA)
   137  	iNdEx := 0
   138  	for iNdEx < l {
   139  		preIndex := iNdEx
   140  		var wire uint64
   141  		for shift := uint(0); ; shift += 7 {
   142  			if shift >= 64 {
   143  				return ErrIntOverflowUnknown
   144  			}
   145  			if iNdEx >= l {
   146  				return io.ErrUnexpectedEOF
   147  			}
   148  			b := dAtA[iNdEx]
   149  			iNdEx++
   150  			wire |= uint64(b&0x7F) << shift
   151  			if b < 0x80 {
   152  				break
   153  			}
   154  		}
   155  		fieldNum := int32(wire >> 3)
   156  		wireType := int(wire & 0x7)
   157  		if wireType == 4 {
   158  			return fmt.Errorf("proto: MyPayload: wiretype end group for non-group")
   159  		}
   160  		if fieldNum <= 0 {
   161  			return fmt.Errorf("proto: MyPayload: illegal tag %d (wire type %d)", fieldNum, wire)
   162  		}
   163  		switch fieldNum {
   164  		case 1:
   165  			if wireType != 0 {
   166  				return fmt.Errorf("proto: wrong wireType = %d for field Val", wireType)
   167  			}
   168  			m.Val = 0
   169  			for shift := uint(0); ; shift += 7 {
   170  				if shift >= 64 {
   171  					return ErrIntOverflowUnknown
   172  				}
   173  				if iNdEx >= l {
   174  					return io.ErrUnexpectedEOF
   175  				}
   176  				b := dAtA[iNdEx]
   177  				iNdEx++
   178  				m.Val |= int32(b&0x7F) << shift
   179  				if b < 0x80 {
   180  					break
   181  				}
   182  			}
   183  		default:
   184  			iNdEx = preIndex
   185  			skippy, err := skipUnknown(dAtA[iNdEx:])
   186  			if err != nil {
   187  				return err
   188  			}
   189  			if (skippy < 0) || (iNdEx+skippy) < 0 {
   190  				return ErrInvalidLengthUnknown
   191  			}
   192  			if (iNdEx + skippy) > l {
   193  				return io.ErrUnexpectedEOF
   194  			}
   195  			iNdEx += skippy
   196  		}
   197  	}
   198  
   199  	if iNdEx > l {
   200  		return io.ErrUnexpectedEOF
   201  	}
   202  	return nil
   203  }
   204  func skipUnknown(dAtA []byte) (n int, err error) {
   205  	l := len(dAtA)
   206  	iNdEx := 0
   207  	depth := 0
   208  	for iNdEx < l {
   209  		var wire uint64
   210  		for shift := uint(0); ; shift += 7 {
   211  			if shift >= 64 {
   212  				return 0, ErrIntOverflowUnknown
   213  			}
   214  			if iNdEx >= l {
   215  				return 0, io.ErrUnexpectedEOF
   216  			}
   217  			b := dAtA[iNdEx]
   218  			iNdEx++
   219  			wire |= (uint64(b) & 0x7F) << shift
   220  			if b < 0x80 {
   221  				break
   222  			}
   223  		}
   224  		wireType := int(wire & 0x7)
   225  		switch wireType {
   226  		case 0:
   227  			for shift := uint(0); ; shift += 7 {
   228  				if shift >= 64 {
   229  					return 0, ErrIntOverflowUnknown
   230  				}
   231  				if iNdEx >= l {
   232  					return 0, io.ErrUnexpectedEOF
   233  				}
   234  				iNdEx++
   235  				if dAtA[iNdEx-1] < 0x80 {
   236  					break
   237  				}
   238  			}
   239  		case 1:
   240  			iNdEx += 8
   241  		case 2:
   242  			var length int
   243  			for shift := uint(0); ; shift += 7 {
   244  				if shift >= 64 {
   245  					return 0, ErrIntOverflowUnknown
   246  				}
   247  				if iNdEx >= l {
   248  					return 0, io.ErrUnexpectedEOF
   249  				}
   250  				b := dAtA[iNdEx]
   251  				iNdEx++
   252  				length |= (int(b) & 0x7F) << shift
   253  				if b < 0x80 {
   254  					break
   255  				}
   256  			}
   257  			if length < 0 {
   258  				return 0, ErrInvalidLengthUnknown
   259  			}
   260  			iNdEx += length
   261  		case 3:
   262  			depth++
   263  		case 4:
   264  			if depth == 0 {
   265  				return 0, ErrUnexpectedEndOfGroupUnknown
   266  			}
   267  			depth--
   268  		case 5:
   269  			iNdEx += 4
   270  		default:
   271  			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
   272  		}
   273  		if iNdEx < 0 {
   274  			return 0, ErrInvalidLengthUnknown
   275  		}
   276  		if depth == 0 {
   277  			return iNdEx, nil
   278  		}
   279  	}
   280  	return 0, io.ErrUnexpectedEOF
   281  }
   282  
   283  var (
   284  	ErrInvalidLengthUnknown        = fmt.Errorf("proto: negative length found during unmarshaling")
   285  	ErrIntOverflowUnknown          = fmt.Errorf("proto: integer overflow")
   286  	ErrUnexpectedEndOfGroupUnknown = fmt.Errorf("proto: unexpected end of group")
   287  )