2021-07-01 15:35:06 +00:00
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
2022-04-07 04:29:32 +00:00
// versions:
// - protoc-gen-go-grpc v1.2.0
2022-04-22 10:49:38 +00:00
// - protoc v3.20.1
2022-04-07 04:29:32 +00:00
// source: downloader/downloader.proto
2021-07-01 15:35:06 +00:00
2021-12-14 13:33:32 +00:00
package downloader
2021-07-01 15:35:06 +00:00
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
emptypb "google.golang.org/protobuf/types/known/emptypb"
)
// 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
// DownloaderClient is the client API for Downloader 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 DownloaderClient interface {
2021-12-14 13:33:32 +00:00
Download ( ctx context . Context , in * DownloadRequest , opts ... grpc . CallOption ) ( * emptypb . Empty , error )
Stats ( ctx context . Context , in * StatsRequest , opts ... grpc . CallOption ) ( * StatsReply , error )
2021-07-01 15:35:06 +00:00
}
type downloaderClient struct {
cc grpc . ClientConnInterface
}
func NewDownloaderClient ( cc grpc . ClientConnInterface ) DownloaderClient {
return & downloaderClient { cc }
}
2021-12-14 13:33:32 +00:00
func ( c * downloaderClient ) Download ( ctx context . Context , in * DownloadRequest , opts ... grpc . CallOption ) ( * emptypb . Empty , error ) {
2021-07-01 15:35:06 +00:00
out := new ( emptypb . Empty )
2021-12-14 13:33:32 +00:00
err := c . cc . Invoke ( ctx , "/downloader.Downloader/Download" , in , out , opts ... )
2021-07-01 15:35:06 +00:00
if err != nil {
return nil , err
}
return out , nil
}
2021-12-14 13:33:32 +00:00
func ( c * downloaderClient ) Stats ( ctx context . Context , in * StatsRequest , opts ... grpc . CallOption ) ( * StatsReply , error ) {
out := new ( StatsReply )
err := c . cc . Invoke ( ctx , "/downloader.Downloader/Stats" , in , out , opts ... )
2021-07-01 15:35:06 +00:00
if err != nil {
return nil , err
}
return out , nil
}
// DownloaderServer is the server API for Downloader service.
// All implementations must embed UnimplementedDownloaderServer
// for forward compatibility
type DownloaderServer interface {
2021-12-14 13:33:32 +00:00
Download ( context . Context , * DownloadRequest ) ( * emptypb . Empty , error )
Stats ( context . Context , * StatsRequest ) ( * StatsReply , error )
2021-07-01 15:35:06 +00:00
mustEmbedUnimplementedDownloaderServer ( )
}
// UnimplementedDownloaderServer must be embedded to have forward compatible implementations.
type UnimplementedDownloaderServer struct {
}
2021-12-14 13:33:32 +00:00
func ( UnimplementedDownloaderServer ) Download ( context . Context , * DownloadRequest ) ( * emptypb . Empty , error ) {
2021-07-01 15:35:06 +00:00
return nil , status . Errorf ( codes . Unimplemented , "method Download not implemented" )
}
2021-12-14 13:33:32 +00:00
func ( UnimplementedDownloaderServer ) Stats ( context . Context , * StatsRequest ) ( * StatsReply , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method Stats not implemented" )
2021-07-01 15:35:06 +00:00
}
func ( UnimplementedDownloaderServer ) mustEmbedUnimplementedDownloaderServer ( ) { }
// UnsafeDownloaderServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to DownloaderServer will
// result in compilation errors.
type UnsafeDownloaderServer interface {
mustEmbedUnimplementedDownloaderServer ( )
}
func RegisterDownloaderServer ( s grpc . ServiceRegistrar , srv DownloaderServer ) {
s . RegisterService ( & Downloader_ServiceDesc , srv )
}
func _Downloader_Download_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
2021-12-14 13:33:32 +00:00
in := new ( DownloadRequest )
2021-07-01 15:35:06 +00:00
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( DownloaderServer ) . Download ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
2021-12-14 13:33:32 +00:00
FullMethod : "/downloader.Downloader/Download" ,
2021-07-01 15:35:06 +00:00
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
2021-12-14 13:33:32 +00:00
return srv . ( DownloaderServer ) . Download ( ctx , req . ( * DownloadRequest ) )
2021-07-01 15:35:06 +00:00
}
return interceptor ( ctx , in , info , handler )
}
2021-12-14 13:33:32 +00:00
func _Downloader_Stats_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( StatsRequest )
2021-07-01 15:35:06 +00:00
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
2021-12-14 13:33:32 +00:00
return srv . ( DownloaderServer ) . Stats ( ctx , in )
2021-07-01 15:35:06 +00:00
}
info := & grpc . UnaryServerInfo {
Server : srv ,
2021-12-14 13:33:32 +00:00
FullMethod : "/downloader.Downloader/Stats" ,
2021-07-01 15:35:06 +00:00
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
2021-12-14 13:33:32 +00:00
return srv . ( DownloaderServer ) . Stats ( ctx , req . ( * StatsRequest ) )
2021-07-01 15:35:06 +00:00
}
return interceptor ( ctx , in , info , handler )
}
// Downloader_ServiceDesc is the grpc.ServiceDesc for Downloader service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Downloader_ServiceDesc = grpc . ServiceDesc {
2021-12-14 13:33:32 +00:00
ServiceName : "downloader.Downloader" ,
2021-07-01 15:35:06 +00:00
HandlerType : ( * DownloaderServer ) ( nil ) ,
Methods : [ ] grpc . MethodDesc {
{
MethodName : "Download" ,
Handler : _Downloader_Download_Handler ,
} ,
{
2021-12-14 13:33:32 +00:00
MethodName : "Stats" ,
Handler : _Downloader_Stats_Handler ,
2021-07-01 15:35:06 +00:00
} ,
} ,
Streams : [ ] grpc . StreamDesc { } ,
2021-12-14 13:33:32 +00:00
Metadata : "downloader/downloader.proto" ,
2021-07-01 15:35:06 +00:00
}