gitee.com/ks-custle/core-gm@v0.0.0-20230922171213-b83bdd97b62c/go-control-plane/envoy/service/load_stats/v2/lrs.pb.go (about) 1 // Code generated by protoc-gen-go. DO NOT EDIT. 2 // versions: 3 // protoc-gen-go v1.25.0 4 // protoc v3.16.0 5 // source: envoy/service/load_stats/v2/lrs.proto 6 7 package envoy_service_load_stats_v2 8 9 import ( 10 context "context" 11 _ "github.com/cncf/xds/go/udpa/annotations" 12 core "gitee.com/ks-custle/core-gm/go-control-plane/envoy/api/v2/core" 13 endpoint "gitee.com/ks-custle/core-gm/go-control-plane/envoy/api/v2/endpoint" 14 proto "github.com/golang/protobuf/proto" 15 duration "github.com/golang/protobuf/ptypes/duration" 16 grpc "gitee.com/ks-custle/core-gm/grpc" 17 codes "gitee.com/ks-custle/core-gm/grpc/codes" 18 status "gitee.com/ks-custle/core-gm/grpc/status" 19 protoreflect "google.golang.org/protobuf/reflect/protoreflect" 20 protoimpl "google.golang.org/protobuf/runtime/protoimpl" 21 reflect "reflect" 22 sync "sync" 23 ) 24 25 const ( 26 // Verify that this generated code is sufficiently up-to-date. 27 _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 28 // Verify that runtime/protoimpl is sufficiently up-to-date. 29 _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 30 ) 31 32 // This is a compile-time assertion that a sufficiently up-to-date version 33 // of the legacy proto package is being used. 34 const _ = proto.ProtoPackageIsVersion4 35 36 // A load report Envoy sends to the management server. 37 // [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. 38 type LoadStatsRequest struct { 39 state protoimpl.MessageState 40 sizeCache protoimpl.SizeCache 41 unknownFields protoimpl.UnknownFields 42 43 // Node identifier for Envoy instance. 44 Node *core.Node `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"` 45 // A list of load stats to report. 46 ClusterStats []*endpoint.ClusterStats `protobuf:"bytes,2,rep,name=cluster_stats,json=clusterStats,proto3" json:"cluster_stats,omitempty"` 47 } 48 49 func (x *LoadStatsRequest) Reset() { 50 *x = LoadStatsRequest{} 51 if protoimpl.UnsafeEnabled { 52 mi := &file_envoy_service_load_stats_v2_lrs_proto_msgTypes[0] 53 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 54 ms.StoreMessageInfo(mi) 55 } 56 } 57 58 func (x *LoadStatsRequest) String() string { 59 return protoimpl.X.MessageStringOf(x) 60 } 61 62 func (*LoadStatsRequest) ProtoMessage() {} 63 64 func (x *LoadStatsRequest) ProtoReflect() protoreflect.Message { 65 mi := &file_envoy_service_load_stats_v2_lrs_proto_msgTypes[0] 66 if protoimpl.UnsafeEnabled && x != nil { 67 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 68 if ms.LoadMessageInfo() == nil { 69 ms.StoreMessageInfo(mi) 70 } 71 return ms 72 } 73 return mi.MessageOf(x) 74 } 75 76 // Deprecated: Use LoadStatsRequest.ProtoReflect.Descriptor instead. 77 func (*LoadStatsRequest) Descriptor() ([]byte, []int) { 78 return file_envoy_service_load_stats_v2_lrs_proto_rawDescGZIP(), []int{0} 79 } 80 81 func (x *LoadStatsRequest) GetNode() *core.Node { 82 if x != nil { 83 return x.Node 84 } 85 return nil 86 } 87 88 func (x *LoadStatsRequest) GetClusterStats() []*endpoint.ClusterStats { 89 if x != nil { 90 return x.ClusterStats 91 } 92 return nil 93 } 94 95 // The management server sends envoy a LoadStatsResponse with all clusters it 96 // is interested in learning load stats about. 97 // [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. 98 type LoadStatsResponse struct { 99 state protoimpl.MessageState 100 sizeCache protoimpl.SizeCache 101 unknownFields protoimpl.UnknownFields 102 103 // Clusters to report stats for. 104 // Not populated if *send_all_clusters* is true. 105 Clusters []string `protobuf:"bytes,1,rep,name=clusters,proto3" json:"clusters,omitempty"` 106 // If true, the client should send all clusters it knows about. 107 // Only clients that advertise the "envoy.lrs.supports_send_all_clusters" capability in their 108 // :ref:`client_features<envoy_api_field_core.Node.client_features>` field will honor this field. 109 SendAllClusters bool `protobuf:"varint,4,opt,name=send_all_clusters,json=sendAllClusters,proto3" json:"send_all_clusters,omitempty"` 110 // The minimum interval of time to collect stats over. This is only a minimum for two reasons: 111 // 1. There may be some delay from when the timer fires until stats sampling occurs. 112 // 2. For clusters that were already feature in the previous *LoadStatsResponse*, any traffic 113 // that is observed in between the corresponding previous *LoadStatsRequest* and this 114 // *LoadStatsResponse* will also be accumulated and billed to the cluster. This avoids a period 115 // of inobservability that might otherwise exists between the messages. New clusters are not 116 // subject to this consideration. 117 LoadReportingInterval *duration.Duration `protobuf:"bytes,2,opt,name=load_reporting_interval,json=loadReportingInterval,proto3" json:"load_reporting_interval,omitempty"` 118 // Set to *true* if the management server supports endpoint granularity 119 // report. 120 ReportEndpointGranularity bool `protobuf:"varint,3,opt,name=report_endpoint_granularity,json=reportEndpointGranularity,proto3" json:"report_endpoint_granularity,omitempty"` 121 } 122 123 func (x *LoadStatsResponse) Reset() { 124 *x = LoadStatsResponse{} 125 if protoimpl.UnsafeEnabled { 126 mi := &file_envoy_service_load_stats_v2_lrs_proto_msgTypes[1] 127 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 128 ms.StoreMessageInfo(mi) 129 } 130 } 131 132 func (x *LoadStatsResponse) String() string { 133 return protoimpl.X.MessageStringOf(x) 134 } 135 136 func (*LoadStatsResponse) ProtoMessage() {} 137 138 func (x *LoadStatsResponse) ProtoReflect() protoreflect.Message { 139 mi := &file_envoy_service_load_stats_v2_lrs_proto_msgTypes[1] 140 if protoimpl.UnsafeEnabled && x != nil { 141 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 142 if ms.LoadMessageInfo() == nil { 143 ms.StoreMessageInfo(mi) 144 } 145 return ms 146 } 147 return mi.MessageOf(x) 148 } 149 150 // Deprecated: Use LoadStatsResponse.ProtoReflect.Descriptor instead. 151 func (*LoadStatsResponse) Descriptor() ([]byte, []int) { 152 return file_envoy_service_load_stats_v2_lrs_proto_rawDescGZIP(), []int{1} 153 } 154 155 func (x *LoadStatsResponse) GetClusters() []string { 156 if x != nil { 157 return x.Clusters 158 } 159 return nil 160 } 161 162 func (x *LoadStatsResponse) GetSendAllClusters() bool { 163 if x != nil { 164 return x.SendAllClusters 165 } 166 return false 167 } 168 169 func (x *LoadStatsResponse) GetLoadReportingInterval() *duration.Duration { 170 if x != nil { 171 return x.LoadReportingInterval 172 } 173 return nil 174 } 175 176 func (x *LoadStatsResponse) GetReportEndpointGranularity() bool { 177 if x != nil { 178 return x.ReportEndpointGranularity 179 } 180 return false 181 } 182 183 var File_envoy_service_load_stats_v2_lrs_proto protoreflect.FileDescriptor 184 185 var file_envoy_service_load_stats_v2_lrs_proto_rawDesc = []byte{ 186 0x0a, 0x25, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 187 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x2f, 0x76, 0x32, 0x2f, 0x6c, 0x72, 188 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 189 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x73, 0x74, 0x61, 0x74, 190 0x73, 0x2e, 0x76, 0x32, 0x1a, 0x1c, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x61, 0x70, 0x69, 0x2f, 191 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 192 0x74, 0x6f, 0x1a, 0x27, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 193 0x2f, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2f, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x72, 194 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 195 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 196 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x75, 0x64, 0x70, 197 0x61, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x73, 0x74, 198 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x89, 0x01, 0x0a, 0x10, 0x4c, 199 0x6f, 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 200 0x2b, 0x0a, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 201 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x72, 202 0x65, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x12, 0x48, 0x0a, 0x0d, 203 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x18, 0x02, 0x20, 204 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x61, 0x70, 0x69, 0x2e, 205 0x76, 0x32, 0x2e, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x43, 0x6c, 0x75, 0x73, 206 0x74, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x0c, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 207 0x72, 0x53, 0x74, 0x61, 0x74, 0x73, 0x22, 0xee, 0x01, 0x0a, 0x11, 0x4c, 0x6f, 0x61, 0x64, 0x53, 208 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 209 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 210 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x12, 0x2a, 0x0a, 0x11, 0x73, 0x65, 0x6e, 0x64, 211 0x5f, 0x61, 0x6c, 0x6c, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 212 0x01, 0x28, 0x08, 0x52, 0x0f, 0x73, 0x65, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x43, 0x6c, 0x75, 0x73, 213 0x74, 0x65, 0x72, 0x73, 0x12, 0x51, 0x0a, 0x17, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x72, 0x65, 0x70, 214 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 215 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 216 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 217 0x52, 0x15, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x49, 218 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x3e, 0x0a, 0x1b, 0x72, 0x65, 0x70, 0x6f, 0x72, 219 0x74, 0x5f, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x67, 0x72, 0x61, 0x6e, 0x75, 220 0x6c, 0x61, 0x72, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x19, 0x72, 0x65, 221 0x70, 0x6f, 0x72, 0x74, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x47, 0x72, 0x61, 0x6e, 222 0x75, 0x6c, 0x61, 0x72, 0x69, 0x74, 0x79, 0x32, 0x8e, 0x01, 0x0a, 0x14, 0x4c, 0x6f, 0x61, 0x64, 223 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 224 0x12, 0x76, 0x0a, 0x0f, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4c, 0x6f, 0x61, 0x64, 0x53, 0x74, 225 0x61, 0x74, 0x73, 0x12, 0x2d, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 226 0x69, 0x63, 0x65, 0x2e, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x2e, 0x76, 227 0x32, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 228 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 229 0x63, 0x65, 0x2e, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x2e, 0x76, 0x32, 230 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 231 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, 0x42, 0x0a, 0x29, 0x69, 0x6f, 0x2e, 0x65, 232 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 233 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x73, 0x74, 0x61, 234 0x74, 0x73, 0x2e, 0x76, 0x32, 0x42, 0x08, 0x4c, 0x72, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 235 0x01, 0x88, 0x01, 0x01, 0xba, 0x80, 0xc8, 0xd1, 0x06, 0x02, 0x10, 0x01, 0x62, 0x06, 0x70, 0x72, 236 0x6f, 0x74, 0x6f, 0x33, 237 } 238 239 var ( 240 file_envoy_service_load_stats_v2_lrs_proto_rawDescOnce sync.Once 241 file_envoy_service_load_stats_v2_lrs_proto_rawDescData = file_envoy_service_load_stats_v2_lrs_proto_rawDesc 242 ) 243 244 func file_envoy_service_load_stats_v2_lrs_proto_rawDescGZIP() []byte { 245 file_envoy_service_load_stats_v2_lrs_proto_rawDescOnce.Do(func() { 246 file_envoy_service_load_stats_v2_lrs_proto_rawDescData = protoimpl.X.CompressGZIP(file_envoy_service_load_stats_v2_lrs_proto_rawDescData) 247 }) 248 return file_envoy_service_load_stats_v2_lrs_proto_rawDescData 249 } 250 251 var file_envoy_service_load_stats_v2_lrs_proto_msgTypes = make([]protoimpl.MessageInfo, 2) 252 var file_envoy_service_load_stats_v2_lrs_proto_goTypes = []interface{}{ 253 (*LoadStatsRequest)(nil), // 0: envoy.service.load_stats.v2.LoadStatsRequest 254 (*LoadStatsResponse)(nil), // 1: envoy.service.load_stats.v2.LoadStatsResponse 255 (*core.Node)(nil), // 2: envoy.api.v2.core.Node 256 (*endpoint.ClusterStats)(nil), // 3: envoy.api.v2.endpoint.ClusterStats 257 (*duration.Duration)(nil), // 4: google.protobuf.Duration 258 } 259 var file_envoy_service_load_stats_v2_lrs_proto_depIdxs = []int32{ 260 2, // 0: envoy.service.load_stats.v2.LoadStatsRequest.node:type_name -> envoy.api.v2.core.Node 261 3, // 1: envoy.service.load_stats.v2.LoadStatsRequest.cluster_stats:type_name -> envoy.api.v2.endpoint.ClusterStats 262 4, // 2: envoy.service.load_stats.v2.LoadStatsResponse.load_reporting_interval:type_name -> google.protobuf.Duration 263 0, // 3: envoy.service.load_stats.v2.LoadReportingService.StreamLoadStats:input_type -> envoy.service.load_stats.v2.LoadStatsRequest 264 1, // 4: envoy.service.load_stats.v2.LoadReportingService.StreamLoadStats:output_type -> envoy.service.load_stats.v2.LoadStatsResponse 265 4, // [4:5] is the sub-list for method output_type 266 3, // [3:4] is the sub-list for method input_type 267 3, // [3:3] is the sub-list for extension type_name 268 3, // [3:3] is the sub-list for extension extendee 269 0, // [0:3] is the sub-list for field type_name 270 } 271 272 func init() { file_envoy_service_load_stats_v2_lrs_proto_init() } 273 func file_envoy_service_load_stats_v2_lrs_proto_init() { 274 if File_envoy_service_load_stats_v2_lrs_proto != nil { 275 return 276 } 277 if !protoimpl.UnsafeEnabled { 278 file_envoy_service_load_stats_v2_lrs_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { 279 switch v := v.(*LoadStatsRequest); i { 280 case 0: 281 return &v.state 282 case 1: 283 return &v.sizeCache 284 case 2: 285 return &v.unknownFields 286 default: 287 return nil 288 } 289 } 290 file_envoy_service_load_stats_v2_lrs_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { 291 switch v := v.(*LoadStatsResponse); i { 292 case 0: 293 return &v.state 294 case 1: 295 return &v.sizeCache 296 case 2: 297 return &v.unknownFields 298 default: 299 return nil 300 } 301 } 302 } 303 type x struct{} 304 out := protoimpl.TypeBuilder{ 305 File: protoimpl.DescBuilder{ 306 GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 307 RawDescriptor: file_envoy_service_load_stats_v2_lrs_proto_rawDesc, 308 NumEnums: 0, 309 NumMessages: 2, 310 NumExtensions: 0, 311 NumServices: 1, 312 }, 313 GoTypes: file_envoy_service_load_stats_v2_lrs_proto_goTypes, 314 DependencyIndexes: file_envoy_service_load_stats_v2_lrs_proto_depIdxs, 315 MessageInfos: file_envoy_service_load_stats_v2_lrs_proto_msgTypes, 316 }.Build() 317 File_envoy_service_load_stats_v2_lrs_proto = out.File 318 file_envoy_service_load_stats_v2_lrs_proto_rawDesc = nil 319 file_envoy_service_load_stats_v2_lrs_proto_goTypes = nil 320 file_envoy_service_load_stats_v2_lrs_proto_depIdxs = nil 321 } 322 323 // Reference imports to suppress errors if they are not otherwise used. 324 var _ context.Context 325 var _ grpc.ClientConnInterface 326 327 // This is a compile-time assertion to ensure that this generated file 328 // is compatible with the grpc package it is being compiled against. 329 const _ = grpc.SupportPackageIsVersion6 330 331 // LoadReportingServiceClient is the client API for LoadReportingService service. 332 // 333 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. 334 type LoadReportingServiceClient interface { 335 // Advanced API to allow for multi-dimensional load balancing by remote 336 // server. For receiving LB assignments, the steps are: 337 // 1, The management server is configured with per cluster/zone/load metric 338 // capacity configuration. The capacity configuration definition is 339 // outside of the scope of this document. 340 // 2. Envoy issues a standard {Stream,Fetch}Endpoints request for the clusters 341 // to balance. 342 // 343 // Independently, Envoy will initiate a StreamLoadStats bidi stream with a 344 // management server: 345 // 1. Once a connection establishes, the management server publishes a 346 // LoadStatsResponse for all clusters it is interested in learning load 347 // stats about. 348 // 2. For each cluster, Envoy load balances incoming traffic to upstream hosts 349 // based on per-zone weights and/or per-instance weights (if specified) 350 // based on intra-zone LbPolicy. This information comes from the above 351 // {Stream,Fetch}Endpoints. 352 // 3. When upstream hosts reply, they optionally add header <define header 353 // name> with ASCII representation of EndpointLoadMetricStats. 354 // 4. Envoy aggregates load reports over the period of time given to it in 355 // LoadStatsResponse.load_reporting_interval. This includes aggregation 356 // stats Envoy maintains by itself (total_requests, rpc_errors etc.) as 357 // well as load metrics from upstream hosts. 358 // 5. When the timer of load_reporting_interval expires, Envoy sends new 359 // LoadStatsRequest filled with load reports for each cluster. 360 // 6. The management server uses the load reports from all reported Envoys 361 // from around the world, computes global assignment and prepares traffic 362 // assignment destined for each zone Envoys are located in. Goto 2. 363 StreamLoadStats(ctx context.Context, opts ...grpc.CallOption) (LoadReportingService_StreamLoadStatsClient, error) 364 } 365 366 type loadReportingServiceClient struct { 367 cc grpc.ClientConnInterface 368 } 369 370 func NewLoadReportingServiceClient(cc grpc.ClientConnInterface) LoadReportingServiceClient { 371 return &loadReportingServiceClient{cc} 372 } 373 374 func (c *loadReportingServiceClient) StreamLoadStats(ctx context.Context, opts ...grpc.CallOption) (LoadReportingService_StreamLoadStatsClient, error) { 375 stream, err := c.cc.NewStream(ctx, &_LoadReportingService_serviceDesc.Streams[0], "/envoy.service.load_stats.v2.LoadReportingService/StreamLoadStats", opts...) 376 if err != nil { 377 return nil, err 378 } 379 x := &loadReportingServiceStreamLoadStatsClient{stream} 380 return x, nil 381 } 382 383 type LoadReportingService_StreamLoadStatsClient interface { 384 Send(*LoadStatsRequest) error 385 Recv() (*LoadStatsResponse, error) 386 grpc.ClientStream 387 } 388 389 type loadReportingServiceStreamLoadStatsClient struct { 390 grpc.ClientStream 391 } 392 393 func (x *loadReportingServiceStreamLoadStatsClient) Send(m *LoadStatsRequest) error { 394 return x.ClientStream.SendMsg(m) 395 } 396 397 func (x *loadReportingServiceStreamLoadStatsClient) Recv() (*LoadStatsResponse, error) { 398 m := new(LoadStatsResponse) 399 if err := x.ClientStream.RecvMsg(m); err != nil { 400 return nil, err 401 } 402 return m, nil 403 } 404 405 // LoadReportingServiceServer is the server API for LoadReportingService service. 406 type LoadReportingServiceServer interface { 407 // Advanced API to allow for multi-dimensional load balancing by remote 408 // server. For receiving LB assignments, the steps are: 409 // 1, The management server is configured with per cluster/zone/load metric 410 // capacity configuration. The capacity configuration definition is 411 // outside of the scope of this document. 412 // 2. Envoy issues a standard {Stream,Fetch}Endpoints request for the clusters 413 // to balance. 414 // 415 // Independently, Envoy will initiate a StreamLoadStats bidi stream with a 416 // management server: 417 // 1. Once a connection establishes, the management server publishes a 418 // LoadStatsResponse for all clusters it is interested in learning load 419 // stats about. 420 // 2. For each cluster, Envoy load balances incoming traffic to upstream hosts 421 // based on per-zone weights and/or per-instance weights (if specified) 422 // based on intra-zone LbPolicy. This information comes from the above 423 // {Stream,Fetch}Endpoints. 424 // 3. When upstream hosts reply, they optionally add header <define header 425 // name> with ASCII representation of EndpointLoadMetricStats. 426 // 4. Envoy aggregates load reports over the period of time given to it in 427 // LoadStatsResponse.load_reporting_interval. This includes aggregation 428 // stats Envoy maintains by itself (total_requests, rpc_errors etc.) as 429 // well as load metrics from upstream hosts. 430 // 5. When the timer of load_reporting_interval expires, Envoy sends new 431 // LoadStatsRequest filled with load reports for each cluster. 432 // 6. The management server uses the load reports from all reported Envoys 433 // from around the world, computes global assignment and prepares traffic 434 // assignment destined for each zone Envoys are located in. Goto 2. 435 StreamLoadStats(LoadReportingService_StreamLoadStatsServer) error 436 } 437 438 // UnimplementedLoadReportingServiceServer can be embedded to have forward compatible implementations. 439 type UnimplementedLoadReportingServiceServer struct { 440 } 441 442 func (*UnimplementedLoadReportingServiceServer) StreamLoadStats(LoadReportingService_StreamLoadStatsServer) error { 443 return status.Errorf(codes.Unimplemented, "method StreamLoadStats not implemented") 444 } 445 446 func RegisterLoadReportingServiceServer(s *grpc.Server, srv LoadReportingServiceServer) { 447 s.RegisterService(&_LoadReportingService_serviceDesc, srv) 448 } 449 450 func _LoadReportingService_StreamLoadStats_Handler(srv interface{}, stream grpc.ServerStream) error { 451 return srv.(LoadReportingServiceServer).StreamLoadStats(&loadReportingServiceStreamLoadStatsServer{stream}) 452 } 453 454 type LoadReportingService_StreamLoadStatsServer interface { 455 Send(*LoadStatsResponse) error 456 Recv() (*LoadStatsRequest, error) 457 grpc.ServerStream 458 } 459 460 type loadReportingServiceStreamLoadStatsServer struct { 461 grpc.ServerStream 462 } 463 464 func (x *loadReportingServiceStreamLoadStatsServer) Send(m *LoadStatsResponse) error { 465 return x.ServerStream.SendMsg(m) 466 } 467 468 func (x *loadReportingServiceStreamLoadStatsServer) Recv() (*LoadStatsRequest, error) { 469 m := new(LoadStatsRequest) 470 if err := x.ServerStream.RecvMsg(m); err != nil { 471 return nil, err 472 } 473 return m, nil 474 } 475 476 var _LoadReportingService_serviceDesc = grpc.ServiceDesc{ 477 ServiceName: "envoy.service.load_stats.v2.LoadReportingService", 478 HandlerType: (*LoadReportingServiceServer)(nil), 479 Methods: []grpc.MethodDesc{}, 480 Streams: []grpc.StreamDesc{ 481 { 482 StreamName: "StreamLoadStats", 483 Handler: _LoadReportingService_StreamLoadStats_Handler, 484 ServerStreams: true, 485 ClientStreams: true, 486 }, 487 }, 488 Metadata: "envoy/service/load_stats/v2/lrs.proto", 489 }