github.com/Finschia/finschia-sdk@v0.48.1/codec/types/any.pb.go (about)

     1  // Code generated by protoc-gen-gogo. DO NOT EDIT.
     2  // source: google/protobuf/any.proto
     3  
     4  package types
     5  
     6  import (
     7  	bytes "bytes"
     8  	fmt "fmt"
     9  	_ "github.com/gogo/protobuf/gogoproto"
    10  	proto "github.com/gogo/protobuf/proto"
    11  	io "io"
    12  	math "math"
    13  	math_bits "math/bits"
    14  )
    15  
    16  // Reference imports to suppress errors if they are not otherwise used.
    17  var _ = proto.Marshal
    18  var _ = fmt.Errorf
    19  var _ = math.Inf
    20  
    21  // This is a compile-time assertion to ensure that this generated file
    22  // is compatible with the proto package it is being compiled against.
    23  // A compilation error at this line likely means your copy of the
    24  // proto package needs to be updated.
    25  const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
    26  
    27  func (m *Any) Reset()      { *m = Any{} }
    28  func (*Any) ProtoMessage() {}
    29  func (*Any) Descriptor() ([]byte, []int) {
    30  	return fileDescriptor_b53526c13ae22eb4, []int{0}
    31  }
    32  func (*Any) XXX_WellKnownType() string { return "Any" }
    33  func (m *Any) XXX_Unmarshal(b []byte) error {
    34  	return m.Unmarshal(b)
    35  }
    36  func (m *Any) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
    37  	if deterministic {
    38  		return xxx_messageInfo_Any.Marshal(b, m, deterministic)
    39  	} else {
    40  		b = b[:cap(b)]
    41  		n, err := m.MarshalToSizedBuffer(b)
    42  		if err != nil {
    43  			return nil, err
    44  		}
    45  		return b[:n], nil
    46  	}
    47  }
    48  func (m *Any) XXX_Merge(src proto.Message) {
    49  	xxx_messageInfo_Any.Merge(m, src)
    50  }
    51  func (m *Any) XXX_Size() int {
    52  	return m.Size()
    53  }
    54  func (m *Any) XXX_DiscardUnknown() {
    55  	xxx_messageInfo_Any.DiscardUnknown(m)
    56  }
    57  
    58  var xxx_messageInfo_Any proto.InternalMessageInfo
    59  
    60  func (m *Any) GetTypeUrl() string {
    61  	if m != nil {
    62  		return m.TypeUrl
    63  	}
    64  	return ""
    65  }
    66  
    67  func (m *Any) GetValue() []byte {
    68  	if m != nil {
    69  		return m.Value
    70  	}
    71  	return nil
    72  }
    73  
    74  func (*Any) XXX_MessageName() string {
    75  	return "google.protobuf.Any"
    76  }
    77  func init() {
    78  }
    79  
    80  func init() { proto.RegisterFile("google/protobuf/any.proto", fileDescriptor_b53526c13ae22eb4) }
    81  
    82  var fileDescriptor_b53526c13ae22eb4 = []byte{
    83  	// 248 bytes of a gzipped FileDescriptorProto
    84  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4c, 0xcf, 0xcf, 0x4f,
    85  	0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x4f, 0xcc, 0xab, 0xd4,
    86  	0x03, 0x73, 0x84, 0xf8, 0x21, 0x52, 0x7a, 0x30, 0x29, 0x29, 0x91, 0xf4, 0xfc, 0xf4, 0x7c, 0x30,
    87  	0x4f, 0x1f, 0xc4, 0x82, 0x48, 0x28, 0x79, 0x70, 0x31, 0x3b, 0xe6, 0x55, 0x0a, 0x49, 0x72, 0x71,
    88  	0x94, 0x54, 0x16, 0xa4, 0xc6, 0x97, 0x16, 0xe5, 0x48, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x06, 0xb1,
    89  	0x83, 0xf8, 0xa1, 0x45, 0x39, 0x42, 0x22, 0x5c, 0xac, 0x65, 0x89, 0x39, 0xa5, 0xa9, 0x12, 0x4c,
    90  	0x0a, 0x8c, 0x1a, 0x3c, 0x41, 0x10, 0x8e, 0x95, 0xc0, 0x8c, 0x05, 0xf2, 0x0c, 0x1b, 0x16, 0xc8,
    91  	0x33, 0x7c, 0x58, 0x28, 0xcf, 0xd0, 0x70, 0x47, 0x81, 0xc1, 0xa9, 0x99, 0xf1, 0xc6, 0x43, 0x39,
    92  	0x86, 0x0f, 0x0f, 0xe5, 0x18, 0x7f, 0x3c, 0x94, 0x63, 0x6c, 0x78, 0x24, 0xc7, 0xb8, 0xe2, 0x91,
    93  	0x1c, 0xe3, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0xf8, 0xe2,
    94  	0x91, 0x1c, 0xc3, 0x07, 0x90, 0xf8, 0x63, 0x39, 0xc6, 0x03, 0x8f, 0xe5, 0x18, 0x4e, 0x3c, 0x96,
    95  	0x63, 0xe4, 0x12, 0x4e, 0xce, 0xcf, 0xd5, 0x43, 0x73, 0xab, 0x13, 0x87, 0x63, 0x5e, 0x65, 0x00,
    96  	0x88, 0x13, 0xc0, 0x18, 0xc5, 0x0a, 0x72, 0x48, 0xf1, 0x22, 0x26, 0x66, 0xf7, 0x00, 0xa7, 0x55,
    97  	0x4c, 0x72, 0xee, 0x10, 0xa5, 0x01, 0x50, 0xa5, 0x7a, 0xe1, 0xa9, 0x39, 0x39, 0xde, 0x79, 0xf9,
    98  	0xe5, 0x79, 0x21, 0x20, 0x65, 0x49, 0x6c, 0x60, 0x33, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff,
    99  	0x4d, 0x91, 0x00, 0xa0, 0x1a, 0x01, 0x00, 0x00,
   100  }
   101  
   102  func (this *Any) Compare(that interface{}) int {
   103  	if that == nil {
   104  		if this == nil {
   105  			return 0
   106  		}
   107  		return 1
   108  	}
   109  
   110  	that1, ok := that.(*Any)
   111  	if !ok {
   112  		that2, ok := that.(Any)
   113  		if ok {
   114  			that1 = &that2
   115  		} else {
   116  			return 1
   117  		}
   118  	}
   119  	if that1 == nil {
   120  		if this == nil {
   121  			return 0
   122  		}
   123  		return 1
   124  	} else if this == nil {
   125  		return -1
   126  	}
   127  	if this.TypeUrl != that1.TypeUrl {
   128  		if this.TypeUrl < that1.TypeUrl {
   129  			return -1
   130  		}
   131  		return 1
   132  	}
   133  	if c := bytes.Compare(this.Value, that1.Value); c != 0 {
   134  		return c
   135  	}
   136  	if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
   137  		return c
   138  	}
   139  	return 0
   140  }
   141  func (this *Any) Equal(that interface{}) bool {
   142  	if that == nil {
   143  		return this == nil
   144  	}
   145  
   146  	that1, ok := that.(*Any)
   147  	if !ok {
   148  		that2, ok := that.(Any)
   149  		if ok {
   150  			that1 = &that2
   151  		} else {
   152  			return false
   153  		}
   154  	}
   155  	if that1 == nil {
   156  		return this == nil
   157  	} else if this == nil {
   158  		return false
   159  	}
   160  	if this.TypeUrl != that1.TypeUrl {
   161  		return false
   162  	}
   163  	if !bytes.Equal(this.Value, that1.Value) {
   164  		return false
   165  	}
   166  	if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
   167  		return false
   168  	}
   169  	return true
   170  }
   171  func (m *Any) Marshal() (dAtA []byte, err error) {
   172  	size := m.Size()
   173  	dAtA = make([]byte, size)
   174  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   175  	if err != nil {
   176  		return nil, err
   177  	}
   178  	return dAtA[:n], nil
   179  }
   180  
   181  func (m *Any) MarshalTo(dAtA []byte) (int, error) {
   182  	size := m.Size()
   183  	return m.MarshalToSizedBuffer(dAtA[:size])
   184  }
   185  
   186  func (m *Any) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   187  	i := len(dAtA)
   188  	_ = i
   189  	var l int
   190  	_ = l
   191  	if m.XXX_unrecognized != nil {
   192  		i -= len(m.XXX_unrecognized)
   193  		copy(dAtA[i:], m.XXX_unrecognized)
   194  	}
   195  	if len(m.Value) > 0 {
   196  		i -= len(m.Value)
   197  		copy(dAtA[i:], m.Value)
   198  		i = encodeVarintAny(dAtA, i, uint64(len(m.Value)))
   199  		i--
   200  		dAtA[i] = 0x12
   201  	}
   202  	if len(m.TypeUrl) > 0 {
   203  		i -= len(m.TypeUrl)
   204  		copy(dAtA[i:], m.TypeUrl)
   205  		i = encodeVarintAny(dAtA, i, uint64(len(m.TypeUrl)))
   206  		i--
   207  		dAtA[i] = 0xa
   208  	}
   209  	return len(dAtA) - i, nil
   210  }
   211  
   212  func encodeVarintAny(dAtA []byte, offset int, v uint64) int {
   213  	offset -= sovAny(v)
   214  	base := offset
   215  	for v >= 1<<7 {
   216  		dAtA[offset] = uint8(v&0x7f | 0x80)
   217  		v >>= 7
   218  		offset++
   219  	}
   220  	dAtA[offset] = uint8(v)
   221  	return base
   222  }
   223  func NewPopulatedAny(r randyAny, easy bool) *Any {
   224  	this := &Any{}
   225  	this.TypeUrl = string(randStringAny(r))
   226  	v1 := r.Intn(100)
   227  	this.Value = make([]byte, v1)
   228  	for i := 0; i < v1; i++ {
   229  		this.Value[i] = byte(r.Intn(256))
   230  	}
   231  	if !easy && r.Intn(10) != 0 {
   232  		this.XXX_unrecognized = randUnrecognizedAny(r, 3)
   233  	}
   234  	return this
   235  }
   236  
   237  type randyAny interface {
   238  	Float32() float32
   239  	Float64() float64
   240  	Int63() int64
   241  	Int31() int32
   242  	Uint32() uint32
   243  	Intn(n int) int
   244  }
   245  
   246  func randUTF8RuneAny(r randyAny) rune {
   247  	ru := r.Intn(62)
   248  	if ru < 10 {
   249  		return rune(ru + 48)
   250  	} else if ru < 36 {
   251  		return rune(ru + 55)
   252  	}
   253  	return rune(ru + 61)
   254  }
   255  func randStringAny(r randyAny) string {
   256  	v2 := r.Intn(100)
   257  	tmps := make([]rune, v2)
   258  	for i := 0; i < v2; i++ {
   259  		tmps[i] = randUTF8RuneAny(r)
   260  	}
   261  	return string(tmps)
   262  }
   263  func randUnrecognizedAny(r randyAny, maxFieldNumber int) (dAtA []byte) {
   264  	l := r.Intn(5)
   265  	for i := 0; i < l; i++ {
   266  		wire := r.Intn(4)
   267  		if wire == 3 {
   268  			wire = 5
   269  		}
   270  		fieldNumber := maxFieldNumber + r.Intn(100)
   271  		dAtA = randFieldAny(dAtA, r, fieldNumber, wire)
   272  	}
   273  	return dAtA
   274  }
   275  func randFieldAny(dAtA []byte, r randyAny, fieldNumber int, wire int) []byte {
   276  	key := uint32(fieldNumber)<<3 | uint32(wire)
   277  	switch wire {
   278  	case 0:
   279  		dAtA = encodeVarintPopulateAny(dAtA, uint64(key))
   280  		v3 := r.Int63()
   281  		if r.Intn(2) == 0 {
   282  			v3 *= -1
   283  		}
   284  		dAtA = encodeVarintPopulateAny(dAtA, uint64(v3))
   285  	case 1:
   286  		dAtA = encodeVarintPopulateAny(dAtA, uint64(key))
   287  		dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
   288  	case 2:
   289  		dAtA = encodeVarintPopulateAny(dAtA, uint64(key))
   290  		ll := r.Intn(100)
   291  		dAtA = encodeVarintPopulateAny(dAtA, uint64(ll))
   292  		for j := 0; j < ll; j++ {
   293  			dAtA = append(dAtA, byte(r.Intn(256)))
   294  		}
   295  	default:
   296  		dAtA = encodeVarintPopulateAny(dAtA, uint64(key))
   297  		dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
   298  	}
   299  	return dAtA
   300  }
   301  func encodeVarintPopulateAny(dAtA []byte, v uint64) []byte {
   302  	for v >= 1<<7 {
   303  		dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80))
   304  		v >>= 7
   305  	}
   306  	dAtA = append(dAtA, uint8(v))
   307  	return dAtA
   308  }
   309  func (m *Any) Size() (n int) {
   310  	if m == nil {
   311  		return 0
   312  	}
   313  	var l int
   314  	_ = l
   315  	l = len(m.TypeUrl)
   316  	if l > 0 {
   317  		n += 1 + l + sovAny(uint64(l))
   318  	}
   319  	l = len(m.Value)
   320  	if l > 0 {
   321  		n += 1 + l + sovAny(uint64(l))
   322  	}
   323  	if m.XXX_unrecognized != nil {
   324  		n += len(m.XXX_unrecognized)
   325  	}
   326  	return n
   327  }
   328  
   329  func sovAny(x uint64) (n int) {
   330  	return (math_bits.Len64(x|1) + 6) / 7
   331  }
   332  func sozAny(x uint64) (n int) {
   333  	return sovAny(uint64((x << 1) ^ uint64((int64(x) >> 63))))
   334  }
   335  func (m *Any) Unmarshal(dAtA []byte) error {
   336  	l := len(dAtA)
   337  	iNdEx := 0
   338  	for iNdEx < l {
   339  		preIndex := iNdEx
   340  		var wire uint64
   341  		for shift := uint(0); ; shift += 7 {
   342  			if shift >= 64 {
   343  				return ErrIntOverflowAny
   344  			}
   345  			if iNdEx >= l {
   346  				return io.ErrUnexpectedEOF
   347  			}
   348  			b := dAtA[iNdEx]
   349  			iNdEx++
   350  			wire |= uint64(b&0x7F) << shift
   351  			if b < 0x80 {
   352  				break
   353  			}
   354  		}
   355  		fieldNum := int32(wire >> 3)
   356  		wireType := int(wire & 0x7)
   357  		if wireType == 4 {
   358  			return fmt.Errorf("proto: Any: wiretype end group for non-group")
   359  		}
   360  		if fieldNum <= 0 {
   361  			return fmt.Errorf("proto: Any: illegal tag %d (wire type %d)", fieldNum, wire)
   362  		}
   363  		switch fieldNum {
   364  		case 1:
   365  			if wireType != 2 {
   366  				return fmt.Errorf("proto: wrong wireType = %d for field TypeUrl", wireType)
   367  			}
   368  			var stringLen uint64
   369  			for shift := uint(0); ; shift += 7 {
   370  				if shift >= 64 {
   371  					return ErrIntOverflowAny
   372  				}
   373  				if iNdEx >= l {
   374  					return io.ErrUnexpectedEOF
   375  				}
   376  				b := dAtA[iNdEx]
   377  				iNdEx++
   378  				stringLen |= uint64(b&0x7F) << shift
   379  				if b < 0x80 {
   380  					break
   381  				}
   382  			}
   383  			intStringLen := int(stringLen)
   384  			if intStringLen < 0 {
   385  				return ErrInvalidLengthAny
   386  			}
   387  			postIndex := iNdEx + intStringLen
   388  			if postIndex < 0 {
   389  				return ErrInvalidLengthAny
   390  			}
   391  			if postIndex > l {
   392  				return io.ErrUnexpectedEOF
   393  			}
   394  			m.TypeUrl = string(dAtA[iNdEx:postIndex])
   395  			iNdEx = postIndex
   396  		case 2:
   397  			if wireType != 2 {
   398  				return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
   399  			}
   400  			var byteLen int
   401  			for shift := uint(0); ; shift += 7 {
   402  				if shift >= 64 {
   403  					return ErrIntOverflowAny
   404  				}
   405  				if iNdEx >= l {
   406  					return io.ErrUnexpectedEOF
   407  				}
   408  				b := dAtA[iNdEx]
   409  				iNdEx++
   410  				byteLen |= int(b&0x7F) << shift
   411  				if b < 0x80 {
   412  					break
   413  				}
   414  			}
   415  			if byteLen < 0 {
   416  				return ErrInvalidLengthAny
   417  			}
   418  			postIndex := iNdEx + byteLen
   419  			if postIndex < 0 {
   420  				return ErrInvalidLengthAny
   421  			}
   422  			if postIndex > l {
   423  				return io.ErrUnexpectedEOF
   424  			}
   425  			m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...)
   426  			if m.Value == nil {
   427  				m.Value = []byte{}
   428  			}
   429  			iNdEx = postIndex
   430  		default:
   431  			iNdEx = preIndex
   432  			skippy, err := skipAny(dAtA[iNdEx:])
   433  			if err != nil {
   434  				return err
   435  			}
   436  			if (skippy < 0) || (iNdEx+skippy) < 0 {
   437  				return ErrInvalidLengthAny
   438  			}
   439  			if (iNdEx + skippy) > l {
   440  				return io.ErrUnexpectedEOF
   441  			}
   442  			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
   443  			iNdEx += skippy
   444  		}
   445  	}
   446  
   447  	if iNdEx > l {
   448  		return io.ErrUnexpectedEOF
   449  	}
   450  	return nil
   451  }
   452  func skipAny(dAtA []byte) (n int, err error) {
   453  	l := len(dAtA)
   454  	iNdEx := 0
   455  	depth := 0
   456  	for iNdEx < l {
   457  		var wire uint64
   458  		for shift := uint(0); ; shift += 7 {
   459  			if shift >= 64 {
   460  				return 0, ErrIntOverflowAny
   461  			}
   462  			if iNdEx >= l {
   463  				return 0, io.ErrUnexpectedEOF
   464  			}
   465  			b := dAtA[iNdEx]
   466  			iNdEx++
   467  			wire |= (uint64(b) & 0x7F) << shift
   468  			if b < 0x80 {
   469  				break
   470  			}
   471  		}
   472  		wireType := int(wire & 0x7)
   473  		switch wireType {
   474  		case 0:
   475  			for shift := uint(0); ; shift += 7 {
   476  				if shift >= 64 {
   477  					return 0, ErrIntOverflowAny
   478  				}
   479  				if iNdEx >= l {
   480  					return 0, io.ErrUnexpectedEOF
   481  				}
   482  				iNdEx++
   483  				if dAtA[iNdEx-1] < 0x80 {
   484  					break
   485  				}
   486  			}
   487  		case 1:
   488  			iNdEx += 8
   489  		case 2:
   490  			var length int
   491  			for shift := uint(0); ; shift += 7 {
   492  				if shift >= 64 {
   493  					return 0, ErrIntOverflowAny
   494  				}
   495  				if iNdEx >= l {
   496  					return 0, io.ErrUnexpectedEOF
   497  				}
   498  				b := dAtA[iNdEx]
   499  				iNdEx++
   500  				length |= (int(b) & 0x7F) << shift
   501  				if b < 0x80 {
   502  					break
   503  				}
   504  			}
   505  			if length < 0 {
   506  				return 0, ErrInvalidLengthAny
   507  			}
   508  			iNdEx += length
   509  		case 3:
   510  			depth++
   511  		case 4:
   512  			if depth == 0 {
   513  				return 0, ErrUnexpectedEndOfGroupAny
   514  			}
   515  			depth--
   516  		case 5:
   517  			iNdEx += 4
   518  		default:
   519  			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
   520  		}
   521  		if iNdEx < 0 {
   522  			return 0, ErrInvalidLengthAny
   523  		}
   524  		if depth == 0 {
   525  			return iNdEx, nil
   526  		}
   527  	}
   528  	return 0, io.ErrUnexpectedEOF
   529  }
   530  
   531  var (
   532  	ErrInvalidLengthAny        = fmt.Errorf("proto: negative length found during unmarshaling")
   533  	ErrIntOverflowAny          = fmt.Errorf("proto: integer overflow")
   534  	ErrUnexpectedEndOfGroupAny = fmt.Errorf("proto: unexpected end of group")
   535  )