// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc             (unknown)
// source: v1/agent/trace/trace.proto

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

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

type tracesClient struct {
	cc grpc.ClientConnInterface
}

func NewTracesClient(cc grpc.ClientConnInterface) TracesClient {
	return &tracesClient{cc}
}

func (c *tracesClient) Trace(ctx context.Context, in *TraceRequest, opts ...grpc.CallOption) (Traces_TraceClient, error) {
	stream, err := c.cc.NewStream(ctx, &Traces_ServiceDesc.Streams[0], "/camblet.api.v1.agent.trace.Traces/Trace", opts...)
	if err != nil {
		return nil, err
	}
	x := &tracesTraceClient{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 Traces_TraceClient interface {
	Recv() (*TraceResponse, error)
	grpc.ClientStream
}

type tracesTraceClient struct {
	grpc.ClientStream
}

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

// TracesServer is the server API for Traces service.
// All implementations must embed UnimplementedTracesServer
// for forward compatibility
type TracesServer interface {
	Trace(*TraceRequest, Traces_TraceServer) error
	mustEmbedUnimplementedTracesServer()
}

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

func (UnimplementedTracesServer) Trace(*TraceRequest, Traces_TraceServer) error {
	return status.Errorf(codes.Unimplemented, "method Trace not implemented")
}
func (UnimplementedTracesServer) mustEmbedUnimplementedTracesServer() {}

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

func RegisterTracesServer(s grpc.ServiceRegistrar, srv TracesServer) {
	s.RegisterService(&Traces_ServiceDesc, srv)
}

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

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

type tracesTraceServer struct {
	grpc.ServerStream
}

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

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