github.com/binkynet/BinkyNet@v1.12.1-0.20240421190447-da4e34c20be0/apis/v1/discovery.pb.go (about)

     1  // Code generated by protoc-gen-gogo. DO NOT EDIT.
     2  // source: discovery.proto
     3  
     4  package v1
     5  
     6  import (
     7  	fmt "fmt"
     8  	proto "github.com/golang/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.ProtoPackageIsVersion3 // please upgrade the proto package
    24  
    25  // ServiceInfo is used to standardize service description information.
    26  type ServiceInfo struct {
    27  	// API version of the service.
    28  	// Currently v1.
    29  	// This is mapped to text field "api_version" in the zeroconf service entry.
    30  	ApiVersion string `protobuf:"bytes,1,opt,name=api_version,json=apiVersion,proto3" json:"api_version,omitempty"`
    31  	// Version of the component providing the service in semantic versioning format.
    32  	// E.g. 1.0.4
    33  	// This is mapped to text field "version" in the zeroconf service entry.
    34  	Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
    35  	// Port number on which the service is offered.
    36  	// This is mapped to the standard port field of the zeroconf service entry.
    37  	ApiPort int32 `protobuf:"varint,3,opt,name=api_port,json=apiPort,proto3" json:"api_port,omitempty"`
    38  	// Address (hostname / IP address) of the service.
    39  	// This is mapped to the standard hostname + address fields of the zeroconf service entry.
    40  	ApiAddress string `protobuf:"bytes,4,opt,name=api_address,json=apiAddress,proto3" json:"api_address,omitempty"`
    41  	// If set, the API is served over TLS.
    42  	// This is mapped to text field "secure" in the zeroconf service entry.
    43  	Secure               bool     `protobuf:"varint,5,opt,name=secure,proto3" json:"secure,omitempty"`
    44  	XXX_NoUnkeyedLiteral struct{} `json:"-"`
    45  	XXX_unrecognized     []byte   `json:"-"`
    46  	XXX_sizecache        int32    `json:"-"`
    47  }
    48  
    49  func (m *ServiceInfo) Reset()         { *m = ServiceInfo{} }
    50  func (m *ServiceInfo) String() string { return proto.CompactTextString(m) }
    51  func (*ServiceInfo) ProtoMessage()    {}
    52  func (*ServiceInfo) Descriptor() ([]byte, []int) {
    53  	return fileDescriptor_1e7ff60feb39c8d0, []int{0}
    54  }
    55  func (m *ServiceInfo) XXX_Unmarshal(b []byte) error {
    56  	return m.Unmarshal(b)
    57  }
    58  func (m *ServiceInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
    59  	if deterministic {
    60  		return xxx_messageInfo_ServiceInfo.Marshal(b, m, deterministic)
    61  	} else {
    62  		b = b[:cap(b)]
    63  		n, err := m.MarshalToSizedBuffer(b)
    64  		if err != nil {
    65  			return nil, err
    66  		}
    67  		return b[:n], nil
    68  	}
    69  }
    70  func (m *ServiceInfo) XXX_Merge(src proto.Message) {
    71  	xxx_messageInfo_ServiceInfo.Merge(m, src)
    72  }
    73  func (m *ServiceInfo) XXX_Size() int {
    74  	return m.Size()
    75  }
    76  func (m *ServiceInfo) XXX_DiscardUnknown() {
    77  	xxx_messageInfo_ServiceInfo.DiscardUnknown(m)
    78  }
    79  
    80  var xxx_messageInfo_ServiceInfo proto.InternalMessageInfo
    81  
    82  func (m *ServiceInfo) GetApiVersion() string {
    83  	if m != nil {
    84  		return m.ApiVersion
    85  	}
    86  	return ""
    87  }
    88  
    89  func (m *ServiceInfo) GetVersion() string {
    90  	if m != nil {
    91  		return m.Version
    92  	}
    93  	return ""
    94  }
    95  
    96  func (m *ServiceInfo) GetApiPort() int32 {
    97  	if m != nil {
    98  		return m.ApiPort
    99  	}
   100  	return 0
   101  }
   102  
   103  func (m *ServiceInfo) GetApiAddress() string {
   104  	if m != nil {
   105  		return m.ApiAddress
   106  	}
   107  	return ""
   108  }
   109  
   110  func (m *ServiceInfo) GetSecure() bool {
   111  	if m != nil {
   112  		return m.Secure
   113  	}
   114  	return false
   115  }
   116  
   117  func init() {
   118  	proto.RegisterType((*ServiceInfo)(nil), "binkynet.v1.ServiceInfo")
   119  }
   120  
   121  func init() { proto.RegisterFile("discovery.proto", fileDescriptor_1e7ff60feb39c8d0) }
   122  
   123  var fileDescriptor_1e7ff60feb39c8d0 = []byte{
   124  	// 237 bytes of a gzipped FileDescriptorProto
   125  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4f, 0xc9, 0x2c, 0x4e,
   126  	0xce, 0x2f, 0x4b, 0x2d, 0xaa, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x4e, 0xca, 0xcc,
   127  	0xcb, 0xae, 0xcc, 0x4b, 0x2d, 0xd1, 0x2b, 0x33, 0x54, 0x9a, 0xc3, 0xc8, 0xc5, 0x1d, 0x9c, 0x5a,
   128  	0x54, 0x96, 0x99, 0x9c, 0xea, 0x99, 0x97, 0x96, 0x2f, 0x24, 0xcf, 0xc5, 0x9d, 0x58, 0x90, 0x19,
   129  	0x5f, 0x96, 0x5a, 0x54, 0x9c, 0x99, 0x9f, 0x27, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x19, 0xc4, 0x95,
   130  	0x58, 0x90, 0x19, 0x06, 0x11, 0x11, 0x92, 0xe0, 0x62, 0x87, 0x49, 0x32, 0x81, 0x25, 0x61, 0x5c,
   131  	0x21, 0x49, 0x2e, 0x0e, 0x90, 0xd6, 0x82, 0xfc, 0xa2, 0x12, 0x09, 0x66, 0x05, 0x46, 0x0d, 0xd6,
   132  	0x20, 0xf6, 0xc4, 0x82, 0xcc, 0x80, 0xfc, 0xa2, 0x12, 0x98, 0xa9, 0x89, 0x29, 0x29, 0x45, 0xa9,
   133  	0xc5, 0xc5, 0x12, 0x2c, 0x70, 0x53, 0x1d, 0x21, 0x22, 0x42, 0x62, 0x5c, 0x6c, 0xc5, 0xa9, 0xc9,
   134  	0xa5, 0x45, 0xa9, 0x12, 0xac, 0x0a, 0x8c, 0x1a, 0x1c, 0x41, 0x50, 0x9e, 0x93, 0xe7, 0x89, 0x47,
   135  	0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe3, 0xb1, 0x1c, 0x43, 0x94,
   136  	0x4a, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, 0xcc, 0x23, 0xfa, 0x4e,
   137  	0x20, 0x86, 0x5f, 0x6a, 0x89, 0x7e, 0x62, 0x41, 0x66, 0xb1, 0x7e, 0x99, 0xe1, 0x2a, 0x26, 0x01,
   138  	0x98, 0x90, 0x9e, 0x63, 0x41, 0x66, 0xb1, 0x5e, 0x98, 0x61, 0x12, 0x1b, 0xd8, 0xf7, 0xc6, 0x80,
   139  	0x00, 0x00, 0x00, 0xff, 0xff, 0x50, 0x91, 0xe5, 0xcb, 0x10, 0x01, 0x00, 0x00,
   140  }
   141  
   142  func (m *ServiceInfo) Marshal() (dAtA []byte, err error) {
   143  	size := m.Size()
   144  	dAtA = make([]byte, size)
   145  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   146  	if err != nil {
   147  		return nil, err
   148  	}
   149  	return dAtA[:n], nil
   150  }
   151  
   152  func (m *ServiceInfo) MarshalTo(dAtA []byte) (int, error) {
   153  	size := m.Size()
   154  	return m.MarshalToSizedBuffer(dAtA[:size])
   155  }
   156  
   157  func (m *ServiceInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   158  	i := len(dAtA)
   159  	_ = i
   160  	var l int
   161  	_ = l
   162  	if m.XXX_unrecognized != nil {
   163  		i -= len(m.XXX_unrecognized)
   164  		copy(dAtA[i:], m.XXX_unrecognized)
   165  	}
   166  	if m.Secure {
   167  		i--
   168  		if m.Secure {
   169  			dAtA[i] = 1
   170  		} else {
   171  			dAtA[i] = 0
   172  		}
   173  		i--
   174  		dAtA[i] = 0x28
   175  	}
   176  	if len(m.ApiAddress) > 0 {
   177  		i -= len(m.ApiAddress)
   178  		copy(dAtA[i:], m.ApiAddress)
   179  		i = encodeVarintDiscovery(dAtA, i, uint64(len(m.ApiAddress)))
   180  		i--
   181  		dAtA[i] = 0x22
   182  	}
   183  	if m.ApiPort != 0 {
   184  		i = encodeVarintDiscovery(dAtA, i, uint64(m.ApiPort))
   185  		i--
   186  		dAtA[i] = 0x18
   187  	}
   188  	if len(m.Version) > 0 {
   189  		i -= len(m.Version)
   190  		copy(dAtA[i:], m.Version)
   191  		i = encodeVarintDiscovery(dAtA, i, uint64(len(m.Version)))
   192  		i--
   193  		dAtA[i] = 0x12
   194  	}
   195  	if len(m.ApiVersion) > 0 {
   196  		i -= len(m.ApiVersion)
   197  		copy(dAtA[i:], m.ApiVersion)
   198  		i = encodeVarintDiscovery(dAtA, i, uint64(len(m.ApiVersion)))
   199  		i--
   200  		dAtA[i] = 0xa
   201  	}
   202  	return len(dAtA) - i, nil
   203  }
   204  
   205  func encodeVarintDiscovery(dAtA []byte, offset int, v uint64) int {
   206  	offset -= sovDiscovery(v)
   207  	base := offset
   208  	for v >= 1<<7 {
   209  		dAtA[offset] = uint8(v&0x7f | 0x80)
   210  		v >>= 7
   211  		offset++
   212  	}
   213  	dAtA[offset] = uint8(v)
   214  	return base
   215  }
   216  func (m *ServiceInfo) Size() (n int) {
   217  	if m == nil {
   218  		return 0
   219  	}
   220  	var l int
   221  	_ = l
   222  	l = len(m.ApiVersion)
   223  	if l > 0 {
   224  		n += 1 + l + sovDiscovery(uint64(l))
   225  	}
   226  	l = len(m.Version)
   227  	if l > 0 {
   228  		n += 1 + l + sovDiscovery(uint64(l))
   229  	}
   230  	if m.ApiPort != 0 {
   231  		n += 1 + sovDiscovery(uint64(m.ApiPort))
   232  	}
   233  	l = len(m.ApiAddress)
   234  	if l > 0 {
   235  		n += 1 + l + sovDiscovery(uint64(l))
   236  	}
   237  	if m.Secure {
   238  		n += 2
   239  	}
   240  	if m.XXX_unrecognized != nil {
   241  		n += len(m.XXX_unrecognized)
   242  	}
   243  	return n
   244  }
   245  
   246  func sovDiscovery(x uint64) (n int) {
   247  	return (math_bits.Len64(x|1) + 6) / 7
   248  }
   249  func sozDiscovery(x uint64) (n int) {
   250  	return sovDiscovery(uint64((x << 1) ^ uint64((int64(x) >> 63))))
   251  }
   252  func (m *ServiceInfo) Unmarshal(dAtA []byte) error {
   253  	l := len(dAtA)
   254  	iNdEx := 0
   255  	for iNdEx < l {
   256  		preIndex := iNdEx
   257  		var wire uint64
   258  		for shift := uint(0); ; shift += 7 {
   259  			if shift >= 64 {
   260  				return ErrIntOverflowDiscovery
   261  			}
   262  			if iNdEx >= l {
   263  				return io.ErrUnexpectedEOF
   264  			}
   265  			b := dAtA[iNdEx]
   266  			iNdEx++
   267  			wire |= uint64(b&0x7F) << shift
   268  			if b < 0x80 {
   269  				break
   270  			}
   271  		}
   272  		fieldNum := int32(wire >> 3)
   273  		wireType := int(wire & 0x7)
   274  		if wireType == 4 {
   275  			return fmt.Errorf("proto: ServiceInfo: wiretype end group for non-group")
   276  		}
   277  		if fieldNum <= 0 {
   278  			return fmt.Errorf("proto: ServiceInfo: illegal tag %d (wire type %d)", fieldNum, wire)
   279  		}
   280  		switch fieldNum {
   281  		case 1:
   282  			if wireType != 2 {
   283  				return fmt.Errorf("proto: wrong wireType = %d for field ApiVersion", wireType)
   284  			}
   285  			var stringLen uint64
   286  			for shift := uint(0); ; shift += 7 {
   287  				if shift >= 64 {
   288  					return ErrIntOverflowDiscovery
   289  				}
   290  				if iNdEx >= l {
   291  					return io.ErrUnexpectedEOF
   292  				}
   293  				b := dAtA[iNdEx]
   294  				iNdEx++
   295  				stringLen |= uint64(b&0x7F) << shift
   296  				if b < 0x80 {
   297  					break
   298  				}
   299  			}
   300  			intStringLen := int(stringLen)
   301  			if intStringLen < 0 {
   302  				return ErrInvalidLengthDiscovery
   303  			}
   304  			postIndex := iNdEx + intStringLen
   305  			if postIndex < 0 {
   306  				return ErrInvalidLengthDiscovery
   307  			}
   308  			if postIndex > l {
   309  				return io.ErrUnexpectedEOF
   310  			}
   311  			m.ApiVersion = string(dAtA[iNdEx:postIndex])
   312  			iNdEx = postIndex
   313  		case 2:
   314  			if wireType != 2 {
   315  				return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType)
   316  			}
   317  			var stringLen uint64
   318  			for shift := uint(0); ; shift += 7 {
   319  				if shift >= 64 {
   320  					return ErrIntOverflowDiscovery
   321  				}
   322  				if iNdEx >= l {
   323  					return io.ErrUnexpectedEOF
   324  				}
   325  				b := dAtA[iNdEx]
   326  				iNdEx++
   327  				stringLen |= uint64(b&0x7F) << shift
   328  				if b < 0x80 {
   329  					break
   330  				}
   331  			}
   332  			intStringLen := int(stringLen)
   333  			if intStringLen < 0 {
   334  				return ErrInvalidLengthDiscovery
   335  			}
   336  			postIndex := iNdEx + intStringLen
   337  			if postIndex < 0 {
   338  				return ErrInvalidLengthDiscovery
   339  			}
   340  			if postIndex > l {
   341  				return io.ErrUnexpectedEOF
   342  			}
   343  			m.Version = string(dAtA[iNdEx:postIndex])
   344  			iNdEx = postIndex
   345  		case 3:
   346  			if wireType != 0 {
   347  				return fmt.Errorf("proto: wrong wireType = %d for field ApiPort", wireType)
   348  			}
   349  			m.ApiPort = 0
   350  			for shift := uint(0); ; shift += 7 {
   351  				if shift >= 64 {
   352  					return ErrIntOverflowDiscovery
   353  				}
   354  				if iNdEx >= l {
   355  					return io.ErrUnexpectedEOF
   356  				}
   357  				b := dAtA[iNdEx]
   358  				iNdEx++
   359  				m.ApiPort |= int32(b&0x7F) << shift
   360  				if b < 0x80 {
   361  					break
   362  				}
   363  			}
   364  		case 4:
   365  			if wireType != 2 {
   366  				return fmt.Errorf("proto: wrong wireType = %d for field ApiAddress", wireType)
   367  			}
   368  			var stringLen uint64
   369  			for shift := uint(0); ; shift += 7 {
   370  				if shift >= 64 {
   371  					return ErrIntOverflowDiscovery
   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 ErrInvalidLengthDiscovery
   386  			}
   387  			postIndex := iNdEx + intStringLen
   388  			if postIndex < 0 {
   389  				return ErrInvalidLengthDiscovery
   390  			}
   391  			if postIndex > l {
   392  				return io.ErrUnexpectedEOF
   393  			}
   394  			m.ApiAddress = string(dAtA[iNdEx:postIndex])
   395  			iNdEx = postIndex
   396  		case 5:
   397  			if wireType != 0 {
   398  				return fmt.Errorf("proto: wrong wireType = %d for field Secure", wireType)
   399  			}
   400  			var v int
   401  			for shift := uint(0); ; shift += 7 {
   402  				if shift >= 64 {
   403  					return ErrIntOverflowDiscovery
   404  				}
   405  				if iNdEx >= l {
   406  					return io.ErrUnexpectedEOF
   407  				}
   408  				b := dAtA[iNdEx]
   409  				iNdEx++
   410  				v |= int(b&0x7F) << shift
   411  				if b < 0x80 {
   412  					break
   413  				}
   414  			}
   415  			m.Secure = bool(v != 0)
   416  		default:
   417  			iNdEx = preIndex
   418  			skippy, err := skipDiscovery(dAtA[iNdEx:])
   419  			if err != nil {
   420  				return err
   421  			}
   422  			if (skippy < 0) || (iNdEx+skippy) < 0 {
   423  				return ErrInvalidLengthDiscovery
   424  			}
   425  			if (iNdEx + skippy) > l {
   426  				return io.ErrUnexpectedEOF
   427  			}
   428  			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
   429  			iNdEx += skippy
   430  		}
   431  	}
   432  
   433  	if iNdEx > l {
   434  		return io.ErrUnexpectedEOF
   435  	}
   436  	return nil
   437  }
   438  func skipDiscovery(dAtA []byte) (n int, err error) {
   439  	l := len(dAtA)
   440  	iNdEx := 0
   441  	depth := 0
   442  	for iNdEx < l {
   443  		var wire uint64
   444  		for shift := uint(0); ; shift += 7 {
   445  			if shift >= 64 {
   446  				return 0, ErrIntOverflowDiscovery
   447  			}
   448  			if iNdEx >= l {
   449  				return 0, io.ErrUnexpectedEOF
   450  			}
   451  			b := dAtA[iNdEx]
   452  			iNdEx++
   453  			wire |= (uint64(b) & 0x7F) << shift
   454  			if b < 0x80 {
   455  				break
   456  			}
   457  		}
   458  		wireType := int(wire & 0x7)
   459  		switch wireType {
   460  		case 0:
   461  			for shift := uint(0); ; shift += 7 {
   462  				if shift >= 64 {
   463  					return 0, ErrIntOverflowDiscovery
   464  				}
   465  				if iNdEx >= l {
   466  					return 0, io.ErrUnexpectedEOF
   467  				}
   468  				iNdEx++
   469  				if dAtA[iNdEx-1] < 0x80 {
   470  					break
   471  				}
   472  			}
   473  		case 1:
   474  			iNdEx += 8
   475  		case 2:
   476  			var length int
   477  			for shift := uint(0); ; shift += 7 {
   478  				if shift >= 64 {
   479  					return 0, ErrIntOverflowDiscovery
   480  				}
   481  				if iNdEx >= l {
   482  					return 0, io.ErrUnexpectedEOF
   483  				}
   484  				b := dAtA[iNdEx]
   485  				iNdEx++
   486  				length |= (int(b) & 0x7F) << shift
   487  				if b < 0x80 {
   488  					break
   489  				}
   490  			}
   491  			if length < 0 {
   492  				return 0, ErrInvalidLengthDiscovery
   493  			}
   494  			iNdEx += length
   495  		case 3:
   496  			depth++
   497  		case 4:
   498  			if depth == 0 {
   499  				return 0, ErrUnexpectedEndOfGroupDiscovery
   500  			}
   501  			depth--
   502  		case 5:
   503  			iNdEx += 4
   504  		default:
   505  			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
   506  		}
   507  		if iNdEx < 0 {
   508  			return 0, ErrInvalidLengthDiscovery
   509  		}
   510  		if depth == 0 {
   511  			return iNdEx, nil
   512  		}
   513  	}
   514  	return 0, io.ErrUnexpectedEOF
   515  }
   516  
   517  var (
   518  	ErrInvalidLengthDiscovery        = fmt.Errorf("proto: negative length found during unmarshaling")
   519  	ErrIntOverflowDiscovery          = fmt.Errorf("proto: integer overflow")
   520  	ErrUnexpectedEndOfGroupDiscovery = fmt.Errorf("proto: unexpected end of group")
   521  )