2020-07-29 04:31:46 +00:00
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
package remote
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.
2020-09-28 17:18:36 +00:00
const _ = grpc . SupportPackageIsVersion7
2020-07-29 04:31:46 +00:00
// DBClient is the client API for DB 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 DBClient interface {
Size ( ctx context . Context , in * SizeRequest , opts ... grpc . CallOption ) ( * SizeReply , error )
BucketSize ( ctx context . Context , in * BucketSizeRequest , opts ... grpc . CallOption ) ( * BucketSizeReply , error )
}
type dBClient struct {
cc grpc . ClientConnInterface
}
func NewDBClient ( cc grpc . ClientConnInterface ) DBClient {
return & dBClient { cc }
}
2020-09-28 17:18:36 +00:00
var dBSizeStreamDesc = & grpc . StreamDesc {
StreamName : "Size" ,
}
2020-07-29 04:31:46 +00:00
func ( c * dBClient ) Size ( ctx context . Context , in * SizeRequest , opts ... grpc . CallOption ) ( * SizeReply , error ) {
out := new ( SizeReply )
err := c . cc . Invoke ( ctx , "/remote.DB/Size" , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
2020-09-28 17:18:36 +00:00
var dBBucketSizeStreamDesc = & grpc . StreamDesc {
StreamName : "BucketSize" ,
}
2020-07-29 04:31:46 +00:00
func ( c * dBClient ) BucketSize ( ctx context . Context , in * BucketSizeRequest , opts ... grpc . CallOption ) ( * BucketSizeReply , error ) {
out := new ( BucketSizeReply )
err := c . cc . Invoke ( ctx , "/remote.DB/BucketSize" , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
2020-09-28 17:18:36 +00:00
// DBService is the service API for DB service.
// Fields should be assigned to their respective handler implementations only before
// RegisterDBService is called. Any unassigned fields will result in the
// handler for that method returning an Unimplemented error.
type DBService struct {
Size func ( context . Context , * SizeRequest ) ( * SizeReply , error )
BucketSize func ( context . Context , * BucketSizeRequest ) ( * BucketSizeReply , error )
2020-07-29 04:31:46 +00:00
}
2020-09-28 17:18:36 +00:00
func ( s * DBService ) size ( _ interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
if s . Size == nil {
return nil , status . Errorf ( codes . Unimplemented , "method Size not implemented" )
}
2020-07-29 04:31:46 +00:00
in := new ( SizeRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
2020-09-28 17:18:36 +00:00
return s . Size ( ctx , in )
2020-07-29 04:31:46 +00:00
}
info := & grpc . UnaryServerInfo {
2020-09-28 17:18:36 +00:00
Server : s ,
2020-07-29 04:31:46 +00:00
FullMethod : "/remote.DB/Size" ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
2020-09-28 17:18:36 +00:00
return s . Size ( ctx , req . ( * SizeRequest ) )
2020-07-29 04:31:46 +00:00
}
return interceptor ( ctx , in , info , handler )
}
2020-09-28 17:18:36 +00:00
func ( s * DBService ) bucketSize ( _ interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
if s . BucketSize == nil {
return nil , status . Errorf ( codes . Unimplemented , "method BucketSize not implemented" )
}
2020-07-29 04:31:46 +00:00
in := new ( BucketSizeRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
2020-09-28 17:18:36 +00:00
return s . BucketSize ( ctx , in )
2020-07-29 04:31:46 +00:00
}
info := & grpc . UnaryServerInfo {
2020-09-28 17:18:36 +00:00
Server : s ,
2020-07-29 04:31:46 +00:00
FullMethod : "/remote.DB/BucketSize" ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
2020-09-28 17:18:36 +00:00
return s . BucketSize ( ctx , req . ( * BucketSizeRequest ) )
2020-07-29 04:31:46 +00:00
}
return interceptor ( ctx , in , info , handler )
}
2020-09-28 17:18:36 +00:00
// RegisterDBService registers a service implementation with a gRPC server.
func RegisterDBService ( s grpc . ServiceRegistrar , srv * DBService ) {
sd := grpc . ServiceDesc {
ServiceName : "remote.DB" ,
Methods : [ ] grpc . MethodDesc {
{
MethodName : "Size" ,
Handler : srv . size ,
} ,
{
MethodName : "BucketSize" ,
Handler : srv . bucketSize ,
} ,
2020-07-29 04:31:46 +00:00
} ,
2020-09-28 17:18:36 +00:00
Streams : [ ] grpc . StreamDesc { } ,
Metadata : "remote/db.proto" ,
}
s . RegisterService ( & sd , nil )
}
// NewDBService creates a new DBService containing the
// implemented methods of the DB service in s. Any unimplemented
// methods will result in the gRPC server returning an UNIMPLEMENTED status to the client.
// This includes situations where the method handler is misspelled or has the wrong
// signature. For this reason, this function should be used with great care and
// is not recommended to be used by most users.
func NewDBService ( s interface { } ) * DBService {
ns := & DBService { }
if h , ok := s . ( interface {
Size ( context . Context , * SizeRequest ) ( * SizeReply , error )
} ) ; ok {
ns . Size = h . Size
}
if h , ok := s . ( interface {
BucketSize ( context . Context , * BucketSizeRequest ) ( * BucketSizeReply , error )
} ) ; ok {
ns . BucketSize = h . BucketSize
}
return ns
}
// UnstableDBService is the service API for DB service.
// New methods may be added to this interface if they are added to the service
// definition, which is not a backward-compatible change. For this reason,
// use of this type is not recommended.
type UnstableDBService interface {
Size ( context . Context , * SizeRequest ) ( * SizeReply , error )
BucketSize ( context . Context , * BucketSizeRequest ) ( * BucketSizeReply , error )
2020-07-29 04:31:46 +00:00
}