| 1 |
// Code generated by protoc-gen-go-grpc. DO NOT EDIT. |
| 2 |
// versions: |
| 3 |
// - protoc-gen-go-grpc v1.3.0 |
| 4 |
// - protoc v5.29.1 |
| 5 |
// source: envoy/service/load_stats/v3/lrs.proto |
| 6 |
|
| 7 |
package load_statsv3 |
| 8 |
|
| 9 |
import ( |
| 10 |
context "context" |
| 11 |
grpc "google.golang.org/grpc" |
| 12 |
codes "google.golang.org/grpc/codes" |
| 13 |
status "google.golang.org/grpc/status" |
| 14 |
) |
| 15 |
|
| 16 |
// This is a compile-time assertion to ensure that this generated file |
| 17 |
// is compatible with the grpc package it is being compiled against. |
| 18 |
// Requires gRPC-Go v1.32.0 or later. |
| 19 |
const _ = grpc.SupportPackageIsVersion7 |
| 20 |
|
| 21 |
const ( |
| 22 |
LoadReportingService_StreamLoadStats_FullMethodName = "/envoy.service.load_stats.v3.LoadReportingService/StreamLoadStats" |
| 23 |
) |
| 24 |
|
| 25 |
// LoadReportingServiceClient is the client API for LoadReportingService service. |
| 26 |
// |
| 27 |
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. |
| 28 |
type LoadReportingServiceClient interface { |
| 29 |
// Advanced API to allow for multi-dimensional load balancing by remote |
| 30 |
// server. For receiving LB assignments, the steps are: |
| 31 |
// 1, The management server is configured with per cluster/zone/load metric |
| 32 |
// |
| 33 |
// capacity configuration. The capacity configuration definition is |
| 34 |
// outside of the scope of this document. |
| 35 |
// 2. Envoy issues a standard {Stream,Fetch}Endpoints request for the clusters |
| 36 |
// to balance. |
| 37 |
// |
| 38 |
// Independently, Envoy will initiate a StreamLoadStats bidi stream with a |
| 39 |
// management server: |
| 40 |
// 1. Once a connection establishes, the management server publishes a |
| 41 |
// LoadStatsResponse for all clusters it is interested in learning load |
| 42 |
// stats about. |
| 43 |
// 2. For each cluster, Envoy load balances incoming traffic to upstream hosts |
| 44 |
// based on per-zone weights and/or per-instance weights (if specified) |
| 45 |
// based on intra-zone LbPolicy. This information comes from the above |
| 46 |
// {Stream,Fetch}Endpoints. |
| 47 |
// 3. When upstream hosts reply, they optionally add header <define header |
| 48 |
// name> with ASCII representation of EndpointLoadMetricStats. |
| 49 |
// 4. Envoy aggregates load reports over the period of time given to it in |
| 50 |
// LoadStatsResponse.load_reporting_interval. This includes aggregation |
| 51 |
// stats Envoy maintains by itself (total_requests, rpc_errors etc.) as |
| 52 |
// well as load metrics from upstream hosts. |
| 53 |
// 5. When the timer of load_reporting_interval expires, Envoy sends new |
| 54 |
// LoadStatsRequest filled with load reports for each cluster. |
| 55 |
// 6. The management server uses the load reports from all reported Envoys |
| 56 |
// from around the world, computes global assignment and prepares traffic |
| 57 |
// assignment destined for each zone Envoys are located in. Goto 2. |
| 58 |
StreamLoadStats(ctx context.Context, opts ...grpc.CallOption) (LoadReportingService_StreamLoadStatsClient, error) |
| 59 |
} |
| 60 |
|
| 61 |
type loadReportingServiceClient struct { |
| 62 |
cc grpc.ClientConnInterface |
| 63 |
} |
| 64 |
|
| 65 |
func NewLoadReportingServiceClient(cc grpc.ClientConnInterface) LoadReportingServiceClient { |
| 66 |
return &loadReportingServiceClient{cc} |
| 67 |
} |
| 68 |
|
| 69 |
func (c *loadReportingServiceClient) StreamLoadStats(ctx context.Context, opts ...grpc.CallOption) (LoadReportingService_StreamLoadStatsClient, error) { |
| 70 |
stream, err := c.cc.NewStream(ctx, &LoadReportingService_ServiceDesc.Streams[0], LoadReportingService_StreamLoadStats_FullMethodName, opts...) |
| 71 |
if err != nil { |
| 72 |
return nil, err |
| 73 |
} |
| 74 |
x := &loadReportingServiceStreamLoadStatsClient{stream} |
| 75 |
return x, nil |
| 76 |
} |
| 77 |
|
| 78 |
type LoadReportingService_StreamLoadStatsClient interface { |
| 79 |
Send(*LoadStatsRequest) error |
| 80 |
Recv() (*LoadStatsResponse, error) |
| 81 |
grpc.ClientStream |
| 82 |
} |
| 83 |
|
| 84 |
type loadReportingServiceStreamLoadStatsClient struct { |
| 85 |
grpc.ClientStream |
| 86 |
} |
| 87 |
|
| 88 |
func (x *loadReportingServiceStreamLoadStatsClient) Send(m *LoadStatsRequest) error { |
| 89 |
return x.ClientStream.SendMsg(m) |
| 90 |
} |
| 91 |
|
| 92 |
func (x *loadReportingServiceStreamLoadStatsClient) Recv() (*LoadStatsResponse, error) { |
| 93 |
m := new(LoadStatsResponse) |
| 94 |
if err := x.ClientStream.RecvMsg(m); err != nil { |
| 95 |
return nil, err |
| 96 |
} |
| 97 |
return m, nil |
| 98 |
} |
| 99 |
|
| 100 |
// LoadReportingServiceServer is the server API for LoadReportingService service. |
| 101 |
// All implementations should embed UnimplementedLoadReportingServiceServer |
| 102 |
// for forward compatibility |
| 103 |
type LoadReportingServiceServer interface { |
| 104 |
// Advanced API to allow for multi-dimensional load balancing by remote |
| 105 |
// server. For receiving LB assignments, the steps are: |
| 106 |
// 1, The management server is configured with per cluster/zone/load metric |
| 107 |
// |
| 108 |
// capacity configuration. The capacity configuration definition is |
| 109 |
// outside of the scope of this document. |
| 110 |
// 2. Envoy issues a standard {Stream,Fetch}Endpoints request for the clusters |
| 111 |
// to balance. |
| 112 |
// |
| 113 |
// Independently, Envoy will initiate a StreamLoadStats bidi stream with a |
| 114 |
// management server: |
| 115 |
// 1. Once a connection establishes, the management server publishes a |
| 116 |
// LoadStatsResponse for all clusters it is interested in learning load |
| 117 |
// stats about. |
| 118 |
// 2. For each cluster, Envoy load balances incoming traffic to upstream hosts |
| 119 |
// based on per-zone weights and/or per-instance weights (if specified) |
| 120 |
// based on intra-zone LbPolicy. This information comes from the above |
| 121 |
// {Stream,Fetch}Endpoints. |
| 122 |
// 3. When upstream hosts reply, they optionally add header <define header |
| 123 |
// name> with ASCII representation of EndpointLoadMetricStats. |
| 124 |
// 4. Envoy aggregates load reports over the period of time given to it in |
| 125 |
// LoadStatsResponse.load_reporting_interval. This includes aggregation |
| 126 |
// stats Envoy maintains by itself (total_requests, rpc_errors etc.) as |
| 127 |
// well as load metrics from upstream hosts. |
| 128 |
// 5. When the timer of load_reporting_interval expires, Envoy sends new |
| 129 |
// LoadStatsRequest filled with load reports for each cluster. |
| 130 |
// 6. The management server uses the load reports from all reported Envoys |
| 131 |
// from around the world, computes global assignment and prepares traffic |
| 132 |
// assignment destined for each zone Envoys are located in. Goto 2. |
| 133 |
StreamLoadStats(LoadReportingService_StreamLoadStatsServer) error |
| 134 |
} |
| 135 |
|
| 136 |
// UnimplementedLoadReportingServiceServer should be embedded to have forward compatible implementations. |
| 137 |
type UnimplementedLoadReportingServiceServer struct { |
| 138 |
} |
| 139 |
|
| 140 |
func (UnimplementedLoadReportingServiceServer) StreamLoadStats(LoadReportingService_StreamLoadStatsServer) error { |
| 141 |
return status.Errorf(codes.Unimplemented, "method StreamLoadStats not implemented") |
| 142 |
} |
| 143 |
|
| 144 |
// UnsafeLoadReportingServiceServer may be embedded to opt out of forward compatibility for this service. |
| 145 |
// Use of this interface is not recommended, as added methods to LoadReportingServiceServer will |
| 146 |
// result in compilation errors. |
| 147 |
type UnsafeLoadReportingServiceServer interface { |
| 148 |
mustEmbedUnimplementedLoadReportingServiceServer() |
| 149 |
} |
| 150 |
|
| 151 |
func RegisterLoadReportingServiceServer(s grpc.ServiceRegistrar, srv LoadReportingServiceServer) { |
| 152 |
s.RegisterService(&LoadReportingService_ServiceDesc, srv) |
| 153 |
} |
| 154 |
|
| 155 |
func _LoadReportingService_StreamLoadStats_Handler(srv interface{}, stream grpc.ServerStream) error { |
| 156 |
return srv.(LoadReportingServiceServer).StreamLoadStats(&loadReportingServiceStreamLoadStatsServer{stream}) |
| 157 |
} |
| 158 |
|
| 159 |
type LoadReportingService_StreamLoadStatsServer interface { |
| 160 |
Send(*LoadStatsResponse) error |
| 161 |
Recv() (*LoadStatsRequest, error) |
| 162 |
grpc.ServerStream |
| 163 |
} |
| 164 |
|
| 165 |
type loadReportingServiceStreamLoadStatsServer struct { |
| 166 |
grpc.ServerStream |
| 167 |
} |
| 168 |
|
| 169 |
func (x *loadReportingServiceStreamLoadStatsServer) Send(m *LoadStatsResponse) error { |
| 170 |
return x.ServerStream.SendMsg(m) |
| 171 |
} |
| 172 |
|
| 173 |
func (x *loadReportingServiceStreamLoadStatsServer) Recv() (*LoadStatsRequest, error) { |
| 174 |
m := new(LoadStatsRequest) |
| 175 |
if err := x.ServerStream.RecvMsg(m); err != nil { |
| 176 |
return nil, err |
| 177 |
} |
| 178 |
return m, nil |
| 179 |
} |
| 180 |
|
| 181 |
// LoadReportingService_ServiceDesc is the grpc.ServiceDesc for LoadReportingService service. |
| 182 |
// It's only intended for direct use with grpc.RegisterService, |
| 183 |
// and not to be introspected or modified (even as a copy) |
| 184 |
var LoadReportingService_ServiceDesc = grpc.ServiceDesc{ |
| 185 |
ServiceName: "envoy.service.load_stats.v3.LoadReportingService", |
| 186 |
HandlerType: (*LoadReportingServiceServer)(nil), |
| 187 |
Methods: []grpc.MethodDesc{}, |
| 188 |
Streams: []grpc.StreamDesc{ |
| 189 |
{ |
| 190 |
StreamName: "StreamLoadStats", |
| 191 |
Handler: _LoadReportingService_StreamLoadStats_Handler, |
| 192 |
ServerStreams: true, |
| 193 |
ClientStreams: true, |
| 194 |
}, |
| 195 |
}, |
| 196 |
Metadata: "envoy/service/load_stats/v3/lrs.proto", |
| 197 |
} |