github.com/khulnasoft-lab/khulnasoft@v26.0.1-0.20240328202558-330a6f959fe0+incompatible/libnetwork/agent.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: agent.proto 3 4 package libnetwork 5 6 import ( 7 fmt "fmt" 8 _ "github.com/gogo/protobuf/gogoproto" 9 proto "github.com/gogo/protobuf/proto" 10 io "io" 11 math "math" 12 math_bits "math/bits" 13 reflect "reflect" 14 strings "strings" 15 ) 16 17 // Reference imports to suppress errors if they are not otherwise used. 18 var _ = proto.Marshal 19 var _ = fmt.Errorf 20 var _ = math.Inf 21 22 // This is a compile-time assertion to ensure that this generated file 23 // is compatible with the proto package it is being compiled against. 24 // A compilation error at this line likely means your copy of the 25 // proto package needs to be updated. 26 const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package 27 28 type PortConfig_Protocol int32 29 30 const ( 31 ProtocolTCP PortConfig_Protocol = 0 32 ProtocolUDP PortConfig_Protocol = 1 33 ProtocolSCTP PortConfig_Protocol = 2 34 ) 35 36 var PortConfig_Protocol_name = map[int32]string{ 37 0: "TCP", 38 1: "UDP", 39 2: "SCTP", 40 } 41 42 var PortConfig_Protocol_value = map[string]int32{ 43 "TCP": 0, 44 "UDP": 1, 45 "SCTP": 2, 46 } 47 48 func (x PortConfig_Protocol) String() string { 49 return proto.EnumName(PortConfig_Protocol_name, int32(x)) 50 } 51 52 func (PortConfig_Protocol) EnumDescriptor() ([]byte, []int) { 53 return fileDescriptor_56ede974c0020f77, []int{1, 0} 54 } 55 56 // EndpointRecord specifies all the endpoint specific information that 57 // needs to gossiped to nodes participating in the network. 58 type EndpointRecord struct { 59 // Name of the container 60 Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` 61 // Service name of the service to which this endpoint belongs. 62 ServiceName string `protobuf:"bytes,2,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` 63 // Service ID of the service to which this endpoint belongs. 64 ServiceID string `protobuf:"bytes,3,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` 65 // Virtual IP of the service to which this endpoint belongs. 66 VirtualIP string `protobuf:"bytes,4,opt,name=virtual_ip,json=virtualIp,proto3" json:"virtual_ip,omitempty"` 67 // IP assigned to this endpoint. 68 EndpointIP string `protobuf:"bytes,5,opt,name=endpoint_ip,json=endpointIp,proto3" json:"endpoint_ip,omitempty"` 69 // IngressPorts exposed by the service to which this endpoint belongs. 70 IngressPorts []*PortConfig `protobuf:"bytes,6,rep,name=ingress_ports,json=ingressPorts,proto3" json:"ingress_ports,omitempty"` 71 // A list of aliases which are alternate names for the service 72 Aliases []string `protobuf:"bytes,7,rep,name=aliases,proto3" json:"aliases,omitempty"` 73 // List of aliases task specific aliases 74 TaskAliases []string `protobuf:"bytes,8,rep,name=task_aliases,json=taskAliases,proto3" json:"task_aliases,omitempty"` 75 // Whether this enpoint's service has been disabled 76 ServiceDisabled bool `protobuf:"varint,9,opt,name=service_disabled,json=serviceDisabled,proto3" json:"service_disabled,omitempty"` 77 } 78 79 func (m *EndpointRecord) Reset() { *m = EndpointRecord{} } 80 func (*EndpointRecord) ProtoMessage() {} 81 func (*EndpointRecord) Descriptor() ([]byte, []int) { 82 return fileDescriptor_56ede974c0020f77, []int{0} 83 } 84 func (m *EndpointRecord) XXX_Unmarshal(b []byte) error { 85 return m.Unmarshal(b) 86 } 87 func (m *EndpointRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 88 if deterministic { 89 return xxx_messageInfo_EndpointRecord.Marshal(b, m, deterministic) 90 } else { 91 b = b[:cap(b)] 92 n, err := m.MarshalToSizedBuffer(b) 93 if err != nil { 94 return nil, err 95 } 96 return b[:n], nil 97 } 98 } 99 func (m *EndpointRecord) XXX_Merge(src proto.Message) { 100 xxx_messageInfo_EndpointRecord.Merge(m, src) 101 } 102 func (m *EndpointRecord) XXX_Size() int { 103 return m.Size() 104 } 105 func (m *EndpointRecord) XXX_DiscardUnknown() { 106 xxx_messageInfo_EndpointRecord.DiscardUnknown(m) 107 } 108 109 var xxx_messageInfo_EndpointRecord proto.InternalMessageInfo 110 111 func (m *EndpointRecord) GetName() string { 112 if m != nil { 113 return m.Name 114 } 115 return "" 116 } 117 118 func (m *EndpointRecord) GetServiceName() string { 119 if m != nil { 120 return m.ServiceName 121 } 122 return "" 123 } 124 125 func (m *EndpointRecord) GetServiceID() string { 126 if m != nil { 127 return m.ServiceID 128 } 129 return "" 130 } 131 132 func (m *EndpointRecord) GetVirtualIP() string { 133 if m != nil { 134 return m.VirtualIP 135 } 136 return "" 137 } 138 139 func (m *EndpointRecord) GetEndpointIP() string { 140 if m != nil { 141 return m.EndpointIP 142 } 143 return "" 144 } 145 146 func (m *EndpointRecord) GetIngressPorts() []*PortConfig { 147 if m != nil { 148 return m.IngressPorts 149 } 150 return nil 151 } 152 153 func (m *EndpointRecord) GetAliases() []string { 154 if m != nil { 155 return m.Aliases 156 } 157 return nil 158 } 159 160 func (m *EndpointRecord) GetTaskAliases() []string { 161 if m != nil { 162 return m.TaskAliases 163 } 164 return nil 165 } 166 167 func (m *EndpointRecord) GetServiceDisabled() bool { 168 if m != nil { 169 return m.ServiceDisabled 170 } 171 return false 172 } 173 174 // PortConfig specifies an exposed port which can be 175 // addressed using the given name. This can be later queried 176 // using a service discovery api or a DNS SRV query. The node 177 // port specifies a port that can be used to address this 178 // service external to the cluster by sending a connection 179 // request to this port to any node on the cluster. 180 type PortConfig struct { 181 // Name for the port. If provided the port information can 182 // be queried using the name as in a DNS SRV query. 183 Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` 184 // Protocol for the port which is exposed. 185 Protocol PortConfig_Protocol `protobuf:"varint,2,opt,name=protocol,proto3,enum=libnetwork.PortConfig_Protocol" json:"protocol,omitempty"` 186 // The port which the application is exposing and is bound to. 187 TargetPort uint32 `protobuf:"varint,3,opt,name=target_port,json=targetPort,proto3" json:"target_port,omitempty"` 188 // PublishedPort specifies the port on which the service is 189 // exposed on all nodes on the cluster. If not specified an 190 // arbitrary port in the node port range is allocated by the 191 // system. If specified it should be within the node port 192 // range and it should be available. 193 PublishedPort uint32 `protobuf:"varint,4,opt,name=published_port,json=publishedPort,proto3" json:"published_port,omitempty"` 194 } 195 196 func (m *PortConfig) Reset() { *m = PortConfig{} } 197 func (*PortConfig) ProtoMessage() {} 198 func (*PortConfig) Descriptor() ([]byte, []int) { 199 return fileDescriptor_56ede974c0020f77, []int{1} 200 } 201 func (m *PortConfig) XXX_Unmarshal(b []byte) error { 202 return m.Unmarshal(b) 203 } 204 func (m *PortConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 205 if deterministic { 206 return xxx_messageInfo_PortConfig.Marshal(b, m, deterministic) 207 } else { 208 b = b[:cap(b)] 209 n, err := m.MarshalToSizedBuffer(b) 210 if err != nil { 211 return nil, err 212 } 213 return b[:n], nil 214 } 215 } 216 func (m *PortConfig) XXX_Merge(src proto.Message) { 217 xxx_messageInfo_PortConfig.Merge(m, src) 218 } 219 func (m *PortConfig) XXX_Size() int { 220 return m.Size() 221 } 222 func (m *PortConfig) XXX_DiscardUnknown() { 223 xxx_messageInfo_PortConfig.DiscardUnknown(m) 224 } 225 226 var xxx_messageInfo_PortConfig proto.InternalMessageInfo 227 228 func (m *PortConfig) GetName() string { 229 if m != nil { 230 return m.Name 231 } 232 return "" 233 } 234 235 func (m *PortConfig) GetProtocol() PortConfig_Protocol { 236 if m != nil { 237 return m.Protocol 238 } 239 return ProtocolTCP 240 } 241 242 func (m *PortConfig) GetTargetPort() uint32 { 243 if m != nil { 244 return m.TargetPort 245 } 246 return 0 247 } 248 249 func (m *PortConfig) GetPublishedPort() uint32 { 250 if m != nil { 251 return m.PublishedPort 252 } 253 return 0 254 } 255 256 func init() { 257 proto.RegisterEnum("libnetwork.PortConfig_Protocol", PortConfig_Protocol_name, PortConfig_Protocol_value) 258 proto.RegisterType((*EndpointRecord)(nil), "libnetwork.EndpointRecord") 259 proto.RegisterType((*PortConfig)(nil), "libnetwork.PortConfig") 260 } 261 262 func init() { proto.RegisterFile("agent.proto", fileDescriptor_56ede974c0020f77) } 263 264 var fileDescriptor_56ede974c0020f77 = []byte{ 265 // 486 bytes of a gzipped FileDescriptorProto 266 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0x31, 0x6f, 0xd3, 0x40, 267 0x18, 0x86, 0xed, 0x24, 0xb4, 0xf1, 0xe7, 0x24, 0x8d, 0x6e, 0x40, 0x56, 0x86, 0x8b, 0x89, 0x40, 268 0x0a, 0x12, 0x38, 0x52, 0x19, 0x3b, 0xd1, 0x84, 0xc1, 0x0b, 0xb2, 0xae, 0x29, 0x6b, 0xb0, 0xe3, 269 0xab, 0x7b, 0xaa, 0xeb, 0xb3, 0x7c, 0x97, 0xb2, 0xb2, 0x81, 0x3a, 0xf1, 0x07, 0x3a, 0xf1, 0x67, 270 0x18, 0x3b, 0x76, 0xaa, 0xa8, 0xf3, 0x07, 0x58, 0xd9, 0xd0, 0x9d, 0xed, 0x46, 0x48, 0xdd, 0x7c, 271 0xcf, 0xfb, 0x7c, 0xd6, 0x77, 0xef, 0x81, 0x1d, 0x26, 0x34, 0x93, 0x5e, 0x5e, 0x70, 0xc9, 0x11, 272 0xa4, 0x2c, 0xca, 0xa8, 0xfc, 0xc2, 0x8b, 0x8b, 0xd1, 0xdb, 0x84, 0xc9, 0xf3, 0x4d, 0xe4, 0xad, 273 0xf9, 0xe5, 0x2c, 0xe1, 0x09, 0x9f, 0x69, 0x25, 0xda, 0x9c, 0xe9, 0x93, 0x3e, 0xe8, 0xaf, 0x6a, 274 0x74, 0xf2, 0xb7, 0x05, 0x83, 0x0f, 0x59, 0x9c, 0x73, 0x96, 0x49, 0x42, 0xd7, 0xbc, 0x88, 0x11, 275 0x82, 0x4e, 0x16, 0x5e, 0x52, 0xc7, 0x74, 0xcd, 0xa9, 0x45, 0xf4, 0x37, 0x7a, 0x01, 0x3d, 0x41, 276 0x8b, 0x2b, 0xb6, 0xa6, 0x2b, 0x9d, 0xb5, 0x74, 0x66, 0xd7, 0xec, 0xa3, 0x52, 0xde, 0x00, 0x34, 277 0x0a, 0x8b, 0x9d, 0xb6, 0x12, 0x8e, 0xfb, 0xe5, 0xfd, 0xd8, 0x3a, 0xa9, 0xa8, 0xbf, 0x20, 0x56, 278 0x2d, 0xf8, 0xb1, 0xb2, 0xaf, 0x58, 0x21, 0x37, 0x61, 0xba, 0x62, 0xb9, 0xd3, 0xd9, 0xd9, 0x9f, 279 0x2a, 0xea, 0x07, 0xc4, 0xaa, 0x05, 0x3f, 0x47, 0x33, 0xb0, 0x69, 0xbd, 0xa4, 0xd2, 0x9f, 0x69, 280 0x7d, 0x50, 0xde, 0x8f, 0xa1, 0xd9, 0xdd, 0x0f, 0x08, 0x34, 0x8a, 0x9f, 0xa3, 0x23, 0xe8, 0xb3, 281 0x2c, 0x29, 0xa8, 0x10, 0xab, 0x9c, 0x17, 0x52, 0x38, 0x7b, 0x6e, 0x7b, 0x6a, 0x1f, 0x3e, 0xf7, 282 0x76, 0x4d, 0x79, 0x01, 0x2f, 0xe4, 0x9c, 0x67, 0x67, 0x2c, 0x21, 0xbd, 0x5a, 0x56, 0x48, 0x20, 283 0x07, 0xf6, 0xc3, 0x94, 0x85, 0x82, 0x0a, 0x67, 0xdf, 0x6d, 0x4f, 0x2d, 0xd2, 0x1c, 0x55, 0x0d, 284 0x32, 0x14, 0x17, 0xab, 0x26, 0xee, 0xea, 0xd8, 0x56, 0xec, 0x7d, 0xad, 0xbc, 0x86, 0x61, 0x53, 285 0x43, 0xcc, 0x44, 0x18, 0xa5, 0x34, 0x76, 0x2c, 0xd7, 0x9c, 0x76, 0xc9, 0x41, 0xcd, 0x17, 0x35, 286 0x9e, 0x7c, 0x6b, 0x01, 0xec, 0x96, 0x78, 0xb2, 0xf7, 0x23, 0xe8, 0xea, 0x77, 0x5a, 0xf3, 0x54, 287 0x77, 0x3e, 0x38, 0x1c, 0x3f, 0x7d, 0x05, 0x2f, 0xa8, 0x35, 0xf2, 0x38, 0x80, 0xc6, 0x60, 0xcb, 288 0xb0, 0x48, 0xa8, 0xd4, 0x1d, 0xe8, 0x27, 0xe9, 0x13, 0xa8, 0x90, 0x9a, 0x44, 0xaf, 0x60, 0x90, 289 0x6f, 0xa2, 0x94, 0x89, 0x73, 0x1a, 0x57, 0x4e, 0x47, 0x3b, 0xfd, 0x47, 0xaa, 0xb4, 0xc9, 0x67, 290 0xe8, 0x36, 0x7f, 0x47, 0x0e, 0xb4, 0x97, 0xf3, 0x60, 0x68, 0x8c, 0x0e, 0xae, 0x6f, 0x5c, 0xbb, 291 0xc1, 0xcb, 0x79, 0xa0, 0x92, 0xd3, 0x45, 0x30, 0x34, 0xff, 0x4f, 0x4e, 0x17, 0x01, 0x1a, 0x41, 292 0xe7, 0x64, 0xbe, 0x0c, 0x86, 0xad, 0xd1, 0xf0, 0xfa, 0xc6, 0xed, 0x35, 0x91, 0x62, 0xa3, 0xce, 293 0xf7, 0x9f, 0xd8, 0x38, 0x7e, 0x79, 0xf7, 0x80, 0x8d, 0x3f, 0x0f, 0xd8, 0xfc, 0x5a, 0x62, 0xf3, 294 0x57, 0x89, 0xcd, 0xdb, 0x12, 0x9b, 0xbf, 0x4b, 0x6c, 0xfe, 0xd8, 0x62, 0xe3, 0x76, 0x8b, 0x8d, 295 0xbb, 0x2d, 0x36, 0xa2, 0x3d, 0x7d, 0xb3, 0x77, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0xc0, 0xc6, 296 0x3a, 0x88, 0xfc, 0x02, 0x00, 0x00, 297 } 298 299 func (this *EndpointRecord) GoString() string { 300 if this == nil { 301 return "nil" 302 } 303 s := make([]string, 0, 13) 304 s = append(s, "&libnetwork.EndpointRecord{") 305 s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") 306 s = append(s, "ServiceName: "+fmt.Sprintf("%#v", this.ServiceName)+",\n") 307 s = append(s, "ServiceID: "+fmt.Sprintf("%#v", this.ServiceID)+",\n") 308 s = append(s, "VirtualIP: "+fmt.Sprintf("%#v", this.VirtualIP)+",\n") 309 s = append(s, "EndpointIP: "+fmt.Sprintf("%#v", this.EndpointIP)+",\n") 310 if this.IngressPorts != nil { 311 s = append(s, "IngressPorts: "+fmt.Sprintf("%#v", this.IngressPorts)+",\n") 312 } 313 s = append(s, "Aliases: "+fmt.Sprintf("%#v", this.Aliases)+",\n") 314 s = append(s, "TaskAliases: "+fmt.Sprintf("%#v", this.TaskAliases)+",\n") 315 s = append(s, "ServiceDisabled: "+fmt.Sprintf("%#v", this.ServiceDisabled)+",\n") 316 s = append(s, "}") 317 return strings.Join(s, "") 318 } 319 func (this *PortConfig) GoString() string { 320 if this == nil { 321 return "nil" 322 } 323 s := make([]string, 0, 8) 324 s = append(s, "&libnetwork.PortConfig{") 325 s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") 326 s = append(s, "Protocol: "+fmt.Sprintf("%#v", this.Protocol)+",\n") 327 s = append(s, "TargetPort: "+fmt.Sprintf("%#v", this.TargetPort)+",\n") 328 s = append(s, "PublishedPort: "+fmt.Sprintf("%#v", this.PublishedPort)+",\n") 329 s = append(s, "}") 330 return strings.Join(s, "") 331 } 332 func valueToGoStringAgent(v interface{}, typ string) string { 333 rv := reflect.ValueOf(v) 334 if rv.IsNil() { 335 return "nil" 336 } 337 pv := reflect.Indirect(rv).Interface() 338 return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) 339 } 340 func (m *EndpointRecord) Marshal() (dAtA []byte, err error) { 341 size := m.Size() 342 dAtA = make([]byte, size) 343 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 344 if err != nil { 345 return nil, err 346 } 347 return dAtA[:n], nil 348 } 349 350 func (m *EndpointRecord) MarshalTo(dAtA []byte) (int, error) { 351 size := m.Size() 352 return m.MarshalToSizedBuffer(dAtA[:size]) 353 } 354 355 func (m *EndpointRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { 356 i := len(dAtA) 357 _ = i 358 var l int 359 _ = l 360 if m.ServiceDisabled { 361 i-- 362 if m.ServiceDisabled { 363 dAtA[i] = 1 364 } else { 365 dAtA[i] = 0 366 } 367 i-- 368 dAtA[i] = 0x48 369 } 370 if len(m.TaskAliases) > 0 { 371 for iNdEx := len(m.TaskAliases) - 1; iNdEx >= 0; iNdEx-- { 372 i -= len(m.TaskAliases[iNdEx]) 373 copy(dAtA[i:], m.TaskAliases[iNdEx]) 374 i = encodeVarintAgent(dAtA, i, uint64(len(m.TaskAliases[iNdEx]))) 375 i-- 376 dAtA[i] = 0x42 377 } 378 } 379 if len(m.Aliases) > 0 { 380 for iNdEx := len(m.Aliases) - 1; iNdEx >= 0; iNdEx-- { 381 i -= len(m.Aliases[iNdEx]) 382 copy(dAtA[i:], m.Aliases[iNdEx]) 383 i = encodeVarintAgent(dAtA, i, uint64(len(m.Aliases[iNdEx]))) 384 i-- 385 dAtA[i] = 0x3a 386 } 387 } 388 if len(m.IngressPorts) > 0 { 389 for iNdEx := len(m.IngressPorts) - 1; iNdEx >= 0; iNdEx-- { 390 { 391 size, err := m.IngressPorts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 392 if err != nil { 393 return 0, err 394 } 395 i -= size 396 i = encodeVarintAgent(dAtA, i, uint64(size)) 397 } 398 i-- 399 dAtA[i] = 0x32 400 } 401 } 402 if len(m.EndpointIP) > 0 { 403 i -= len(m.EndpointIP) 404 copy(dAtA[i:], m.EndpointIP) 405 i = encodeVarintAgent(dAtA, i, uint64(len(m.EndpointIP))) 406 i-- 407 dAtA[i] = 0x2a 408 } 409 if len(m.VirtualIP) > 0 { 410 i -= len(m.VirtualIP) 411 copy(dAtA[i:], m.VirtualIP) 412 i = encodeVarintAgent(dAtA, i, uint64(len(m.VirtualIP))) 413 i-- 414 dAtA[i] = 0x22 415 } 416 if len(m.ServiceID) > 0 { 417 i -= len(m.ServiceID) 418 copy(dAtA[i:], m.ServiceID) 419 i = encodeVarintAgent(dAtA, i, uint64(len(m.ServiceID))) 420 i-- 421 dAtA[i] = 0x1a 422 } 423 if len(m.ServiceName) > 0 { 424 i -= len(m.ServiceName) 425 copy(dAtA[i:], m.ServiceName) 426 i = encodeVarintAgent(dAtA, i, uint64(len(m.ServiceName))) 427 i-- 428 dAtA[i] = 0x12 429 } 430 if len(m.Name) > 0 { 431 i -= len(m.Name) 432 copy(dAtA[i:], m.Name) 433 i = encodeVarintAgent(dAtA, i, uint64(len(m.Name))) 434 i-- 435 dAtA[i] = 0xa 436 } 437 return len(dAtA) - i, nil 438 } 439 440 func (m *PortConfig) Marshal() (dAtA []byte, err error) { 441 size := m.Size() 442 dAtA = make([]byte, size) 443 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 444 if err != nil { 445 return nil, err 446 } 447 return dAtA[:n], nil 448 } 449 450 func (m *PortConfig) MarshalTo(dAtA []byte) (int, error) { 451 size := m.Size() 452 return m.MarshalToSizedBuffer(dAtA[:size]) 453 } 454 455 func (m *PortConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { 456 i := len(dAtA) 457 _ = i 458 var l int 459 _ = l 460 if m.PublishedPort != 0 { 461 i = encodeVarintAgent(dAtA, i, uint64(m.PublishedPort)) 462 i-- 463 dAtA[i] = 0x20 464 } 465 if m.TargetPort != 0 { 466 i = encodeVarintAgent(dAtA, i, uint64(m.TargetPort)) 467 i-- 468 dAtA[i] = 0x18 469 } 470 if m.Protocol != 0 { 471 i = encodeVarintAgent(dAtA, i, uint64(m.Protocol)) 472 i-- 473 dAtA[i] = 0x10 474 } 475 if len(m.Name) > 0 { 476 i -= len(m.Name) 477 copy(dAtA[i:], m.Name) 478 i = encodeVarintAgent(dAtA, i, uint64(len(m.Name))) 479 i-- 480 dAtA[i] = 0xa 481 } 482 return len(dAtA) - i, nil 483 } 484 485 func encodeVarintAgent(dAtA []byte, offset int, v uint64) int { 486 offset -= sovAgent(v) 487 base := offset 488 for v >= 1<<7 { 489 dAtA[offset] = uint8(v&0x7f | 0x80) 490 v >>= 7 491 offset++ 492 } 493 dAtA[offset] = uint8(v) 494 return base 495 } 496 func (m *EndpointRecord) Size() (n int) { 497 if m == nil { 498 return 0 499 } 500 var l int 501 _ = l 502 l = len(m.Name) 503 if l > 0 { 504 n += 1 + l + sovAgent(uint64(l)) 505 } 506 l = len(m.ServiceName) 507 if l > 0 { 508 n += 1 + l + sovAgent(uint64(l)) 509 } 510 l = len(m.ServiceID) 511 if l > 0 { 512 n += 1 + l + sovAgent(uint64(l)) 513 } 514 l = len(m.VirtualIP) 515 if l > 0 { 516 n += 1 + l + sovAgent(uint64(l)) 517 } 518 l = len(m.EndpointIP) 519 if l > 0 { 520 n += 1 + l + sovAgent(uint64(l)) 521 } 522 if len(m.IngressPorts) > 0 { 523 for _, e := range m.IngressPorts { 524 l = e.Size() 525 n += 1 + l + sovAgent(uint64(l)) 526 } 527 } 528 if len(m.Aliases) > 0 { 529 for _, s := range m.Aliases { 530 l = len(s) 531 n += 1 + l + sovAgent(uint64(l)) 532 } 533 } 534 if len(m.TaskAliases) > 0 { 535 for _, s := range m.TaskAliases { 536 l = len(s) 537 n += 1 + l + sovAgent(uint64(l)) 538 } 539 } 540 if m.ServiceDisabled { 541 n += 2 542 } 543 return n 544 } 545 546 func (m *PortConfig) Size() (n int) { 547 if m == nil { 548 return 0 549 } 550 var l int 551 _ = l 552 l = len(m.Name) 553 if l > 0 { 554 n += 1 + l + sovAgent(uint64(l)) 555 } 556 if m.Protocol != 0 { 557 n += 1 + sovAgent(uint64(m.Protocol)) 558 } 559 if m.TargetPort != 0 { 560 n += 1 + sovAgent(uint64(m.TargetPort)) 561 } 562 if m.PublishedPort != 0 { 563 n += 1 + sovAgent(uint64(m.PublishedPort)) 564 } 565 return n 566 } 567 568 func sovAgent(x uint64) (n int) { 569 return (math_bits.Len64(x|1) + 6) / 7 570 } 571 func sozAgent(x uint64) (n int) { 572 return sovAgent(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 573 } 574 func (this *EndpointRecord) String() string { 575 if this == nil { 576 return "nil" 577 } 578 repeatedStringForIngressPorts := "[]*PortConfig{" 579 for _, f := range this.IngressPorts { 580 repeatedStringForIngressPorts += strings.Replace(f.String(), "PortConfig", "PortConfig", 1) + "," 581 } 582 repeatedStringForIngressPorts += "}" 583 s := strings.Join([]string{`&EndpointRecord{`, 584 `Name:` + fmt.Sprintf("%v", this.Name) + `,`, 585 `ServiceName:` + fmt.Sprintf("%v", this.ServiceName) + `,`, 586 `ServiceID:` + fmt.Sprintf("%v", this.ServiceID) + `,`, 587 `VirtualIP:` + fmt.Sprintf("%v", this.VirtualIP) + `,`, 588 `EndpointIP:` + fmt.Sprintf("%v", this.EndpointIP) + `,`, 589 `IngressPorts:` + repeatedStringForIngressPorts + `,`, 590 `Aliases:` + fmt.Sprintf("%v", this.Aliases) + `,`, 591 `TaskAliases:` + fmt.Sprintf("%v", this.TaskAliases) + `,`, 592 `ServiceDisabled:` + fmt.Sprintf("%v", this.ServiceDisabled) + `,`, 593 `}`, 594 }, "") 595 return s 596 } 597 func (this *PortConfig) String() string { 598 if this == nil { 599 return "nil" 600 } 601 s := strings.Join([]string{`&PortConfig{`, 602 `Name:` + fmt.Sprintf("%v", this.Name) + `,`, 603 `Protocol:` + fmt.Sprintf("%v", this.Protocol) + `,`, 604 `TargetPort:` + fmt.Sprintf("%v", this.TargetPort) + `,`, 605 `PublishedPort:` + fmt.Sprintf("%v", this.PublishedPort) + `,`, 606 `}`, 607 }, "") 608 return s 609 } 610 func valueToStringAgent(v interface{}) string { 611 rv := reflect.ValueOf(v) 612 if rv.IsNil() { 613 return "nil" 614 } 615 pv := reflect.Indirect(rv).Interface() 616 return fmt.Sprintf("*%v", pv) 617 } 618 func (m *EndpointRecord) Unmarshal(dAtA []byte) error { 619 l := len(dAtA) 620 iNdEx := 0 621 for iNdEx < l { 622 preIndex := iNdEx 623 var wire uint64 624 for shift := uint(0); ; shift += 7 { 625 if shift >= 64 { 626 return ErrIntOverflowAgent 627 } 628 if iNdEx >= l { 629 return io.ErrUnexpectedEOF 630 } 631 b := dAtA[iNdEx] 632 iNdEx++ 633 wire |= uint64(b&0x7F) << shift 634 if b < 0x80 { 635 break 636 } 637 } 638 fieldNum := int32(wire >> 3) 639 wireType := int(wire & 0x7) 640 if wireType == 4 { 641 return fmt.Errorf("proto: EndpointRecord: wiretype end group for non-group") 642 } 643 if fieldNum <= 0 { 644 return fmt.Errorf("proto: EndpointRecord: illegal tag %d (wire type %d)", fieldNum, wire) 645 } 646 switch fieldNum { 647 case 1: 648 if wireType != 2 { 649 return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) 650 } 651 var stringLen uint64 652 for shift := uint(0); ; shift += 7 { 653 if shift >= 64 { 654 return ErrIntOverflowAgent 655 } 656 if iNdEx >= l { 657 return io.ErrUnexpectedEOF 658 } 659 b := dAtA[iNdEx] 660 iNdEx++ 661 stringLen |= uint64(b&0x7F) << shift 662 if b < 0x80 { 663 break 664 } 665 } 666 intStringLen := int(stringLen) 667 if intStringLen < 0 { 668 return ErrInvalidLengthAgent 669 } 670 postIndex := iNdEx + intStringLen 671 if postIndex < 0 { 672 return ErrInvalidLengthAgent 673 } 674 if postIndex > l { 675 return io.ErrUnexpectedEOF 676 } 677 m.Name = string(dAtA[iNdEx:postIndex]) 678 iNdEx = postIndex 679 case 2: 680 if wireType != 2 { 681 return fmt.Errorf("proto: wrong wireType = %d for field ServiceName", wireType) 682 } 683 var stringLen uint64 684 for shift := uint(0); ; shift += 7 { 685 if shift >= 64 { 686 return ErrIntOverflowAgent 687 } 688 if iNdEx >= l { 689 return io.ErrUnexpectedEOF 690 } 691 b := dAtA[iNdEx] 692 iNdEx++ 693 stringLen |= uint64(b&0x7F) << shift 694 if b < 0x80 { 695 break 696 } 697 } 698 intStringLen := int(stringLen) 699 if intStringLen < 0 { 700 return ErrInvalidLengthAgent 701 } 702 postIndex := iNdEx + intStringLen 703 if postIndex < 0 { 704 return ErrInvalidLengthAgent 705 } 706 if postIndex > l { 707 return io.ErrUnexpectedEOF 708 } 709 m.ServiceName = string(dAtA[iNdEx:postIndex]) 710 iNdEx = postIndex 711 case 3: 712 if wireType != 2 { 713 return fmt.Errorf("proto: wrong wireType = %d for field ServiceID", wireType) 714 } 715 var stringLen uint64 716 for shift := uint(0); ; shift += 7 { 717 if shift >= 64 { 718 return ErrIntOverflowAgent 719 } 720 if iNdEx >= l { 721 return io.ErrUnexpectedEOF 722 } 723 b := dAtA[iNdEx] 724 iNdEx++ 725 stringLen |= uint64(b&0x7F) << shift 726 if b < 0x80 { 727 break 728 } 729 } 730 intStringLen := int(stringLen) 731 if intStringLen < 0 { 732 return ErrInvalidLengthAgent 733 } 734 postIndex := iNdEx + intStringLen 735 if postIndex < 0 { 736 return ErrInvalidLengthAgent 737 } 738 if postIndex > l { 739 return io.ErrUnexpectedEOF 740 } 741 m.ServiceID = string(dAtA[iNdEx:postIndex]) 742 iNdEx = postIndex 743 case 4: 744 if wireType != 2 { 745 return fmt.Errorf("proto: wrong wireType = %d for field VirtualIP", wireType) 746 } 747 var stringLen uint64 748 for shift := uint(0); ; shift += 7 { 749 if shift >= 64 { 750 return ErrIntOverflowAgent 751 } 752 if iNdEx >= l { 753 return io.ErrUnexpectedEOF 754 } 755 b := dAtA[iNdEx] 756 iNdEx++ 757 stringLen |= uint64(b&0x7F) << shift 758 if b < 0x80 { 759 break 760 } 761 } 762 intStringLen := int(stringLen) 763 if intStringLen < 0 { 764 return ErrInvalidLengthAgent 765 } 766 postIndex := iNdEx + intStringLen 767 if postIndex < 0 { 768 return ErrInvalidLengthAgent 769 } 770 if postIndex > l { 771 return io.ErrUnexpectedEOF 772 } 773 m.VirtualIP = string(dAtA[iNdEx:postIndex]) 774 iNdEx = postIndex 775 case 5: 776 if wireType != 2 { 777 return fmt.Errorf("proto: wrong wireType = %d for field EndpointIP", wireType) 778 } 779 var stringLen uint64 780 for shift := uint(0); ; shift += 7 { 781 if shift >= 64 { 782 return ErrIntOverflowAgent 783 } 784 if iNdEx >= l { 785 return io.ErrUnexpectedEOF 786 } 787 b := dAtA[iNdEx] 788 iNdEx++ 789 stringLen |= uint64(b&0x7F) << shift 790 if b < 0x80 { 791 break 792 } 793 } 794 intStringLen := int(stringLen) 795 if intStringLen < 0 { 796 return ErrInvalidLengthAgent 797 } 798 postIndex := iNdEx + intStringLen 799 if postIndex < 0 { 800 return ErrInvalidLengthAgent 801 } 802 if postIndex > l { 803 return io.ErrUnexpectedEOF 804 } 805 m.EndpointIP = string(dAtA[iNdEx:postIndex]) 806 iNdEx = postIndex 807 case 6: 808 if wireType != 2 { 809 return fmt.Errorf("proto: wrong wireType = %d for field IngressPorts", wireType) 810 } 811 var msglen int 812 for shift := uint(0); ; shift += 7 { 813 if shift >= 64 { 814 return ErrIntOverflowAgent 815 } 816 if iNdEx >= l { 817 return io.ErrUnexpectedEOF 818 } 819 b := dAtA[iNdEx] 820 iNdEx++ 821 msglen |= int(b&0x7F) << shift 822 if b < 0x80 { 823 break 824 } 825 } 826 if msglen < 0 { 827 return ErrInvalidLengthAgent 828 } 829 postIndex := iNdEx + msglen 830 if postIndex < 0 { 831 return ErrInvalidLengthAgent 832 } 833 if postIndex > l { 834 return io.ErrUnexpectedEOF 835 } 836 m.IngressPorts = append(m.IngressPorts, &PortConfig{}) 837 if err := m.IngressPorts[len(m.IngressPorts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 838 return err 839 } 840 iNdEx = postIndex 841 case 7: 842 if wireType != 2 { 843 return fmt.Errorf("proto: wrong wireType = %d for field Aliases", wireType) 844 } 845 var stringLen uint64 846 for shift := uint(0); ; shift += 7 { 847 if shift >= 64 { 848 return ErrIntOverflowAgent 849 } 850 if iNdEx >= l { 851 return io.ErrUnexpectedEOF 852 } 853 b := dAtA[iNdEx] 854 iNdEx++ 855 stringLen |= uint64(b&0x7F) << shift 856 if b < 0x80 { 857 break 858 } 859 } 860 intStringLen := int(stringLen) 861 if intStringLen < 0 { 862 return ErrInvalidLengthAgent 863 } 864 postIndex := iNdEx + intStringLen 865 if postIndex < 0 { 866 return ErrInvalidLengthAgent 867 } 868 if postIndex > l { 869 return io.ErrUnexpectedEOF 870 } 871 m.Aliases = append(m.Aliases, string(dAtA[iNdEx:postIndex])) 872 iNdEx = postIndex 873 case 8: 874 if wireType != 2 { 875 return fmt.Errorf("proto: wrong wireType = %d for field TaskAliases", wireType) 876 } 877 var stringLen uint64 878 for shift := uint(0); ; shift += 7 { 879 if shift >= 64 { 880 return ErrIntOverflowAgent 881 } 882 if iNdEx >= l { 883 return io.ErrUnexpectedEOF 884 } 885 b := dAtA[iNdEx] 886 iNdEx++ 887 stringLen |= uint64(b&0x7F) << shift 888 if b < 0x80 { 889 break 890 } 891 } 892 intStringLen := int(stringLen) 893 if intStringLen < 0 { 894 return ErrInvalidLengthAgent 895 } 896 postIndex := iNdEx + intStringLen 897 if postIndex < 0 { 898 return ErrInvalidLengthAgent 899 } 900 if postIndex > l { 901 return io.ErrUnexpectedEOF 902 } 903 m.TaskAliases = append(m.TaskAliases, string(dAtA[iNdEx:postIndex])) 904 iNdEx = postIndex 905 case 9: 906 if wireType != 0 { 907 return fmt.Errorf("proto: wrong wireType = %d for field ServiceDisabled", wireType) 908 } 909 var v int 910 for shift := uint(0); ; shift += 7 { 911 if shift >= 64 { 912 return ErrIntOverflowAgent 913 } 914 if iNdEx >= l { 915 return io.ErrUnexpectedEOF 916 } 917 b := dAtA[iNdEx] 918 iNdEx++ 919 v |= int(b&0x7F) << shift 920 if b < 0x80 { 921 break 922 } 923 } 924 m.ServiceDisabled = bool(v != 0) 925 default: 926 iNdEx = preIndex 927 skippy, err := skipAgent(dAtA[iNdEx:]) 928 if err != nil { 929 return err 930 } 931 if (skippy < 0) || (iNdEx+skippy) < 0 { 932 return ErrInvalidLengthAgent 933 } 934 if (iNdEx + skippy) > l { 935 return io.ErrUnexpectedEOF 936 } 937 iNdEx += skippy 938 } 939 } 940 941 if iNdEx > l { 942 return io.ErrUnexpectedEOF 943 } 944 return nil 945 } 946 func (m *PortConfig) Unmarshal(dAtA []byte) error { 947 l := len(dAtA) 948 iNdEx := 0 949 for iNdEx < l { 950 preIndex := iNdEx 951 var wire uint64 952 for shift := uint(0); ; shift += 7 { 953 if shift >= 64 { 954 return ErrIntOverflowAgent 955 } 956 if iNdEx >= l { 957 return io.ErrUnexpectedEOF 958 } 959 b := dAtA[iNdEx] 960 iNdEx++ 961 wire |= uint64(b&0x7F) << shift 962 if b < 0x80 { 963 break 964 } 965 } 966 fieldNum := int32(wire >> 3) 967 wireType := int(wire & 0x7) 968 if wireType == 4 { 969 return fmt.Errorf("proto: PortConfig: wiretype end group for non-group") 970 } 971 if fieldNum <= 0 { 972 return fmt.Errorf("proto: PortConfig: illegal tag %d (wire type %d)", fieldNum, wire) 973 } 974 switch fieldNum { 975 case 1: 976 if wireType != 2 { 977 return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) 978 } 979 var stringLen uint64 980 for shift := uint(0); ; shift += 7 { 981 if shift >= 64 { 982 return ErrIntOverflowAgent 983 } 984 if iNdEx >= l { 985 return io.ErrUnexpectedEOF 986 } 987 b := dAtA[iNdEx] 988 iNdEx++ 989 stringLen |= uint64(b&0x7F) << shift 990 if b < 0x80 { 991 break 992 } 993 } 994 intStringLen := int(stringLen) 995 if intStringLen < 0 { 996 return ErrInvalidLengthAgent 997 } 998 postIndex := iNdEx + intStringLen 999 if postIndex < 0 { 1000 return ErrInvalidLengthAgent 1001 } 1002 if postIndex > l { 1003 return io.ErrUnexpectedEOF 1004 } 1005 m.Name = string(dAtA[iNdEx:postIndex]) 1006 iNdEx = postIndex 1007 case 2: 1008 if wireType != 0 { 1009 return fmt.Errorf("proto: wrong wireType = %d for field Protocol", wireType) 1010 } 1011 m.Protocol = 0 1012 for shift := uint(0); ; shift += 7 { 1013 if shift >= 64 { 1014 return ErrIntOverflowAgent 1015 } 1016 if iNdEx >= l { 1017 return io.ErrUnexpectedEOF 1018 } 1019 b := dAtA[iNdEx] 1020 iNdEx++ 1021 m.Protocol |= PortConfig_Protocol(b&0x7F) << shift 1022 if b < 0x80 { 1023 break 1024 } 1025 } 1026 case 3: 1027 if wireType != 0 { 1028 return fmt.Errorf("proto: wrong wireType = %d for field TargetPort", wireType) 1029 } 1030 m.TargetPort = 0 1031 for shift := uint(0); ; shift += 7 { 1032 if shift >= 64 { 1033 return ErrIntOverflowAgent 1034 } 1035 if iNdEx >= l { 1036 return io.ErrUnexpectedEOF 1037 } 1038 b := dAtA[iNdEx] 1039 iNdEx++ 1040 m.TargetPort |= uint32(b&0x7F) << shift 1041 if b < 0x80 { 1042 break 1043 } 1044 } 1045 case 4: 1046 if wireType != 0 { 1047 return fmt.Errorf("proto: wrong wireType = %d for field PublishedPort", wireType) 1048 } 1049 m.PublishedPort = 0 1050 for shift := uint(0); ; shift += 7 { 1051 if shift >= 64 { 1052 return ErrIntOverflowAgent 1053 } 1054 if iNdEx >= l { 1055 return io.ErrUnexpectedEOF 1056 } 1057 b := dAtA[iNdEx] 1058 iNdEx++ 1059 m.PublishedPort |= uint32(b&0x7F) << shift 1060 if b < 0x80 { 1061 break 1062 } 1063 } 1064 default: 1065 iNdEx = preIndex 1066 skippy, err := skipAgent(dAtA[iNdEx:]) 1067 if err != nil { 1068 return err 1069 } 1070 if (skippy < 0) || (iNdEx+skippy) < 0 { 1071 return ErrInvalidLengthAgent 1072 } 1073 if (iNdEx + skippy) > l { 1074 return io.ErrUnexpectedEOF 1075 } 1076 iNdEx += skippy 1077 } 1078 } 1079 1080 if iNdEx > l { 1081 return io.ErrUnexpectedEOF 1082 } 1083 return nil 1084 } 1085 func skipAgent(dAtA []byte) (n int, err error) { 1086 l := len(dAtA) 1087 iNdEx := 0 1088 depth := 0 1089 for iNdEx < l { 1090 var wire uint64 1091 for shift := uint(0); ; shift += 7 { 1092 if shift >= 64 { 1093 return 0, ErrIntOverflowAgent 1094 } 1095 if iNdEx >= l { 1096 return 0, io.ErrUnexpectedEOF 1097 } 1098 b := dAtA[iNdEx] 1099 iNdEx++ 1100 wire |= (uint64(b) & 0x7F) << shift 1101 if b < 0x80 { 1102 break 1103 } 1104 } 1105 wireType := int(wire & 0x7) 1106 switch wireType { 1107 case 0: 1108 for shift := uint(0); ; shift += 7 { 1109 if shift >= 64 { 1110 return 0, ErrIntOverflowAgent 1111 } 1112 if iNdEx >= l { 1113 return 0, io.ErrUnexpectedEOF 1114 } 1115 iNdEx++ 1116 if dAtA[iNdEx-1] < 0x80 { 1117 break 1118 } 1119 } 1120 case 1: 1121 iNdEx += 8 1122 case 2: 1123 var length int 1124 for shift := uint(0); ; shift += 7 { 1125 if shift >= 64 { 1126 return 0, ErrIntOverflowAgent 1127 } 1128 if iNdEx >= l { 1129 return 0, io.ErrUnexpectedEOF 1130 } 1131 b := dAtA[iNdEx] 1132 iNdEx++ 1133 length |= (int(b) & 0x7F) << shift 1134 if b < 0x80 { 1135 break 1136 } 1137 } 1138 if length < 0 { 1139 return 0, ErrInvalidLengthAgent 1140 } 1141 iNdEx += length 1142 case 3: 1143 depth++ 1144 case 4: 1145 if depth == 0 { 1146 return 0, ErrUnexpectedEndOfGroupAgent 1147 } 1148 depth-- 1149 case 5: 1150 iNdEx += 4 1151 default: 1152 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 1153 } 1154 if iNdEx < 0 { 1155 return 0, ErrInvalidLengthAgent 1156 } 1157 if depth == 0 { 1158 return iNdEx, nil 1159 } 1160 } 1161 return 0, io.ErrUnexpectedEOF 1162 } 1163 1164 var ( 1165 ErrInvalidLengthAgent = fmt.Errorf("proto: negative length found during unmarshaling") 1166 ErrIntOverflowAgent = fmt.Errorf("proto: integer overflow") 1167 ErrUnexpectedEndOfGroupAgent = fmt.Errorf("proto: unexpected end of group") 1168 )