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

package trace

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

// TraceServiceClient is the client API for TraceService 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 TraceServiceClient interface {
	Trace(ctx context.Context, in *TraceRequest, opts ...grpc.CallOption) (TraceService_TraceClient, error)
}

type traceServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewTraceServiceClient(cc grpc.ClientConnInterface) TraceServiceClient {
	return &traceServiceClient{cc}
}

func (c *traceServiceClient) Trace(ctx context.Context, in *TraceRequest, opts ...grpc.CallOption) (TraceService_TraceClient, error) {
	stream, err := c.cc.NewStream(ctx, &TraceService_ServiceDesc.Streams[0], "/ioc_golang.aop.trace.TraceService/Trace", opts...)
	if err != nil {
		return nil, err
	}
	x := &traceServiceTraceClient{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 TraceService_TraceClient interface {
	Recv() (*TraceResponse, error)
	grpc.ClientStream
}

type traceServiceTraceClient struct {
	grpc.ClientStream
}

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

// TraceServiceServer is the server API for TraceService service.
// All implementations must embed UnimplementedTraceServiceServer
// for forward compatibility
type TraceServiceServer interface {
	Trace(*TraceRequest, TraceService_TraceServer) error
	mustEmbedUnimplementedTraceServiceServer()
}

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

func (UnimplementedTraceServiceServer) Trace(*TraceRequest, TraceService_TraceServer) error {
	return status.Errorf(codes.Unimplemented, "method Trace not implemented")
}
func (UnimplementedTraceServiceServer) mustEmbedUnimplementedTraceServiceServer() {}

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

func RegisterTraceServiceServer(s grpc.ServiceRegistrar, srv TraceServiceServer) {
	s.RegisterService(&TraceService_ServiceDesc, srv)
}

func _TraceService_Trace_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(TraceRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(TraceServiceServer).Trace(m, &traceServiceTraceServer{stream})
}

type TraceService_TraceServer interface {
	Send(*TraceResponse) error
	grpc.ServerStream
}

type traceServiceTraceServer struct {
	grpc.ServerStream
}

func (x *traceServiceTraceServer) Send(m *TraceResponse) error {
	return x.ServerStream.SendMsg(m)
}

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