You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

840 lines
33 KiB

  1. // Code generated by protoc-gen-go. DO NOT EDIT.
  2. // source: grpc/lb/v1/load_balancer.proto
  3. package grpc_lb_v1 // import "google.golang.org/grpc/balancer/grpclb/grpc_lb_v1"
  4. import proto "github.com/golang/protobuf/proto"
  5. import fmt "fmt"
  6. import math "math"
  7. import duration "github.com/golang/protobuf/ptypes/duration"
  8. import timestamp "github.com/golang/protobuf/ptypes/timestamp"
  9. import (
  10. context "golang.org/x/net/context"
  11. grpc "google.golang.org/grpc"
  12. )
  13. // Reference imports to suppress errors if they are not otherwise used.
  14. var _ = proto.Marshal
  15. var _ = fmt.Errorf
  16. var _ = math.Inf
  17. // This is a compile-time assertion to ensure that this generated file
  18. // is compatible with the proto package it is being compiled against.
  19. // A compilation error at this line likely means your copy of the
  20. // proto package needs to be updated.
  21. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
  22. type LoadBalanceRequest struct {
  23. // Types that are valid to be assigned to LoadBalanceRequestType:
  24. // *LoadBalanceRequest_InitialRequest
  25. // *LoadBalanceRequest_ClientStats
  26. LoadBalanceRequestType isLoadBalanceRequest_LoadBalanceRequestType `protobuf_oneof:"load_balance_request_type"`
  27. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  28. XXX_unrecognized []byte `json:"-"`
  29. XXX_sizecache int32 `json:"-"`
  30. }
  31. func (m *LoadBalanceRequest) Reset() { *m = LoadBalanceRequest{} }
  32. func (m *LoadBalanceRequest) String() string { return proto.CompactTextString(m) }
  33. func (*LoadBalanceRequest) ProtoMessage() {}
  34. func (*LoadBalanceRequest) Descriptor() ([]byte, []int) {
  35. return fileDescriptor_load_balancer_12026aec3f0251ba, []int{0}
  36. }
  37. func (m *LoadBalanceRequest) XXX_Unmarshal(b []byte) error {
  38. return xxx_messageInfo_LoadBalanceRequest.Unmarshal(m, b)
  39. }
  40. func (m *LoadBalanceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  41. return xxx_messageInfo_LoadBalanceRequest.Marshal(b, m, deterministic)
  42. }
  43. func (dst *LoadBalanceRequest) XXX_Merge(src proto.Message) {
  44. xxx_messageInfo_LoadBalanceRequest.Merge(dst, src)
  45. }
  46. func (m *LoadBalanceRequest) XXX_Size() int {
  47. return xxx_messageInfo_LoadBalanceRequest.Size(m)
  48. }
  49. func (m *LoadBalanceRequest) XXX_DiscardUnknown() {
  50. xxx_messageInfo_LoadBalanceRequest.DiscardUnknown(m)
  51. }
  52. var xxx_messageInfo_LoadBalanceRequest proto.InternalMessageInfo
  53. type isLoadBalanceRequest_LoadBalanceRequestType interface {
  54. isLoadBalanceRequest_LoadBalanceRequestType()
  55. }
  56. type LoadBalanceRequest_InitialRequest struct {
  57. InitialRequest *InitialLoadBalanceRequest `protobuf:"bytes,1,opt,name=initial_request,json=initialRequest,proto3,oneof"`
  58. }
  59. type LoadBalanceRequest_ClientStats struct {
  60. ClientStats *ClientStats `protobuf:"bytes,2,opt,name=client_stats,json=clientStats,proto3,oneof"`
  61. }
  62. func (*LoadBalanceRequest_InitialRequest) isLoadBalanceRequest_LoadBalanceRequestType() {}
  63. func (*LoadBalanceRequest_ClientStats) isLoadBalanceRequest_LoadBalanceRequestType() {}
  64. func (m *LoadBalanceRequest) GetLoadBalanceRequestType() isLoadBalanceRequest_LoadBalanceRequestType {
  65. if m != nil {
  66. return m.LoadBalanceRequestType
  67. }
  68. return nil
  69. }
  70. func (m *LoadBalanceRequest) GetInitialRequest() *InitialLoadBalanceRequest {
  71. if x, ok := m.GetLoadBalanceRequestType().(*LoadBalanceRequest_InitialRequest); ok {
  72. return x.InitialRequest
  73. }
  74. return nil
  75. }
  76. func (m *LoadBalanceRequest) GetClientStats() *ClientStats {
  77. if x, ok := m.GetLoadBalanceRequestType().(*LoadBalanceRequest_ClientStats); ok {
  78. return x.ClientStats
  79. }
  80. return nil
  81. }
  82. // XXX_OneofFuncs is for the internal use of the proto package.
  83. func (*LoadBalanceRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
  84. return _LoadBalanceRequest_OneofMarshaler, _LoadBalanceRequest_OneofUnmarshaler, _LoadBalanceRequest_OneofSizer, []interface{}{
  85. (*LoadBalanceRequest_InitialRequest)(nil),
  86. (*LoadBalanceRequest_ClientStats)(nil),
  87. }
  88. }
  89. func _LoadBalanceRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
  90. m := msg.(*LoadBalanceRequest)
  91. // load_balance_request_type
  92. switch x := m.LoadBalanceRequestType.(type) {
  93. case *LoadBalanceRequest_InitialRequest:
  94. b.EncodeVarint(1<<3 | proto.WireBytes)
  95. if err := b.EncodeMessage(x.InitialRequest); err != nil {
  96. return err
  97. }
  98. case *LoadBalanceRequest_ClientStats:
  99. b.EncodeVarint(2<<3 | proto.WireBytes)
  100. if err := b.EncodeMessage(x.ClientStats); err != nil {
  101. return err
  102. }
  103. case nil:
  104. default:
  105. return fmt.Errorf("LoadBalanceRequest.LoadBalanceRequestType has unexpected type %T", x)
  106. }
  107. return nil
  108. }
  109. func _LoadBalanceRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
  110. m := msg.(*LoadBalanceRequest)
  111. switch tag {
  112. case 1: // load_balance_request_type.initial_request
  113. if wire != proto.WireBytes {
  114. return true, proto.ErrInternalBadWireType
  115. }
  116. msg := new(InitialLoadBalanceRequest)
  117. err := b.DecodeMessage(msg)
  118. m.LoadBalanceRequestType = &LoadBalanceRequest_InitialRequest{msg}
  119. return true, err
  120. case 2: // load_balance_request_type.client_stats
  121. if wire != proto.WireBytes {
  122. return true, proto.ErrInternalBadWireType
  123. }
  124. msg := new(ClientStats)
  125. err := b.DecodeMessage(msg)
  126. m.LoadBalanceRequestType = &LoadBalanceRequest_ClientStats{msg}
  127. return true, err
  128. default:
  129. return false, nil
  130. }
  131. }
  132. func _LoadBalanceRequest_OneofSizer(msg proto.Message) (n int) {
  133. m := msg.(*LoadBalanceRequest)
  134. // load_balance_request_type
  135. switch x := m.LoadBalanceRequestType.(type) {
  136. case *LoadBalanceRequest_InitialRequest:
  137. s := proto.Size(x.InitialRequest)
  138. n += 1 // tag and wire
  139. n += proto.SizeVarint(uint64(s))
  140. n += s
  141. case *LoadBalanceRequest_ClientStats:
  142. s := proto.Size(x.ClientStats)
  143. n += 1 // tag and wire
  144. n += proto.SizeVarint(uint64(s))
  145. n += s
  146. case nil:
  147. default:
  148. panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
  149. }
  150. return n
  151. }
  152. type InitialLoadBalanceRequest struct {
  153. // The name of the load balanced service (e.g., service.googleapis.com). Its
  154. // length should be less than 256 bytes.
  155. // The name might include a port number. How to handle the port number is up
  156. // to the balancer.
  157. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
  158. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  159. XXX_unrecognized []byte `json:"-"`
  160. XXX_sizecache int32 `json:"-"`
  161. }
  162. func (m *InitialLoadBalanceRequest) Reset() { *m = InitialLoadBalanceRequest{} }
  163. func (m *InitialLoadBalanceRequest) String() string { return proto.CompactTextString(m) }
  164. func (*InitialLoadBalanceRequest) ProtoMessage() {}
  165. func (*InitialLoadBalanceRequest) Descriptor() ([]byte, []int) {
  166. return fileDescriptor_load_balancer_12026aec3f0251ba, []int{1}
  167. }
  168. func (m *InitialLoadBalanceRequest) XXX_Unmarshal(b []byte) error {
  169. return xxx_messageInfo_InitialLoadBalanceRequest.Unmarshal(m, b)
  170. }
  171. func (m *InitialLoadBalanceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  172. return xxx_messageInfo_InitialLoadBalanceRequest.Marshal(b, m, deterministic)
  173. }
  174. func (dst *InitialLoadBalanceRequest) XXX_Merge(src proto.Message) {
  175. xxx_messageInfo_InitialLoadBalanceRequest.Merge(dst, src)
  176. }
  177. func (m *InitialLoadBalanceRequest) XXX_Size() int {
  178. return xxx_messageInfo_InitialLoadBalanceRequest.Size(m)
  179. }
  180. func (m *InitialLoadBalanceRequest) XXX_DiscardUnknown() {
  181. xxx_messageInfo_InitialLoadBalanceRequest.DiscardUnknown(m)
  182. }
  183. var xxx_messageInfo_InitialLoadBalanceRequest proto.InternalMessageInfo
  184. func (m *InitialLoadBalanceRequest) GetName() string {
  185. if m != nil {
  186. return m.Name
  187. }
  188. return ""
  189. }
  190. // Contains the number of calls finished for a particular load balance token.
  191. type ClientStatsPerToken struct {
  192. // See Server.load_balance_token.
  193. LoadBalanceToken string `protobuf:"bytes,1,opt,name=load_balance_token,json=loadBalanceToken,proto3" json:"load_balance_token,omitempty"`
  194. // The total number of RPCs that finished associated with the token.
  195. NumCalls int64 `protobuf:"varint,2,opt,name=num_calls,json=numCalls,proto3" json:"num_calls,omitempty"`
  196. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  197. XXX_unrecognized []byte `json:"-"`
  198. XXX_sizecache int32 `json:"-"`
  199. }
  200. func (m *ClientStatsPerToken) Reset() { *m = ClientStatsPerToken{} }
  201. func (m *ClientStatsPerToken) String() string { return proto.CompactTextString(m) }
  202. func (*ClientStatsPerToken) ProtoMessage() {}
  203. func (*ClientStatsPerToken) Descriptor() ([]byte, []int) {
  204. return fileDescriptor_load_balancer_12026aec3f0251ba, []int{2}
  205. }
  206. func (m *ClientStatsPerToken) XXX_Unmarshal(b []byte) error {
  207. return xxx_messageInfo_ClientStatsPerToken.Unmarshal(m, b)
  208. }
  209. func (m *ClientStatsPerToken) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  210. return xxx_messageInfo_ClientStatsPerToken.Marshal(b, m, deterministic)
  211. }
  212. func (dst *ClientStatsPerToken) XXX_Merge(src proto.Message) {
  213. xxx_messageInfo_ClientStatsPerToken.Merge(dst, src)
  214. }
  215. func (m *ClientStatsPerToken) XXX_Size() int {
  216. return xxx_messageInfo_ClientStatsPerToken.Size(m)
  217. }
  218. func (m *ClientStatsPerToken) XXX_DiscardUnknown() {
  219. xxx_messageInfo_ClientStatsPerToken.DiscardUnknown(m)
  220. }
  221. var xxx_messageInfo_ClientStatsPerToken proto.InternalMessageInfo
  222. func (m *ClientStatsPerToken) GetLoadBalanceToken() string {
  223. if m != nil {
  224. return m.LoadBalanceToken
  225. }
  226. return ""
  227. }
  228. func (m *ClientStatsPerToken) GetNumCalls() int64 {
  229. if m != nil {
  230. return m.NumCalls
  231. }
  232. return 0
  233. }
  234. // Contains client level statistics that are useful to load balancing. Each
  235. // count except the timestamp should be reset to zero after reporting the stats.
  236. type ClientStats struct {
  237. // The timestamp of generating the report.
  238. Timestamp *timestamp.Timestamp `protobuf:"bytes,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
  239. // The total number of RPCs that started.
  240. NumCallsStarted int64 `protobuf:"varint,2,opt,name=num_calls_started,json=numCallsStarted,proto3" json:"num_calls_started,omitempty"`
  241. // The total number of RPCs that finished.
  242. NumCallsFinished int64 `protobuf:"varint,3,opt,name=num_calls_finished,json=numCallsFinished,proto3" json:"num_calls_finished,omitempty"`
  243. // The total number of RPCs that failed to reach a server except dropped RPCs.
  244. NumCallsFinishedWithClientFailedToSend int64 `protobuf:"varint,6,opt,name=num_calls_finished_with_client_failed_to_send,json=numCallsFinishedWithClientFailedToSend,proto3" json:"num_calls_finished_with_client_failed_to_send,omitempty"`
  245. // The total number of RPCs that finished and are known to have been received
  246. // by a server.
  247. NumCallsFinishedKnownReceived int64 `protobuf:"varint,7,opt,name=num_calls_finished_known_received,json=numCallsFinishedKnownReceived,proto3" json:"num_calls_finished_known_received,omitempty"`
  248. // The list of dropped calls.
  249. CallsFinishedWithDrop []*ClientStatsPerToken `protobuf:"bytes,8,rep,name=calls_finished_with_drop,json=callsFinishedWithDrop,proto3" json:"calls_finished_with_drop,omitempty"`
  250. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  251. XXX_unrecognized []byte `json:"-"`
  252. XXX_sizecache int32 `json:"-"`
  253. }
  254. func (m *ClientStats) Reset() { *m = ClientStats{} }
  255. func (m *ClientStats) String() string { return proto.CompactTextString(m) }
  256. func (*ClientStats) ProtoMessage() {}
  257. func (*ClientStats) Descriptor() ([]byte, []int) {
  258. return fileDescriptor_load_balancer_12026aec3f0251ba, []int{3}
  259. }
  260. func (m *ClientStats) XXX_Unmarshal(b []byte) error {
  261. return xxx_messageInfo_ClientStats.Unmarshal(m, b)
  262. }
  263. func (m *ClientStats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  264. return xxx_messageInfo_ClientStats.Marshal(b, m, deterministic)
  265. }
  266. func (dst *ClientStats) XXX_Merge(src proto.Message) {
  267. xxx_messageInfo_ClientStats.Merge(dst, src)
  268. }
  269. func (m *ClientStats) XXX_Size() int {
  270. return xxx_messageInfo_ClientStats.Size(m)
  271. }
  272. func (m *ClientStats) XXX_DiscardUnknown() {
  273. xxx_messageInfo_ClientStats.DiscardUnknown(m)
  274. }
  275. var xxx_messageInfo_ClientStats proto.InternalMessageInfo
  276. func (m *ClientStats) GetTimestamp() *timestamp.Timestamp {
  277. if m != nil {
  278. return m.Timestamp
  279. }
  280. return nil
  281. }
  282. func (m *ClientStats) GetNumCallsStarted() int64 {
  283. if m != nil {
  284. return m.NumCallsStarted
  285. }
  286. return 0
  287. }
  288. func (m *ClientStats) GetNumCallsFinished() int64 {
  289. if m != nil {
  290. return m.NumCallsFinished
  291. }
  292. return 0
  293. }
  294. func (m *ClientStats) GetNumCallsFinishedWithClientFailedToSend() int64 {
  295. if m != nil {
  296. return m.NumCallsFinishedWithClientFailedToSend
  297. }
  298. return 0
  299. }
  300. func (m *ClientStats) GetNumCallsFinishedKnownReceived() int64 {
  301. if m != nil {
  302. return m.NumCallsFinishedKnownReceived
  303. }
  304. return 0
  305. }
  306. func (m *ClientStats) GetCallsFinishedWithDrop() []*ClientStatsPerToken {
  307. if m != nil {
  308. return m.CallsFinishedWithDrop
  309. }
  310. return nil
  311. }
  312. type LoadBalanceResponse struct {
  313. // Types that are valid to be assigned to LoadBalanceResponseType:
  314. // *LoadBalanceResponse_InitialResponse
  315. // *LoadBalanceResponse_ServerList
  316. LoadBalanceResponseType isLoadBalanceResponse_LoadBalanceResponseType `protobuf_oneof:"load_balance_response_type"`
  317. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  318. XXX_unrecognized []byte `json:"-"`
  319. XXX_sizecache int32 `json:"-"`
  320. }
  321. func (m *LoadBalanceResponse) Reset() { *m = LoadBalanceResponse{} }
  322. func (m *LoadBalanceResponse) String() string { return proto.CompactTextString(m) }
  323. func (*LoadBalanceResponse) ProtoMessage() {}
  324. func (*LoadBalanceResponse) Descriptor() ([]byte, []int) {
  325. return fileDescriptor_load_balancer_12026aec3f0251ba, []int{4}
  326. }
  327. func (m *LoadBalanceResponse) XXX_Unmarshal(b []byte) error {
  328. return xxx_messageInfo_LoadBalanceResponse.Unmarshal(m, b)
  329. }
  330. func (m *LoadBalanceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  331. return xxx_messageInfo_LoadBalanceResponse.Marshal(b, m, deterministic)
  332. }
  333. func (dst *LoadBalanceResponse) XXX_Merge(src proto.Message) {
  334. xxx_messageInfo_LoadBalanceResponse.Merge(dst, src)
  335. }
  336. func (m *LoadBalanceResponse) XXX_Size() int {
  337. return xxx_messageInfo_LoadBalanceResponse.Size(m)
  338. }
  339. func (m *LoadBalanceResponse) XXX_DiscardUnknown() {
  340. xxx_messageInfo_LoadBalanceResponse.DiscardUnknown(m)
  341. }
  342. var xxx_messageInfo_LoadBalanceResponse proto.InternalMessageInfo
  343. type isLoadBalanceResponse_LoadBalanceResponseType interface {
  344. isLoadBalanceResponse_LoadBalanceResponseType()
  345. }
  346. type LoadBalanceResponse_InitialResponse struct {
  347. InitialResponse *InitialLoadBalanceResponse `protobuf:"bytes,1,opt,name=initial_response,json=initialResponse,proto3,oneof"`
  348. }
  349. type LoadBalanceResponse_ServerList struct {
  350. ServerList *ServerList `protobuf:"bytes,2,opt,name=server_list,json=serverList,proto3,oneof"`
  351. }
  352. func (*LoadBalanceResponse_InitialResponse) isLoadBalanceResponse_LoadBalanceResponseType() {}
  353. func (*LoadBalanceResponse_ServerList) isLoadBalanceResponse_LoadBalanceResponseType() {}
  354. func (m *LoadBalanceResponse) GetLoadBalanceResponseType() isLoadBalanceResponse_LoadBalanceResponseType {
  355. if m != nil {
  356. return m.LoadBalanceResponseType
  357. }
  358. return nil
  359. }
  360. func (m *LoadBalanceResponse) GetInitialResponse() *InitialLoadBalanceResponse {
  361. if x, ok := m.GetLoadBalanceResponseType().(*LoadBalanceResponse_InitialResponse); ok {
  362. return x.InitialResponse
  363. }
  364. return nil
  365. }
  366. func (m *LoadBalanceResponse) GetServerList() *ServerList {
  367. if x, ok := m.GetLoadBalanceResponseType().(*LoadBalanceResponse_ServerList); ok {
  368. return x.ServerList
  369. }
  370. return nil
  371. }
  372. // XXX_OneofFuncs is for the internal use of the proto package.
  373. func (*LoadBalanceResponse) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
  374. return _LoadBalanceResponse_OneofMarshaler, _LoadBalanceResponse_OneofUnmarshaler, _LoadBalanceResponse_OneofSizer, []interface{}{
  375. (*LoadBalanceResponse_InitialResponse)(nil),
  376. (*LoadBalanceResponse_ServerList)(nil),
  377. }
  378. }
  379. func _LoadBalanceResponse_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
  380. m := msg.(*LoadBalanceResponse)
  381. // load_balance_response_type
  382. switch x := m.LoadBalanceResponseType.(type) {
  383. case *LoadBalanceResponse_InitialResponse:
  384. b.EncodeVarint(1<<3 | proto.WireBytes)
  385. if err := b.EncodeMessage(x.InitialResponse); err != nil {
  386. return err
  387. }
  388. case *LoadBalanceResponse_ServerList:
  389. b.EncodeVarint(2<<3 | proto.WireBytes)
  390. if err := b.EncodeMessage(x.ServerList); err != nil {
  391. return err
  392. }
  393. case nil:
  394. default:
  395. return fmt.Errorf("LoadBalanceResponse.LoadBalanceResponseType has unexpected type %T", x)
  396. }
  397. return nil
  398. }
  399. func _LoadBalanceResponse_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
  400. m := msg.(*LoadBalanceResponse)
  401. switch tag {
  402. case 1: // load_balance_response_type.initial_response
  403. if wire != proto.WireBytes {
  404. return true, proto.ErrInternalBadWireType
  405. }
  406. msg := new(InitialLoadBalanceResponse)
  407. err := b.DecodeMessage(msg)
  408. m.LoadBalanceResponseType = &LoadBalanceResponse_InitialResponse{msg}
  409. return true, err
  410. case 2: // load_balance_response_type.server_list
  411. if wire != proto.WireBytes {
  412. return true, proto.ErrInternalBadWireType
  413. }
  414. msg := new(ServerList)
  415. err := b.DecodeMessage(msg)
  416. m.LoadBalanceResponseType = &LoadBalanceResponse_ServerList{msg}
  417. return true, err
  418. default:
  419. return false, nil
  420. }
  421. }
  422. func _LoadBalanceResponse_OneofSizer(msg proto.Message) (n int) {
  423. m := msg.(*LoadBalanceResponse)
  424. // load_balance_response_type
  425. switch x := m.LoadBalanceResponseType.(type) {
  426. case *LoadBalanceResponse_InitialResponse:
  427. s := proto.Size(x.InitialResponse)
  428. n += 1 // tag and wire
  429. n += proto.SizeVarint(uint64(s))
  430. n += s
  431. case *LoadBalanceResponse_ServerList:
  432. s := proto.Size(x.ServerList)
  433. n += 1 // tag and wire
  434. n += proto.SizeVarint(uint64(s))
  435. n += s
  436. case nil:
  437. default:
  438. panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
  439. }
  440. return n
  441. }
  442. type InitialLoadBalanceResponse struct {
  443. // This is an application layer redirect that indicates the client should use
  444. // the specified server for load balancing. When this field is non-empty in
  445. // the response, the client should open a separate connection to the
  446. // load_balancer_delegate and call the BalanceLoad method. Its length should
  447. // be less than 64 bytes.
  448. LoadBalancerDelegate string `protobuf:"bytes,1,opt,name=load_balancer_delegate,json=loadBalancerDelegate,proto3" json:"load_balancer_delegate,omitempty"`
  449. // This interval defines how often the client should send the client stats
  450. // to the load balancer. Stats should only be reported when the duration is
  451. // positive.
  452. ClientStatsReportInterval *duration.Duration `protobuf:"bytes,2,opt,name=client_stats_report_interval,json=clientStatsReportInterval,proto3" json:"client_stats_report_interval,omitempty"`
  453. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  454. XXX_unrecognized []byte `json:"-"`
  455. XXX_sizecache int32 `json:"-"`
  456. }
  457. func (m *InitialLoadBalanceResponse) Reset() { *m = InitialLoadBalanceResponse{} }
  458. func (m *InitialLoadBalanceResponse) String() string { return proto.CompactTextString(m) }
  459. func (*InitialLoadBalanceResponse) ProtoMessage() {}
  460. func (*InitialLoadBalanceResponse) Descriptor() ([]byte, []int) {
  461. return fileDescriptor_load_balancer_12026aec3f0251ba, []int{5}
  462. }
  463. func (m *InitialLoadBalanceResponse) XXX_Unmarshal(b []byte) error {
  464. return xxx_messageInfo_InitialLoadBalanceResponse.Unmarshal(m, b)
  465. }
  466. func (m *InitialLoadBalanceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  467. return xxx_messageInfo_InitialLoadBalanceResponse.Marshal(b, m, deterministic)
  468. }
  469. func (dst *InitialLoadBalanceResponse) XXX_Merge(src proto.Message) {
  470. xxx_messageInfo_InitialLoadBalanceResponse.Merge(dst, src)
  471. }
  472. func (m *InitialLoadBalanceResponse) XXX_Size() int {
  473. return xxx_messageInfo_InitialLoadBalanceResponse.Size(m)
  474. }
  475. func (m *InitialLoadBalanceResponse) XXX_DiscardUnknown() {
  476. xxx_messageInfo_InitialLoadBalanceResponse.DiscardUnknown(m)
  477. }
  478. var xxx_messageInfo_InitialLoadBalanceResponse proto.InternalMessageInfo
  479. func (m *InitialLoadBalanceResponse) GetLoadBalancerDelegate() string {
  480. if m != nil {
  481. return m.LoadBalancerDelegate
  482. }
  483. return ""
  484. }
  485. func (m *InitialLoadBalanceResponse) GetClientStatsReportInterval() *duration.Duration {
  486. if m != nil {
  487. return m.ClientStatsReportInterval
  488. }
  489. return nil
  490. }
  491. type ServerList struct {
  492. // Contains a list of servers selected by the load balancer. The list will
  493. // be updated when server resolutions change or as needed to balance load
  494. // across more servers. The client should consume the server list in order
  495. // unless instructed otherwise via the client_config.
  496. Servers []*Server `protobuf:"bytes,1,rep,name=servers,proto3" json:"servers,omitempty"`
  497. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  498. XXX_unrecognized []byte `json:"-"`
  499. XXX_sizecache int32 `json:"-"`
  500. }
  501. func (m *ServerList) Reset() { *m = ServerList{} }
  502. func (m *ServerList) String() string { return proto.CompactTextString(m) }
  503. func (*ServerList) ProtoMessage() {}
  504. func (*ServerList) Descriptor() ([]byte, []int) {
  505. return fileDescriptor_load_balancer_12026aec3f0251ba, []int{6}
  506. }
  507. func (m *ServerList) XXX_Unmarshal(b []byte) error {
  508. return xxx_messageInfo_ServerList.Unmarshal(m, b)
  509. }
  510. func (m *ServerList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  511. return xxx_messageInfo_ServerList.Marshal(b, m, deterministic)
  512. }
  513. func (dst *ServerList) XXX_Merge(src proto.Message) {
  514. xxx_messageInfo_ServerList.Merge(dst, src)
  515. }
  516. func (m *ServerList) XXX_Size() int {
  517. return xxx_messageInfo_ServerList.Size(m)
  518. }
  519. func (m *ServerList) XXX_DiscardUnknown() {
  520. xxx_messageInfo_ServerList.DiscardUnknown(m)
  521. }
  522. var xxx_messageInfo_ServerList proto.InternalMessageInfo
  523. func (m *ServerList) GetServers() []*Server {
  524. if m != nil {
  525. return m.Servers
  526. }
  527. return nil
  528. }
  529. // Contains server information. When the drop field is not true, use the other
  530. // fields.
  531. type Server struct {
  532. // A resolved address for the server, serialized in network-byte-order. It may
  533. // either be an IPv4 or IPv6 address.
  534. IpAddress []byte `protobuf:"bytes,1,opt,name=ip_address,json=ipAddress,proto3" json:"ip_address,omitempty"`
  535. // A resolved port number for the server.
  536. Port int32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"`
  537. // An opaque but printable token for load reporting. The client must include
  538. // the token of the picked server into the initial metadata when it starts a
  539. // call to that server. The token is used by the server to verify the request
  540. // and to allow the server to report load to the gRPC LB system. The token is
  541. // also used in client stats for reporting dropped calls.
  542. //
  543. // Its length can be variable but must be less than 50 bytes.
  544. LoadBalanceToken string `protobuf:"bytes,3,opt,name=load_balance_token,json=loadBalanceToken,proto3" json:"load_balance_token,omitempty"`
  545. // Indicates whether this particular request should be dropped by the client.
  546. // If the request is dropped, there will be a corresponding entry in
  547. // ClientStats.calls_finished_with_drop.
  548. Drop bool `protobuf:"varint,4,opt,name=drop,proto3" json:"drop,omitempty"`
  549. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  550. XXX_unrecognized []byte `json:"-"`
  551. XXX_sizecache int32 `json:"-"`
  552. }
  553. func (m *Server) Reset() { *m = Server{} }
  554. func (m *Server) String() string { return proto.CompactTextString(m) }
  555. func (*Server) ProtoMessage() {}
  556. func (*Server) Descriptor() ([]byte, []int) {
  557. return fileDescriptor_load_balancer_12026aec3f0251ba, []int{7}
  558. }
  559. func (m *Server) XXX_Unmarshal(b []byte) error {
  560. return xxx_messageInfo_Server.Unmarshal(m, b)
  561. }
  562. func (m *Server) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  563. return xxx_messageInfo_Server.Marshal(b, m, deterministic)
  564. }
  565. func (dst *Server) XXX_Merge(src proto.Message) {
  566. xxx_messageInfo_Server.Merge(dst, src)
  567. }
  568. func (m *Server) XXX_Size() int {
  569. return xxx_messageInfo_Server.Size(m)
  570. }
  571. func (m *Server) XXX_DiscardUnknown() {
  572. xxx_messageInfo_Server.DiscardUnknown(m)
  573. }
  574. var xxx_messageInfo_Server proto.InternalMessageInfo
  575. func (m *Server) GetIpAddress() []byte {
  576. if m != nil {
  577. return m.IpAddress
  578. }
  579. return nil
  580. }
  581. func (m *Server) GetPort() int32 {
  582. if m != nil {
  583. return m.Port
  584. }
  585. return 0
  586. }
  587. func (m *Server) GetLoadBalanceToken() string {
  588. if m != nil {
  589. return m.LoadBalanceToken
  590. }
  591. return ""
  592. }
  593. func (m *Server) GetDrop() bool {
  594. if m != nil {
  595. return m.Drop
  596. }
  597. return false
  598. }
  599. func init() {
  600. proto.RegisterType((*LoadBalanceRequest)(nil), "grpc.lb.v1.LoadBalanceRequest")
  601. proto.RegisterType((*InitialLoadBalanceRequest)(nil), "grpc.lb.v1.InitialLoadBalanceRequest")
  602. proto.RegisterType((*ClientStatsPerToken)(nil), "grpc.lb.v1.ClientStatsPerToken")
  603. proto.RegisterType((*ClientStats)(nil), "grpc.lb.v1.ClientStats")
  604. proto.RegisterType((*LoadBalanceResponse)(nil), "grpc.lb.v1.LoadBalanceResponse")
  605. proto.RegisterType((*InitialLoadBalanceResponse)(nil), "grpc.lb.v1.InitialLoadBalanceResponse")
  606. proto.RegisterType((*ServerList)(nil), "grpc.lb.v1.ServerList")
  607. proto.RegisterType((*Server)(nil), "grpc.lb.v1.Server")
  608. }
  609. // Reference imports to suppress errors if they are not otherwise used.
  610. var _ context.Context
  611. var _ grpc.ClientConn
  612. // This is a compile-time assertion to ensure that this generated file
  613. // is compatible with the grpc package it is being compiled against.
  614. const _ = grpc.SupportPackageIsVersion4
  615. // LoadBalancerClient is the client API for LoadBalancer service.
  616. //
  617. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
  618. type LoadBalancerClient interface {
  619. // Bidirectional rpc to get a list of servers.
  620. BalanceLoad(ctx context.Context, opts ...grpc.CallOption) (LoadBalancer_BalanceLoadClient, error)
  621. }
  622. type loadBalancerClient struct {
  623. cc *grpc.ClientConn
  624. }
  625. func NewLoadBalancerClient(cc *grpc.ClientConn) LoadBalancerClient {
  626. return &loadBalancerClient{cc}
  627. }
  628. func (c *loadBalancerClient) BalanceLoad(ctx context.Context, opts ...grpc.CallOption) (LoadBalancer_BalanceLoadClient, error) {
  629. stream, err := c.cc.NewStream(ctx, &_LoadBalancer_serviceDesc.Streams[0], "/grpc.lb.v1.LoadBalancer/BalanceLoad", opts...)
  630. if err != nil {
  631. return nil, err
  632. }
  633. x := &loadBalancerBalanceLoadClient{stream}
  634. return x, nil
  635. }
  636. type LoadBalancer_BalanceLoadClient interface {
  637. Send(*LoadBalanceRequest) error
  638. Recv() (*LoadBalanceResponse, error)
  639. grpc.ClientStream
  640. }
  641. type loadBalancerBalanceLoadClient struct {
  642. grpc.ClientStream
  643. }
  644. func (x *loadBalancerBalanceLoadClient) Send(m *LoadBalanceRequest) error {
  645. return x.ClientStream.SendMsg(m)
  646. }
  647. func (x *loadBalancerBalanceLoadClient) Recv() (*LoadBalanceResponse, error) {
  648. m := new(LoadBalanceResponse)
  649. if err := x.ClientStream.RecvMsg(m); err != nil {
  650. return nil, err
  651. }
  652. return m, nil
  653. }
  654. // LoadBalancerServer is the server API for LoadBalancer service.
  655. type LoadBalancerServer interface {
  656. // Bidirectional rpc to get a list of servers.
  657. BalanceLoad(LoadBalancer_BalanceLoadServer) error
  658. }
  659. func RegisterLoadBalancerServer(s *grpc.Server, srv LoadBalancerServer) {
  660. s.RegisterService(&_LoadBalancer_serviceDesc, srv)
  661. }
  662. func _LoadBalancer_BalanceLoad_Handler(srv interface{}, stream grpc.ServerStream) error {
  663. return srv.(LoadBalancerServer).BalanceLoad(&loadBalancerBalanceLoadServer{stream})
  664. }
  665. type LoadBalancer_BalanceLoadServer interface {
  666. Send(*LoadBalanceResponse) error
  667. Recv() (*LoadBalanceRequest, error)
  668. grpc.ServerStream
  669. }
  670. type loadBalancerBalanceLoadServer struct {
  671. grpc.ServerStream
  672. }
  673. func (x *loadBalancerBalanceLoadServer) Send(m *LoadBalanceResponse) error {
  674. return x.ServerStream.SendMsg(m)
  675. }
  676. func (x *loadBalancerBalanceLoadServer) Recv() (*LoadBalanceRequest, error) {
  677. m := new(LoadBalanceRequest)
  678. if err := x.ServerStream.RecvMsg(m); err != nil {
  679. return nil, err
  680. }
  681. return m, nil
  682. }
  683. var _LoadBalancer_serviceDesc = grpc.ServiceDesc{
  684. ServiceName: "grpc.lb.v1.LoadBalancer",
  685. HandlerType: (*LoadBalancerServer)(nil),
  686. Methods: []grpc.MethodDesc{},
  687. Streams: []grpc.StreamDesc{
  688. {
  689. StreamName: "BalanceLoad",
  690. Handler: _LoadBalancer_BalanceLoad_Handler,
  691. ServerStreams: true,
  692. ClientStreams: true,
  693. },
  694. },
  695. Metadata: "grpc/lb/v1/load_balancer.proto",
  696. }
  697. func init() {
  698. proto.RegisterFile("grpc/lb/v1/load_balancer.proto", fileDescriptor_load_balancer_12026aec3f0251ba)
  699. }
  700. var fileDescriptor_load_balancer_12026aec3f0251ba = []byte{
  701. // 752 bytes of a gzipped FileDescriptorProto
  702. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x55, 0xdd, 0x6e, 0x23, 0x35,
  703. 0x14, 0xee, 0x90, 0x69, 0x36, 0x39, 0x29, 0x34, 0xeb, 0x85, 0x65, 0x92, 0xdd, 0x6d, 0x4b, 0x24,
  704. 0x56, 0x11, 0x2a, 0x13, 0x52, 0xb8, 0x00, 0x89, 0x0b, 0x48, 0xab, 0x2a, 0x2d, 0xbd, 0x88, 0x9c,
  705. 0x4a, 0x45, 0x95, 0x90, 0x99, 0xc9, 0xb8, 0xa9, 0x55, 0xc7, 0x1e, 0x3c, 0x4e, 0x2a, 0xae, 0x79,
  706. 0x1f, 0xc4, 0x2b, 0x20, 0x5e, 0x0c, 0x8d, 0xed, 0x49, 0xa6, 0x49, 0xa3, 0xbd, 0xca, 0xf8, 0x9c,
  707. 0xcf, 0xdf, 0xf9, 0xfd, 0x1c, 0x38, 0x98, 0xaa, 0x74, 0xd2, 0xe3, 0x71, 0x6f, 0xd1, 0xef, 0x71,
  708. 0x19, 0x25, 0x24, 0x8e, 0x78, 0x24, 0x26, 0x54, 0x85, 0xa9, 0x92, 0x5a, 0x22, 0xc8, 0xfd, 0x21,
  709. 0x8f, 0xc3, 0x45, 0xbf, 0x7d, 0x30, 0x95, 0x72, 0xca, 0x69, 0xcf, 0x78, 0xe2, 0xf9, 0x5d, 0x2f,
  710. 0x99, 0xab, 0x48, 0x33, 0x29, 0x2c, 0xb6, 0x7d, 0xb8, 0xee, 0xd7, 0x6c, 0x46, 0x33, 0x1d, 0xcd,
  711. 0x52, 0x0b, 0xe8, 0xfc, 0xeb, 0x01, 0xba, 0x92, 0x51, 0x32, 0xb0, 0x31, 0x30, 0xfd, 0x63, 0x4e,
  712. 0x33, 0x8d, 0x46, 0xb0, 0xcf, 0x04, 0xd3, 0x2c, 0xe2, 0x44, 0x59, 0x53, 0xe0, 0x1d, 0x79, 0xdd,
  713. 0xc6, 0xc9, 0x97, 0xe1, 0x2a, 0x7a, 0x78, 0x61, 0x21, 0x9b, 0xf7, 0x87, 0x3b, 0xf8, 0x13, 0x77,
  714. 0xbf, 0x60, 0xfc, 0x11, 0xf6, 0x26, 0x9c, 0x51, 0xa1, 0x49, 0xa6, 0x23, 0x9d, 0x05, 0x1f, 0x19,
  715. 0xba, 0xcf, 0xcb, 0x74, 0xa7, 0xc6, 0x3f, 0xce, 0xdd, 0xc3, 0x1d, 0xdc, 0x98, 0xac, 0x8e, 0x83,
  716. 0x37, 0xd0, 0x2a, 0xb7, 0xa2, 0x48, 0x8a, 0xe8, 0x3f, 0x53, 0xda, 0xe9, 0x41, 0x6b, 0x6b, 0x26,
  717. 0x08, 0x81, 0x2f, 0xa2, 0x19, 0x35, 0xe9, 0xd7, 0xb1, 0xf9, 0xee, 0xfc, 0x0e, 0xaf, 0x4a, 0xb1,
  718. 0x46, 0x54, 0x5d, 0xcb, 0x07, 0x2a, 0xd0, 0x31, 0xa0, 0x27, 0x41, 0x74, 0x6e, 0x75, 0x17, 0x9b,
  719. 0x7c, 0x45, 0x6d, 0xd1, 0x6f, 0xa0, 0x2e, 0xe6, 0x33, 0x32, 0x89, 0x38, 0xb7, 0xd5, 0x54, 0x70,
  720. 0x4d, 0xcc, 0x67, 0xa7, 0xf9, 0xb9, 0xf3, 0x4f, 0x05, 0x1a, 0xa5, 0x10, 0xe8, 0x7b, 0xa8, 0x2f,
  721. 0x3b, 0xef, 0x3a, 0xd9, 0x0e, 0xed, 0x6c, 0xc2, 0x62, 0x36, 0xe1, 0x75, 0x81, 0xc0, 0x2b, 0x30,
  722. 0xfa, 0x0a, 0x5e, 0x2e, 0xc3, 0xe4, 0xad, 0x53, 0x9a, 0x26, 0x2e, 0xdc, 0x7e, 0x11, 0x6e, 0x6c,
  723. 0xcd, 0x79, 0x01, 0x2b, 0xec, 0x1d, 0x13, 0x2c, 0xbb, 0xa7, 0x49, 0x50, 0x31, 0xe0, 0x66, 0x01,
  724. 0x3e, 0x77, 0x76, 0xf4, 0x1b, 0x7c, 0xbd, 0x89, 0x26, 0x8f, 0x4c, 0xdf, 0x13, 0x37, 0xa9, 0xbb,
  725. 0x88, 0x71, 0x9a, 0x10, 0x2d, 0x49, 0x46, 0x45, 0x12, 0x54, 0x0d, 0xd1, 0xfb, 0x75, 0xa2, 0x1b,
  726. 0xa6, 0xef, 0x6d, 0xad, 0xe7, 0x06, 0x7f, 0x2d, 0xc7, 0x54, 0x24, 0x68, 0x08, 0x5f, 0x3c, 0x43,
  727. 0xff, 0x20, 0xe4, 0xa3, 0x20, 0x8a, 0x4e, 0x28, 0x5b, 0xd0, 0x24, 0x78, 0x61, 0x28, 0xdf, 0xad,
  728. 0x53, 0xfe, 0x92, 0xa3, 0xb0, 0x03, 0xa1, 0x5f, 0x21, 0x78, 0x2e, 0xc9, 0x44, 0xc9, 0x34, 0xa8,
  729. 0x1d, 0x55, 0xba, 0x8d, 0x93, 0xc3, 0x2d, 0x6b, 0x54, 0x8c, 0x16, 0x7f, 0x36, 0x59, 0xcf, 0xf8,
  730. 0x4c, 0xc9, 0xf4, 0xd2, 0xaf, 0xf9, 0xcd, 0xdd, 0x4b, 0xbf, 0xb6, 0xdb, 0xac, 0x76, 0xfe, 0xf3,
  731. 0xe0, 0xd5, 0x93, 0xfd, 0xc9, 0x52, 0x29, 0x32, 0x8a, 0xc6, 0xd0, 0x5c, 0x49, 0xc1, 0xda, 0xdc,
  732. 0x04, 0xdf, 0x7f, 0x48, 0x0b, 0x16, 0x3d, 0xdc, 0xc1, 0xfb, 0x4b, 0x31, 0x38, 0xd2, 0x1f, 0xa0,
  733. 0x91, 0x51, 0xb5, 0xa0, 0x8a, 0x70, 0x96, 0x69, 0x27, 0x86, 0xd7, 0x65, 0xbe, 0xb1, 0x71, 0x5f,
  734. 0x31, 0x23, 0x26, 0xc8, 0x96, 0xa7, 0xc1, 0x5b, 0x68, 0xaf, 0x49, 0xc1, 0x72, 0x5a, 0x2d, 0xfc,
  735. 0xed, 0x41, 0x7b, 0x7b, 0x2a, 0xe8, 0x3b, 0x78, 0xfd, 0xe4, 0x49, 0x21, 0x09, 0xe5, 0x74, 0x1a,
  736. 0xe9, 0x42, 0x1f, 0x9f, 0x96, 0xd6, 0x5c, 0x9d, 0x39, 0x1f, 0xba, 0x85, 0xb7, 0x65, 0xed, 0x12,
  737. 0x45, 0x53, 0xa9, 0x34, 0x61, 0x42, 0x53, 0xb5, 0x88, 0xb8, 0x4b, 0xbf, 0xb5, 0xb1, 0xd0, 0x67,
  738. 0xee, 0x31, 0xc2, 0xad, 0x92, 0x96, 0xb1, 0xb9, 0x7c, 0xe1, 0xee, 0x76, 0x7e, 0x02, 0x58, 0x95,
  739. 0x8a, 0x8e, 0xe1, 0x85, 0x2d, 0x35, 0x0b, 0x3c, 0x33, 0x59, 0xb4, 0xd9, 0x13, 0x5c, 0x40, 0x2e,
  740. 0xfd, 0x5a, 0xa5, 0xe9, 0x77, 0xfe, 0xf2, 0xa0, 0x6a, 0x3d, 0xe8, 0x1d, 0x00, 0x4b, 0x49, 0x94,
  741. 0x24, 0x8a, 0x66, 0x99, 0x29, 0x69, 0x0f, 0xd7, 0x59, 0xfa, 0xb3, 0x35, 0xe4, 0x6f, 0x41, 0x1e,
  742. 0xdb, 0xe4, 0xbb, 0x8b, 0xcd, 0xf7, 0x16, 0xd1, 0x57, 0xb6, 0x88, 0x1e, 0x81, 0x6f, 0xd6, 0xce,
  743. 0x3f, 0xf2, 0xba, 0x35, 0x6c, 0xbe, 0xed, 0xfa, 0x9c, 0xc4, 0xb0, 0x57, 0x6a, 0xb8, 0x42, 0x18,
  744. 0x1a, 0xee, 0x3b, 0x37, 0xa3, 0x83, 0x72, 0x1d, 0x9b, 0xcf, 0x54, 0xfb, 0x70, 0xab, 0xdf, 0x4e,
  745. 0xae, 0xeb, 0x7d, 0xe3, 0x0d, 0x6e, 0xe0, 0x63, 0x26, 0x4b, 0xc0, 0xc1, 0xcb, 0x72, 0xc8, 0x51,
  746. 0xde, 0xf6, 0x91, 0x77, 0xdb, 0x77, 0x63, 0x98, 0x4a, 0x1e, 0x89, 0x69, 0x28, 0xd5, 0xb4, 0x67,
  747. 0xfe, 0x51, 0x8a, 0x99, 0x9b, 0x13, 0x8f, 0xcd, 0x0f, 0xe1, 0x31, 0x59, 0xf4, 0xe3, 0xaa, 0x19,
  748. 0xd9, 0xb7, 0xff, 0x07, 0x00, 0x00, 0xff, 0xff, 0x81, 0x14, 0xee, 0xd1, 0x7b, 0x06, 0x00, 0x00,
  749. }