github.com/ethersphere/bee/v2@v2.2.0/pkg/p2p/protobuf/internal/pb/test.pb.go (about)

     1  // Code generated by protoc-gen-gogo. DO NOT EDIT.
     2  // source: test.proto
     3  
     4  package pb
     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 Message struct {
    26  	Text string `protobuf:"bytes,1,opt,name=Text,proto3" json:"Text,omitempty"`
    27  }
    28  
    29  func (m *Message) Reset()         { *m = Message{} }
    30  func (m *Message) String() string { return proto.CompactTextString(m) }
    31  func (*Message) ProtoMessage()    {}
    32  func (*Message) Descriptor() ([]byte, []int) {
    33  	return fileDescriptor_c161fcfdc0c3ff1e, []int{0}
    34  }
    35  func (m *Message) XXX_Unmarshal(b []byte) error {
    36  	return m.Unmarshal(b)
    37  }
    38  func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
    39  	if deterministic {
    40  		return xxx_messageInfo_Message.Marshal(b, m, deterministic)
    41  	} else {
    42  		b = b[:cap(b)]
    43  		n, err := m.MarshalToSizedBuffer(b)
    44  		if err != nil {
    45  			return nil, err
    46  		}
    47  		return b[:n], nil
    48  	}
    49  }
    50  func (m *Message) XXX_Merge(src proto.Message) {
    51  	xxx_messageInfo_Message.Merge(m, src)
    52  }
    53  func (m *Message) XXX_Size() int {
    54  	return m.Size()
    55  }
    56  func (m *Message) XXX_DiscardUnknown() {
    57  	xxx_messageInfo_Message.DiscardUnknown(m)
    58  }
    59  
    60  var xxx_messageInfo_Message proto.InternalMessageInfo
    61  
    62  func (m *Message) GetText() string {
    63  	if m != nil {
    64  		return m.Text
    65  	}
    66  	return ""
    67  }
    68  
    69  func init() {
    70  	proto.RegisterType((*Message)(nil), "test.Message")
    71  }
    72  
    73  func init() { proto.RegisterFile("test.proto", fileDescriptor_c161fcfdc0c3ff1e) }
    74  
    75  var fileDescriptor_c161fcfdc0c3ff1e = []byte{
    76  	// 104 bytes of a gzipped FileDescriptorProto
    77  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2a, 0x49, 0x2d, 0x2e,
    78  	0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x01, 0xb1, 0x95, 0x64, 0xb9, 0xd8, 0x7d, 0x53,
    79  	0x8b, 0x8b, 0x13, 0xd3, 0x53, 0x85, 0x84, 0xb8, 0x58, 0x42, 0x52, 0x2b, 0x4a, 0x24, 0x18, 0x15,
    80  	0x18, 0x35, 0x38, 0x83, 0xc0, 0x6c, 0x27, 0x99, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63,
    81  	0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96,
    82  	0x63, 0x88, 0x62, 0x2a, 0x48, 0x4a, 0x62, 0x03, 0x9b, 0x64, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff,
    83  	0xe2, 0x4b, 0x1d, 0x71, 0x57, 0x00, 0x00, 0x00,
    84  }
    85  
    86  func (m *Message) Marshal() (dAtA []byte, err error) {
    87  	size := m.Size()
    88  	dAtA = make([]byte, size)
    89  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
    90  	if err != nil {
    91  		return nil, err
    92  	}
    93  	return dAtA[:n], nil
    94  }
    95  
    96  func (m *Message) MarshalTo(dAtA []byte) (int, error) {
    97  	size := m.Size()
    98  	return m.MarshalToSizedBuffer(dAtA[:size])
    99  }
   100  
   101  func (m *Message) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   102  	i := len(dAtA)
   103  	_ = i
   104  	var l int
   105  	_ = l
   106  	if len(m.Text) > 0 {
   107  		i -= len(m.Text)
   108  		copy(dAtA[i:], m.Text)
   109  		i = encodeVarintTest(dAtA, i, uint64(len(m.Text)))
   110  		i--
   111  		dAtA[i] = 0xa
   112  	}
   113  	return len(dAtA) - i, nil
   114  }
   115  
   116  func encodeVarintTest(dAtA []byte, offset int, v uint64) int {
   117  	offset -= sovTest(v)
   118  	base := offset
   119  	for v >= 1<<7 {
   120  		dAtA[offset] = uint8(v&0x7f | 0x80)
   121  		v >>= 7
   122  		offset++
   123  	}
   124  	dAtA[offset] = uint8(v)
   125  	return base
   126  }
   127  func (m *Message) Size() (n int) {
   128  	if m == nil {
   129  		return 0
   130  	}
   131  	var l int
   132  	_ = l
   133  	l = len(m.Text)
   134  	if l > 0 {
   135  		n += 1 + l + sovTest(uint64(l))
   136  	}
   137  	return n
   138  }
   139  
   140  func sovTest(x uint64) (n int) {
   141  	return (math_bits.Len64(x|1) + 6) / 7
   142  }
   143  func sozTest(x uint64) (n int) {
   144  	return sovTest(uint64((x << 1) ^ uint64((int64(x) >> 63))))
   145  }
   146  func (m *Message) Unmarshal(dAtA []byte) error {
   147  	l := len(dAtA)
   148  	iNdEx := 0
   149  	for iNdEx < l {
   150  		preIndex := iNdEx
   151  		var wire uint64
   152  		for shift := uint(0); ; shift += 7 {
   153  			if shift >= 64 {
   154  				return ErrIntOverflowTest
   155  			}
   156  			if iNdEx >= l {
   157  				return io.ErrUnexpectedEOF
   158  			}
   159  			b := dAtA[iNdEx]
   160  			iNdEx++
   161  			wire |= uint64(b&0x7F) << shift
   162  			if b < 0x80 {
   163  				break
   164  			}
   165  		}
   166  		fieldNum := int32(wire >> 3)
   167  		wireType := int(wire & 0x7)
   168  		if wireType == 4 {
   169  			return fmt.Errorf("proto: Message: wiretype end group for non-group")
   170  		}
   171  		if fieldNum <= 0 {
   172  			return fmt.Errorf("proto: Message: illegal tag %d (wire type %d)", fieldNum, wire)
   173  		}
   174  		switch fieldNum {
   175  		case 1:
   176  			if wireType != 2 {
   177  				return fmt.Errorf("proto: wrong wireType = %d for field Text", wireType)
   178  			}
   179  			var stringLen uint64
   180  			for shift := uint(0); ; shift += 7 {
   181  				if shift >= 64 {
   182  					return ErrIntOverflowTest
   183  				}
   184  				if iNdEx >= l {
   185  					return io.ErrUnexpectedEOF
   186  				}
   187  				b := dAtA[iNdEx]
   188  				iNdEx++
   189  				stringLen |= uint64(b&0x7F) << shift
   190  				if b < 0x80 {
   191  					break
   192  				}
   193  			}
   194  			intStringLen := int(stringLen)
   195  			if intStringLen < 0 {
   196  				return ErrInvalidLengthTest
   197  			}
   198  			postIndex := iNdEx + intStringLen
   199  			if postIndex < 0 {
   200  				return ErrInvalidLengthTest
   201  			}
   202  			if postIndex > l {
   203  				return io.ErrUnexpectedEOF
   204  			}
   205  			m.Text = string(dAtA[iNdEx:postIndex])
   206  			iNdEx = postIndex
   207  		default:
   208  			iNdEx = preIndex
   209  			skippy, err := skipTest(dAtA[iNdEx:])
   210  			if err != nil {
   211  				return err
   212  			}
   213  			if skippy < 0 {
   214  				return ErrInvalidLengthTest
   215  			}
   216  			if (iNdEx + skippy) < 0 {
   217  				return ErrInvalidLengthTest
   218  			}
   219  			if (iNdEx + skippy) > l {
   220  				return io.ErrUnexpectedEOF
   221  			}
   222  			iNdEx += skippy
   223  		}
   224  	}
   225  
   226  	if iNdEx > l {
   227  		return io.ErrUnexpectedEOF
   228  	}
   229  	return nil
   230  }
   231  func skipTest(dAtA []byte) (n int, err error) {
   232  	l := len(dAtA)
   233  	iNdEx := 0
   234  	depth := 0
   235  	for iNdEx < l {
   236  		var wire uint64
   237  		for shift := uint(0); ; shift += 7 {
   238  			if shift >= 64 {
   239  				return 0, ErrIntOverflowTest
   240  			}
   241  			if iNdEx >= l {
   242  				return 0, io.ErrUnexpectedEOF
   243  			}
   244  			b := dAtA[iNdEx]
   245  			iNdEx++
   246  			wire |= (uint64(b) & 0x7F) << shift
   247  			if b < 0x80 {
   248  				break
   249  			}
   250  		}
   251  		wireType := int(wire & 0x7)
   252  		switch wireType {
   253  		case 0:
   254  			for shift := uint(0); ; shift += 7 {
   255  				if shift >= 64 {
   256  					return 0, ErrIntOverflowTest
   257  				}
   258  				if iNdEx >= l {
   259  					return 0, io.ErrUnexpectedEOF
   260  				}
   261  				iNdEx++
   262  				if dAtA[iNdEx-1] < 0x80 {
   263  					break
   264  				}
   265  			}
   266  		case 1:
   267  			iNdEx += 8
   268  		case 2:
   269  			var length int
   270  			for shift := uint(0); ; shift += 7 {
   271  				if shift >= 64 {
   272  					return 0, ErrIntOverflowTest
   273  				}
   274  				if iNdEx >= l {
   275  					return 0, io.ErrUnexpectedEOF
   276  				}
   277  				b := dAtA[iNdEx]
   278  				iNdEx++
   279  				length |= (int(b) & 0x7F) << shift
   280  				if b < 0x80 {
   281  					break
   282  				}
   283  			}
   284  			if length < 0 {
   285  				return 0, ErrInvalidLengthTest
   286  			}
   287  			iNdEx += length
   288  		case 3:
   289  			depth++
   290  		case 4:
   291  			if depth == 0 {
   292  				return 0, ErrUnexpectedEndOfGroupTest
   293  			}
   294  			depth--
   295  		case 5:
   296  			iNdEx += 4
   297  		default:
   298  			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
   299  		}
   300  		if iNdEx < 0 {
   301  			return 0, ErrInvalidLengthTest
   302  		}
   303  		if depth == 0 {
   304  			return iNdEx, nil
   305  		}
   306  	}
   307  	return 0, io.ErrUnexpectedEOF
   308  }
   309  
   310  var (
   311  	ErrInvalidLengthTest        = fmt.Errorf("proto: negative length found during unmarshaling")
   312  	ErrIntOverflowTest          = fmt.Errorf("proto: integer overflow")
   313  	ErrUnexpectedEndOfGroupTest = fmt.Errorf("proto: unexpected end of group")
   314  )