agent.pb.go 28 KB

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