| 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/metrics/v3/metrics_service.proto |
| 6 |
|
| 7 |
package metricsv3 |
| 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 |
MetricsService_StreamMetrics_FullMethodName = "/envoy.service.metrics.v3.MetricsService/StreamMetrics" |
| 23 |
) |
| 24 |
|
| 25 |
// MetricsServiceClient is the client API for MetricsService 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 MetricsServiceClient interface { |
| 29 |
// Envoy will connect and send StreamMetricsMessage messages forever. It does not expect any |
| 30 |
// response to be sent as nothing would be done in the case of failure. |
| 31 |
StreamMetrics(ctx context.Context, opts ...grpc.CallOption) (MetricsService_StreamMetricsClient, error) |
| 32 |
} |
| 33 |
|
| 34 |
type metricsServiceClient struct { |
| 35 |
cc grpc.ClientConnInterface |
| 36 |
} |
| 37 |
|
| 38 |
func NewMetricsServiceClient(cc grpc.ClientConnInterface) MetricsServiceClient { |
| 39 |
return &metricsServiceClient{cc} |
| 40 |
} |
| 41 |
|
| 42 |
func (c *metricsServiceClient) StreamMetrics(ctx context.Context, opts ...grpc.CallOption) (MetricsService_StreamMetricsClient, error) { |
| 43 |
stream, err := c.cc.NewStream(ctx, &MetricsService_ServiceDesc.Streams[0], MetricsService_StreamMetrics_FullMethodName, opts...) |
| 44 |
if err != nil { |
| 45 |
return nil, err |
| 46 |
} |
| 47 |
x := &metricsServiceStreamMetricsClient{stream} |
| 48 |
return x, nil |
| 49 |
} |
| 50 |
|
| 51 |
type MetricsService_StreamMetricsClient interface { |
| 52 |
Send(*StreamMetricsMessage) error |
| 53 |
CloseAndRecv() (*StreamMetricsResponse, error) |
| 54 |
grpc.ClientStream |
| 55 |
} |
| 56 |
|
| 57 |
type metricsServiceStreamMetricsClient struct { |
| 58 |
grpc.ClientStream |
| 59 |
} |
| 60 |
|
| 61 |
func (x *metricsServiceStreamMetricsClient) Send(m *StreamMetricsMessage) error { |
| 62 |
return x.ClientStream.SendMsg(m) |
| 63 |
} |
| 64 |
|
| 65 |
func (x *metricsServiceStreamMetricsClient) CloseAndRecv() (*StreamMetricsResponse, error) { |
| 66 |
if err := x.ClientStream.CloseSend(); err != nil { |
| 67 |
return nil, err |
| 68 |
} |
| 69 |
m := new(StreamMetricsResponse) |
| 70 |
if err := x.ClientStream.RecvMsg(m); err != nil { |
| 71 |
return nil, err |
| 72 |
} |
| 73 |
return m, nil |
| 74 |
} |
| 75 |
|
| 76 |
// MetricsServiceServer is the server API for MetricsService service. |
| 77 |
// All implementations should embed UnimplementedMetricsServiceServer |
| 78 |
// for forward compatibility |
| 79 |
type MetricsServiceServer interface { |
| 80 |
// Envoy will connect and send StreamMetricsMessage messages forever. It does not expect any |
| 81 |
// response to be sent as nothing would be done in the case of failure. |
| 82 |
StreamMetrics(MetricsService_StreamMetricsServer) error |
| 83 |
} |
| 84 |
|
| 85 |
// UnimplementedMetricsServiceServer should be embedded to have forward compatible implementations. |
| 86 |
type UnimplementedMetricsServiceServer struct { |
| 87 |
} |
| 88 |
|
| 89 |
func (UnimplementedMetricsServiceServer) StreamMetrics(MetricsService_StreamMetricsServer) error { |
| 90 |
return status.Errorf(codes.Unimplemented, "method StreamMetrics not implemented") |
| 91 |
} |
| 92 |
|
| 93 |
// UnsafeMetricsServiceServer may be embedded to opt out of forward compatibility for this service. |
| 94 |
// Use of this interface is not recommended, as added methods to MetricsServiceServer will |
| 95 |
// result in compilation errors. |
| 96 |
type UnsafeMetricsServiceServer interface { |
| 97 |
mustEmbedUnimplementedMetricsServiceServer() |
| 98 |
} |
| 99 |
|
| 100 |
func RegisterMetricsServiceServer(s grpc.ServiceRegistrar, srv MetricsServiceServer) { |
| 101 |
s.RegisterService(&MetricsService_ServiceDesc, srv) |
| 102 |
} |
| 103 |
|
| 104 |
func _MetricsService_StreamMetrics_Handler(srv interface{}, stream grpc.ServerStream) error { |
| 105 |
return srv.(MetricsServiceServer).StreamMetrics(&metricsServiceStreamMetricsServer{stream}) |
| 106 |
} |
| 107 |
|
| 108 |
type MetricsService_StreamMetricsServer interface { |
| 109 |
SendAndClose(*StreamMetricsResponse) error |
| 110 |
Recv() (*StreamMetricsMessage, error) |
| 111 |
grpc.ServerStream |
| 112 |
} |
| 113 |
|
| 114 |
type metricsServiceStreamMetricsServer struct { |
| 115 |
grpc.ServerStream |
| 116 |
} |
| 117 |
|
| 118 |
func (x *metricsServiceStreamMetricsServer) SendAndClose(m *StreamMetricsResponse) error { |
| 119 |
return x.ServerStream.SendMsg(m) |
| 120 |
} |
| 121 |
|
| 122 |
func (x *metricsServiceStreamMetricsServer) Recv() (*StreamMetricsMessage, error) { |
| 123 |
m := new(StreamMetricsMessage) |
| 124 |
if err := x.ServerStream.RecvMsg(m); err != nil { |
| 125 |
return nil, err |
| 126 |
} |
| 127 |
return m, nil |
| 128 |
} |
| 129 |
|
| 130 |
// MetricsService_ServiceDesc is the grpc.ServiceDesc for MetricsService service. |
| 131 |
// It's only intended for direct use with grpc.RegisterService, |
| 132 |
// and not to be introspected or modified (even as a copy) |
| 133 |
var MetricsService_ServiceDesc = grpc.ServiceDesc{ |
| 134 |
ServiceName: "envoy.service.metrics.v3.MetricsService", |
| 135 |
HandlerType: (*MetricsServiceServer)(nil), |
| 136 |
Methods: []grpc.MethodDesc{}, |
| 137 |
Streams: []grpc.StreamDesc{ |
| 138 |
{ |
| 139 |
StreamName: "StreamMetrics", |
| 140 |
Handler: _MetricsService_StreamMetrics_Handler, |
| 141 |
ClientStreams: true, |
| 142 |
}, |
| 143 |
}, |
| 144 |
Metadata: "envoy/service/metrics/v3/metrics_service.proto", |
| 145 |
} |