// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.1.0
// - protoc             v3.13.0
// source: receiver.proto

package receiverpb

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

// ReceiverClient is the client API for Receiver 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 ReceiverClient interface {
	PushPacket(ctx context.Context, in *Packet, opts ...grpc.CallOption) (*BaseResp, error)
}

type receiverClient struct {
	cc grpc.ClientConnInterface
}

func NewReceiverClient(cc grpc.ClientConnInterface) ReceiverClient {
	return &receiverClient{cc}
}

func (c *receiverClient) PushPacket(ctx context.Context, in *Packet, opts ...grpc.CallOption) (*BaseResp, error) {
	out := new(BaseResp)
	err := c.cc.Invoke(ctx, "/receiverpb.Receiver/PushPacket", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// ReceiverServer is the server API for Receiver service.
// All implementations should embed UnimplementedReceiverServer
// for forward compatibility
type ReceiverServer interface {
	PushPacket(context.Context, *Packet) (*BaseResp, error)
}

// UnimplementedReceiverServer should be embedded to have forward compatible implementations.
type UnimplementedReceiverServer struct {
}

func (UnimplementedReceiverServer) PushPacket(context.Context, *Packet) (*BaseResp, error) {
	return nil, status.Errorf(codes.Unimplemented, "method PushPacket not implemented")
}

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

func RegisterReceiverServer(s grpc.ServiceRegistrar, srv ReceiverServer) {
	s.RegisterService(&Receiver_ServiceDesc, srv)
}

func _Receiver_PushPacket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Packet)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ReceiverServer).PushPacket(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/receiverpb.Receiver/PushPacket",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ReceiverServer).PushPacket(ctx, req.(*Packet))
	}
	return interceptor(ctx, in, info, handler)
}

// Receiver_ServiceDesc is the grpc.ServiceDesc for Receiver service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Receiver_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "receiverpb.Receiver",
	HandlerType: (*ReceiverServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "PushPacket",
			Handler:    _Receiver_PushPacket_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "receiver.proto",
}
