// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.4.0
// - protoc             v3.12.4
// source: services/metrics_service_v2.proto

package grpc

import (
	context "context"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
)

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.62.0 or later.
const _ = grpc.SupportPackageIsVersion8

const (
	MetricsServiceV2_Connect_FullMethodName = "/grpc.MetricsServiceV2/Connect"
)

// MetricsServiceV2Client is the client API for MetricsServiceV2 service.
//
// 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.
type MetricsServiceV2Client interface {
	Connect(ctx context.Context, opts ...grpc.CallOption) (MetricsServiceV2_ConnectClient, error)
}

type metricsServiceV2Client struct {
	cc grpc.ClientConnInterface
}

func NewMetricsServiceV2Client(cc grpc.ClientConnInterface) MetricsServiceV2Client {
	return &metricsServiceV2Client{cc}
}

func (c *metricsServiceV2Client) Connect(ctx context.Context, opts ...grpc.CallOption) (MetricsServiceV2_ConnectClient, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &MetricsServiceV2_ServiceDesc.Streams[0], MetricsServiceV2_Connect_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &metricsServiceV2ConnectClient{ClientStream: stream}
	return x, nil
}

type MetricsServiceV2_ConnectClient interface {
	Send(*MetricsServiceV2ConnectRequest) error
	Recv() (*MetricsServiceV2ConnectResponse, error)
	grpc.ClientStream
}

type metricsServiceV2ConnectClient struct {
	grpc.ClientStream
}

func (x *metricsServiceV2ConnectClient) Send(m *MetricsServiceV2ConnectRequest) error {
	return x.ClientStream.SendMsg(m)
}

func (x *metricsServiceV2ConnectClient) Recv() (*MetricsServiceV2ConnectResponse, error) {
	m := new(MetricsServiceV2ConnectResponse)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

// MetricsServiceV2Server is the server API for MetricsServiceV2 service.
// All implementations must embed UnimplementedMetricsServiceV2Server
// for forward compatibility
type MetricsServiceV2Server interface {
	Connect(MetricsServiceV2_ConnectServer) error
	mustEmbedUnimplementedMetricsServiceV2Server()
}

// UnimplementedMetricsServiceV2Server must be embedded to have forward compatible implementations.
type UnimplementedMetricsServiceV2Server struct {
}

func (UnimplementedMetricsServiceV2Server) Connect(MetricsServiceV2_ConnectServer) error {
	return status.Errorf(codes.Unimplemented, "method Connect not implemented")
}
func (UnimplementedMetricsServiceV2Server) mustEmbedUnimplementedMetricsServiceV2Server() {}

// UnsafeMetricsServiceV2Server may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to MetricsServiceV2Server will
// result in compilation errors.
type UnsafeMetricsServiceV2Server interface {
	mustEmbedUnimplementedMetricsServiceV2Server()
}

func RegisterMetricsServiceV2Server(s grpc.ServiceRegistrar, srv MetricsServiceV2Server) {
	s.RegisterService(&MetricsServiceV2_ServiceDesc, srv)
}

func _MetricsServiceV2_Connect_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(MetricsServiceV2Server).Connect(&metricsServiceV2ConnectServer{ServerStream: stream})
}

type MetricsServiceV2_ConnectServer interface {
	Send(*MetricsServiceV2ConnectResponse) error
	Recv() (*MetricsServiceV2ConnectRequest, error)
	grpc.ServerStream
}

type metricsServiceV2ConnectServer struct {
	grpc.ServerStream
}

func (x *metricsServiceV2ConnectServer) Send(m *MetricsServiceV2ConnectResponse) error {
	return x.ServerStream.SendMsg(m)
}

func (x *metricsServiceV2ConnectServer) Recv() (*MetricsServiceV2ConnectRequest, error) {
	m := new(MetricsServiceV2ConnectRequest)
	if err := x.ServerStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

// MetricsServiceV2_ServiceDesc is the grpc.ServiceDesc for MetricsServiceV2 service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var MetricsServiceV2_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "grpc.MetricsServiceV2",
	HandlerType: (*MetricsServiceV2Server)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Connect",
			Handler:       _MetricsServiceV2_Connect_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "services/metrics_service_v2.proto",
}
