agent.pb.go 30 KB

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