// Code generated by protoc-gen-go-grpc. DO NOT EDIT.

package monitor

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.32.0 or later.
const _ = grpc.SupportPackageIsVersion7

// MonitorServiceClient is the client API for MonitorService 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 MonitorServiceClient interface {
	Monitor(ctx context.Context, in *MonitorRequest, opts ...grpc.CallOption) (MonitorService_MonitorClient, error)
}

type monitorServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewMonitorServiceClient(cc grpc.ClientConnInterface) MonitorServiceClient {
	return &monitorServiceClient{cc}
}

func (c *monitorServiceClient) Monitor(ctx context.Context, in *MonitorRequest, opts ...grpc.CallOption) (MonitorService_MonitorClient, error) {
	stream, err := c.cc.NewStream(ctx, &MonitorService_ServiceDesc.Streams[0], "/ioc_golang.aop.monitor.MonitorService/Monitor", opts...)
	if err != nil {
		return nil, err
	}
	x := &monitorServiceMonitorClient{stream}
	if err := x.ClientStream.SendMsg(in); err != nil {
		return nil, err
	}
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	return x, nil
}

type MonitorService_MonitorClient interface {
	Recv() (*MonitorResponse, error)
	grpc.ClientStream
}

type monitorServiceMonitorClient struct {
	grpc.ClientStream
}

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

// MonitorServiceServer is the server API for MonitorService service.
// All implementations must embed UnimplementedMonitorServiceServer
// for forward compatibility
type MonitorServiceServer interface {
	Monitor(*MonitorRequest, MonitorService_MonitorServer) error
	mustEmbedUnimplementedMonitorServiceServer()
}

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

func (UnimplementedMonitorServiceServer) Monitor(*MonitorRequest, MonitorService_MonitorServer) error {
	return status.Errorf(codes.Unimplemented, "method Monitor not implemented")
}
func (UnimplementedMonitorServiceServer) mustEmbedUnimplementedMonitorServiceServer() {}

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

func RegisterMonitorServiceServer(s grpc.ServiceRegistrar, srv MonitorServiceServer) {
	s.RegisterService(&MonitorService_ServiceDesc, srv)
}

func _MonitorService_Monitor_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(MonitorRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(MonitorServiceServer).Monitor(m, &monitorServiceMonitorServer{stream})
}

type MonitorService_MonitorServer interface {
	Send(*MonitorResponse) error
	grpc.ServerStream
}

type monitorServiceMonitorServer struct {
	grpc.ServerStream
}

func (x *monitorServiceMonitorServer) Send(m *MonitorResponse) error {
	return x.ServerStream.SendMsg(m)
}

// MonitorService_ServiceDesc is the grpc.ServiceDesc for MonitorService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var MonitorService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "ioc_golang.aop.monitor.MonitorService",
	HandlerType: (*MonitorServiceServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Monitor",
			Handler:       _MonitorService_Monitor_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "extension/aop/monitor/api/ioc_golang/aop/monitor/monitor.proto",
}
