github.com/hxx258456/ccgo@v0.0.5-0.20230213014102-48b35f46f66f/go-control-plane/envoy/service/metrics/v2/metrics_service.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/metrics/v2/metrics_service.proto
     6  
     7  package envoy_service_metrics_v2
     8  
     9  import (
    10  	context "context"
    11  	_ "github.com/cncf/xds/go/udpa/annotations"
    12  	core "github.com/hxx258456/ccgo/go-control-plane/envoy/api/v2/core"
    13  	_ "github.com/envoyproxy/protoc-gen-validate/validate"
    14  	proto "github.com/golang/protobuf/proto"
    15  	_go "github.com/prometheus/client_model/go"
    16  	grpc "github.com/hxx258456/ccgo/grpc"
    17  	codes "github.com/hxx258456/ccgo/grpc/codes"
    18  	status "github.com/hxx258456/ccgo/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  type StreamMetricsResponse struct {
    37  	state         protoimpl.MessageState
    38  	sizeCache     protoimpl.SizeCache
    39  	unknownFields protoimpl.UnknownFields
    40  }
    41  
    42  func (x *StreamMetricsResponse) Reset() {
    43  	*x = StreamMetricsResponse{}
    44  	if protoimpl.UnsafeEnabled {
    45  		mi := &file_envoy_service_metrics_v2_metrics_service_proto_msgTypes[0]
    46  		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
    47  		ms.StoreMessageInfo(mi)
    48  	}
    49  }
    50  
    51  func (x *StreamMetricsResponse) String() string {
    52  	return protoimpl.X.MessageStringOf(x)
    53  }
    54  
    55  func (*StreamMetricsResponse) ProtoMessage() {}
    56  
    57  func (x *StreamMetricsResponse) ProtoReflect() protoreflect.Message {
    58  	mi := &file_envoy_service_metrics_v2_metrics_service_proto_msgTypes[0]
    59  	if protoimpl.UnsafeEnabled && x != nil {
    60  		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
    61  		if ms.LoadMessageInfo() == nil {
    62  			ms.StoreMessageInfo(mi)
    63  		}
    64  		return ms
    65  	}
    66  	return mi.MessageOf(x)
    67  }
    68  
    69  // Deprecated: Use StreamMetricsResponse.ProtoReflect.Descriptor instead.
    70  func (*StreamMetricsResponse) Descriptor() ([]byte, []int) {
    71  	return file_envoy_service_metrics_v2_metrics_service_proto_rawDescGZIP(), []int{0}
    72  }
    73  
    74  type StreamMetricsMessage struct {
    75  	state         protoimpl.MessageState
    76  	sizeCache     protoimpl.SizeCache
    77  	unknownFields protoimpl.UnknownFields
    78  
    79  	// Identifier data effectively is a structured metadata. As a performance optimization this will
    80  	// only be sent in the first message on the stream.
    81  	Identifier *StreamMetricsMessage_Identifier `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"`
    82  	// A list of metric entries
    83  	EnvoyMetrics []*_go.MetricFamily `protobuf:"bytes,2,rep,name=envoy_metrics,json=envoyMetrics,proto3" json:"envoy_metrics,omitempty"`
    84  }
    85  
    86  func (x *StreamMetricsMessage) Reset() {
    87  	*x = StreamMetricsMessage{}
    88  	if protoimpl.UnsafeEnabled {
    89  		mi := &file_envoy_service_metrics_v2_metrics_service_proto_msgTypes[1]
    90  		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
    91  		ms.StoreMessageInfo(mi)
    92  	}
    93  }
    94  
    95  func (x *StreamMetricsMessage) String() string {
    96  	return protoimpl.X.MessageStringOf(x)
    97  }
    98  
    99  func (*StreamMetricsMessage) ProtoMessage() {}
   100  
   101  func (x *StreamMetricsMessage) ProtoReflect() protoreflect.Message {
   102  	mi := &file_envoy_service_metrics_v2_metrics_service_proto_msgTypes[1]
   103  	if protoimpl.UnsafeEnabled && x != nil {
   104  		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
   105  		if ms.LoadMessageInfo() == nil {
   106  			ms.StoreMessageInfo(mi)
   107  		}
   108  		return ms
   109  	}
   110  	return mi.MessageOf(x)
   111  }
   112  
   113  // Deprecated: Use StreamMetricsMessage.ProtoReflect.Descriptor instead.
   114  func (*StreamMetricsMessage) Descriptor() ([]byte, []int) {
   115  	return file_envoy_service_metrics_v2_metrics_service_proto_rawDescGZIP(), []int{1}
   116  }
   117  
   118  func (x *StreamMetricsMessage) GetIdentifier() *StreamMetricsMessage_Identifier {
   119  	if x != nil {
   120  		return x.Identifier
   121  	}
   122  	return nil
   123  }
   124  
   125  func (x *StreamMetricsMessage) GetEnvoyMetrics() []*_go.MetricFamily {
   126  	if x != nil {
   127  		return x.EnvoyMetrics
   128  	}
   129  	return nil
   130  }
   131  
   132  type StreamMetricsMessage_Identifier struct {
   133  	state         protoimpl.MessageState
   134  	sizeCache     protoimpl.SizeCache
   135  	unknownFields protoimpl.UnknownFields
   136  
   137  	// The node sending metrics over the stream.
   138  	Node *core.Node `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"`
   139  }
   140  
   141  func (x *StreamMetricsMessage_Identifier) Reset() {
   142  	*x = StreamMetricsMessage_Identifier{}
   143  	if protoimpl.UnsafeEnabled {
   144  		mi := &file_envoy_service_metrics_v2_metrics_service_proto_msgTypes[2]
   145  		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
   146  		ms.StoreMessageInfo(mi)
   147  	}
   148  }
   149  
   150  func (x *StreamMetricsMessage_Identifier) String() string {
   151  	return protoimpl.X.MessageStringOf(x)
   152  }
   153  
   154  func (*StreamMetricsMessage_Identifier) ProtoMessage() {}
   155  
   156  func (x *StreamMetricsMessage_Identifier) ProtoReflect() protoreflect.Message {
   157  	mi := &file_envoy_service_metrics_v2_metrics_service_proto_msgTypes[2]
   158  	if protoimpl.UnsafeEnabled && x != nil {
   159  		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
   160  		if ms.LoadMessageInfo() == nil {
   161  			ms.StoreMessageInfo(mi)
   162  		}
   163  		return ms
   164  	}
   165  	return mi.MessageOf(x)
   166  }
   167  
   168  // Deprecated: Use StreamMetricsMessage_Identifier.ProtoReflect.Descriptor instead.
   169  func (*StreamMetricsMessage_Identifier) Descriptor() ([]byte, []int) {
   170  	return file_envoy_service_metrics_v2_metrics_service_proto_rawDescGZIP(), []int{1, 0}
   171  }
   172  
   173  func (x *StreamMetricsMessage_Identifier) GetNode() *core.Node {
   174  	if x != nil {
   175  		return x.Node
   176  	}
   177  	return nil
   178  }
   179  
   180  var File_envoy_service_metrics_v2_metrics_service_proto protoreflect.FileDescriptor
   181  
   182  var file_envoy_service_metrics_v2_metrics_service_proto_rawDesc = []byte{
   183  	0x0a, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f,
   184  	0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69,
   185  	0x63, 0x73, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
   186  	0x12, 0x18, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e,
   187  	0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2e, 0x76, 0x32, 0x1a, 0x1c, 0x65, 0x6e, 0x76, 0x6f,
   188  	0x79, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x62, 0x61,
   189  	0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x22, 0x69, 0x6f, 0x2f, 0x70, 0x72, 0x6f,
   190  	0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2f, 0x6d,
   191  	0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x75, 0x64,
   192  	0x70, 0x61, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x73,
   193  	0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c,
   194  	0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70,
   195  	0x72, 0x6f, 0x74, 0x6f, 0x22, 0x17, 0x0a, 0x15, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4d, 0x65,
   196  	0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xff, 0x01,
   197  	0x0a, 0x14, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x4d,
   198  	0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x59, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69,
   199  	0x66, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x65, 0x6e, 0x76,
   200  	0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x6d, 0x65, 0x74, 0x72, 0x69,
   201  	0x63, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x74, 0x72,
   202  	0x69, 0x63, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74,
   203  	0x69, 0x66, 0x69, 0x65, 0x72, 0x52, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65,
   204  	0x72, 0x12, 0x47, 0x0a, 0x0d, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x5f, 0x6d, 0x65, 0x74, 0x72, 0x69,
   205  	0x63, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x69, 0x6f, 0x2e, 0x70, 0x72,
   206  	0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e,
   207  	0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x46, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x52, 0x0c, 0x65, 0x6e,
   208  	0x76, 0x6f, 0x79, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x1a, 0x43, 0x0a, 0x0a, 0x49, 0x64,
   209  	0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x35, 0x0a, 0x04, 0x6e, 0x6f, 0x64, 0x65,
   210  	0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x61,
   211  	0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x42,
   212  	0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x32,
   213  	0x86, 0x01, 0x0a, 0x0e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69,
   214  	0x63, 0x65, 0x12, 0x74, 0x0a, 0x0d, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x74, 0x72,
   215  	0x69, 0x63, 0x73, 0x12, 0x2e, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76,
   216  	0x69, 0x63, 0x65, 0x2e, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x53,
   217  	0x74, 0x72, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x4d, 0x65, 0x73, 0x73,
   218  	0x61, 0x67, 0x65, 0x1a, 0x2f, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x73, 0x65, 0x72, 0x76,
   219  	0x69, 0x63, 0x65, 0x2e, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x53,
   220  	0x74, 0x72, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, 0x70,
   221  	0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x42, 0x4a, 0x0a, 0x26, 0x69, 0x6f, 0x2e, 0x65,
   222  	0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e,
   223  	0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2e,
   224  	0x76, 0x32, 0x42, 0x13, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69,
   225  	0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x88, 0x01, 0x01, 0xba, 0x80, 0xc8, 0xd1,
   226  	0x06, 0x02, 0x10, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
   227  }
   228  
   229  var (
   230  	file_envoy_service_metrics_v2_metrics_service_proto_rawDescOnce sync.Once
   231  	file_envoy_service_metrics_v2_metrics_service_proto_rawDescData = file_envoy_service_metrics_v2_metrics_service_proto_rawDesc
   232  )
   233  
   234  func file_envoy_service_metrics_v2_metrics_service_proto_rawDescGZIP() []byte {
   235  	file_envoy_service_metrics_v2_metrics_service_proto_rawDescOnce.Do(func() {
   236  		file_envoy_service_metrics_v2_metrics_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_envoy_service_metrics_v2_metrics_service_proto_rawDescData)
   237  	})
   238  	return file_envoy_service_metrics_v2_metrics_service_proto_rawDescData
   239  }
   240  
   241  var file_envoy_service_metrics_v2_metrics_service_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
   242  var file_envoy_service_metrics_v2_metrics_service_proto_goTypes = []interface{}{
   243  	(*StreamMetricsResponse)(nil),           // 0: envoy.service.metrics.v2.StreamMetricsResponse
   244  	(*StreamMetricsMessage)(nil),            // 1: envoy.service.metrics.v2.StreamMetricsMessage
   245  	(*StreamMetricsMessage_Identifier)(nil), // 2: envoy.service.metrics.v2.StreamMetricsMessage.Identifier
   246  	(*_go.MetricFamily)(nil),                // 3: io.prometheus.client.MetricFamily
   247  	(*core.Node)(nil),                       // 4: envoy.api.v2.core.Node
   248  }
   249  var file_envoy_service_metrics_v2_metrics_service_proto_depIdxs = []int32{
   250  	2, // 0: envoy.service.metrics.v2.StreamMetricsMessage.identifier:type_name -> envoy.service.metrics.v2.StreamMetricsMessage.Identifier
   251  	3, // 1: envoy.service.metrics.v2.StreamMetricsMessage.envoy_metrics:type_name -> io.prometheus.client.MetricFamily
   252  	4, // 2: envoy.service.metrics.v2.StreamMetricsMessage.Identifier.node:type_name -> envoy.api.v2.core.Node
   253  	1, // 3: envoy.service.metrics.v2.MetricsService.StreamMetrics:input_type -> envoy.service.metrics.v2.StreamMetricsMessage
   254  	0, // 4: envoy.service.metrics.v2.MetricsService.StreamMetrics:output_type -> envoy.service.metrics.v2.StreamMetricsResponse
   255  	4, // [4:5] is the sub-list for method output_type
   256  	3, // [3:4] is the sub-list for method input_type
   257  	3, // [3:3] is the sub-list for extension type_name
   258  	3, // [3:3] is the sub-list for extension extendee
   259  	0, // [0:3] is the sub-list for field type_name
   260  }
   261  
   262  func init() { file_envoy_service_metrics_v2_metrics_service_proto_init() }
   263  func file_envoy_service_metrics_v2_metrics_service_proto_init() {
   264  	if File_envoy_service_metrics_v2_metrics_service_proto != nil {
   265  		return
   266  	}
   267  	if !protoimpl.UnsafeEnabled {
   268  		file_envoy_service_metrics_v2_metrics_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
   269  			switch v := v.(*StreamMetricsResponse); i {
   270  			case 0:
   271  				return &v.state
   272  			case 1:
   273  				return &v.sizeCache
   274  			case 2:
   275  				return &v.unknownFields
   276  			default:
   277  				return nil
   278  			}
   279  		}
   280  		file_envoy_service_metrics_v2_metrics_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
   281  			switch v := v.(*StreamMetricsMessage); i {
   282  			case 0:
   283  				return &v.state
   284  			case 1:
   285  				return &v.sizeCache
   286  			case 2:
   287  				return &v.unknownFields
   288  			default:
   289  				return nil
   290  			}
   291  		}
   292  		file_envoy_service_metrics_v2_metrics_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
   293  			switch v := v.(*StreamMetricsMessage_Identifier); i {
   294  			case 0:
   295  				return &v.state
   296  			case 1:
   297  				return &v.sizeCache
   298  			case 2:
   299  				return &v.unknownFields
   300  			default:
   301  				return nil
   302  			}
   303  		}
   304  	}
   305  	type x struct{}
   306  	out := protoimpl.TypeBuilder{
   307  		File: protoimpl.DescBuilder{
   308  			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
   309  			RawDescriptor: file_envoy_service_metrics_v2_metrics_service_proto_rawDesc,
   310  			NumEnums:      0,
   311  			NumMessages:   3,
   312  			NumExtensions: 0,
   313  			NumServices:   1,
   314  		},
   315  		GoTypes:           file_envoy_service_metrics_v2_metrics_service_proto_goTypes,
   316  		DependencyIndexes: file_envoy_service_metrics_v2_metrics_service_proto_depIdxs,
   317  		MessageInfos:      file_envoy_service_metrics_v2_metrics_service_proto_msgTypes,
   318  	}.Build()
   319  	File_envoy_service_metrics_v2_metrics_service_proto = out.File
   320  	file_envoy_service_metrics_v2_metrics_service_proto_rawDesc = nil
   321  	file_envoy_service_metrics_v2_metrics_service_proto_goTypes = nil
   322  	file_envoy_service_metrics_v2_metrics_service_proto_depIdxs = nil
   323  }
   324  
   325  // Reference imports to suppress errors if they are not otherwise used.
   326  var _ context.Context
   327  var _ grpc.ClientConnInterface
   328  
   329  // This is a compile-time assertion to ensure that this generated file
   330  // is compatible with the grpc package it is being compiled against.
   331  const _ = grpc.SupportPackageIsVersion6
   332  
   333  // MetricsServiceClient is the client API for MetricsService service.
   334  //
   335  // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
   336  type MetricsServiceClient interface {
   337  	// Envoy will connect and send StreamMetricsMessage messages forever. It does not expect any
   338  	// response to be sent as nothing would be done in the case of failure.
   339  	StreamMetrics(ctx context.Context, opts ...grpc.CallOption) (MetricsService_StreamMetricsClient, error)
   340  }
   341  
   342  type metricsServiceClient struct {
   343  	cc grpc.ClientConnInterface
   344  }
   345  
   346  func NewMetricsServiceClient(cc grpc.ClientConnInterface) MetricsServiceClient {
   347  	return &metricsServiceClient{cc}
   348  }
   349  
   350  func (c *metricsServiceClient) StreamMetrics(ctx context.Context, opts ...grpc.CallOption) (MetricsService_StreamMetricsClient, error) {
   351  	stream, err := c.cc.NewStream(ctx, &_MetricsService_serviceDesc.Streams[0], "/envoy.service.metrics.v2.MetricsService/StreamMetrics", opts...)
   352  	if err != nil {
   353  		return nil, err
   354  	}
   355  	x := &metricsServiceStreamMetricsClient{stream}
   356  	return x, nil
   357  }
   358  
   359  type MetricsService_StreamMetricsClient interface {
   360  	Send(*StreamMetricsMessage) error
   361  	CloseAndRecv() (*StreamMetricsResponse, error)
   362  	grpc.ClientStream
   363  }
   364  
   365  type metricsServiceStreamMetricsClient struct {
   366  	grpc.ClientStream
   367  }
   368  
   369  func (x *metricsServiceStreamMetricsClient) Send(m *StreamMetricsMessage) error {
   370  	return x.ClientStream.SendMsg(m)
   371  }
   372  
   373  func (x *metricsServiceStreamMetricsClient) CloseAndRecv() (*StreamMetricsResponse, error) {
   374  	if err := x.ClientStream.CloseSend(); err != nil {
   375  		return nil, err
   376  	}
   377  	m := new(StreamMetricsResponse)
   378  	if err := x.ClientStream.RecvMsg(m); err != nil {
   379  		return nil, err
   380  	}
   381  	return m, nil
   382  }
   383  
   384  // MetricsServiceServer is the server API for MetricsService service.
   385  type MetricsServiceServer interface {
   386  	// Envoy will connect and send StreamMetricsMessage messages forever. It does not expect any
   387  	// response to be sent as nothing would be done in the case of failure.
   388  	StreamMetrics(MetricsService_StreamMetricsServer) error
   389  }
   390  
   391  // UnimplementedMetricsServiceServer can be embedded to have forward compatible implementations.
   392  type UnimplementedMetricsServiceServer struct {
   393  }
   394  
   395  func (*UnimplementedMetricsServiceServer) StreamMetrics(MetricsService_StreamMetricsServer) error {
   396  	return status.Errorf(codes.Unimplemented, "method StreamMetrics not implemented")
   397  }
   398  
   399  func RegisterMetricsServiceServer(s *grpc.Server, srv MetricsServiceServer) {
   400  	s.RegisterService(&_MetricsService_serviceDesc, srv)
   401  }
   402  
   403  func _MetricsService_StreamMetrics_Handler(srv interface{}, stream grpc.ServerStream) error {
   404  	return srv.(MetricsServiceServer).StreamMetrics(&metricsServiceStreamMetricsServer{stream})
   405  }
   406  
   407  type MetricsService_StreamMetricsServer interface {
   408  	SendAndClose(*StreamMetricsResponse) error
   409  	Recv() (*StreamMetricsMessage, error)
   410  	grpc.ServerStream
   411  }
   412  
   413  type metricsServiceStreamMetricsServer struct {
   414  	grpc.ServerStream
   415  }
   416  
   417  func (x *metricsServiceStreamMetricsServer) SendAndClose(m *StreamMetricsResponse) error {
   418  	return x.ServerStream.SendMsg(m)
   419  }
   420  
   421  func (x *metricsServiceStreamMetricsServer) Recv() (*StreamMetricsMessage, error) {
   422  	m := new(StreamMetricsMessage)
   423  	if err := x.ServerStream.RecvMsg(m); err != nil {
   424  		return nil, err
   425  	}
   426  	return m, nil
   427  }
   428  
   429  var _MetricsService_serviceDesc = grpc.ServiceDesc{
   430  	ServiceName: "envoy.service.metrics.v2.MetricsService",
   431  	HandlerType: (*MetricsServiceServer)(nil),
   432  	Methods:     []grpc.MethodDesc{},
   433  	Streams: []grpc.StreamDesc{
   434  		{
   435  			StreamName:    "StreamMetrics",
   436  			Handler:       _MetricsService_StreamMetrics_Handler,
   437  			ClientStreams: true,
   438  		},
   439  	},
   440  	Metadata: "envoy/service/metrics/v2/metrics_service.proto",
   441  }