147 lines
4.9 KiB
Go
147 lines
4.9 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.3.0
|
|
// - protoc v3.19.4
|
|
// source: lottery.proto
|
|
|
|
package lottery
|
|
|
|
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
|
|
|
|
const (
|
|
LotteryServer_Save_FullMethodName = "/lottery.LotteryServer/Save"
|
|
LotteryServer_Find_FullMethodName = "/lottery.LotteryServer/Find"
|
|
)
|
|
|
|
// LotteryServerClient is the client API for LotteryServer 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 LotteryServerClient interface {
|
|
Save(ctx context.Context, in *SaveReq, opts ...grpc.CallOption) (*SaveRsp, error)
|
|
Find(ctx context.Context, in *FindReq, opts ...grpc.CallOption) (*FindRsp, error)
|
|
}
|
|
|
|
type lotteryServerClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewLotteryServerClient(cc grpc.ClientConnInterface) LotteryServerClient {
|
|
return &lotteryServerClient{cc}
|
|
}
|
|
|
|
func (c *lotteryServerClient) Save(ctx context.Context, in *SaveReq, opts ...grpc.CallOption) (*SaveRsp, error) {
|
|
out := new(SaveRsp)
|
|
err := c.cc.Invoke(ctx, LotteryServer_Save_FullMethodName, in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *lotteryServerClient) Find(ctx context.Context, in *FindReq, opts ...grpc.CallOption) (*FindRsp, error) {
|
|
out := new(FindRsp)
|
|
err := c.cc.Invoke(ctx, LotteryServer_Find_FullMethodName, in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// LotteryServerServer is the server API for LotteryServer service.
|
|
// All implementations must embed UnimplementedLotteryServerServer
|
|
// for forward compatibility
|
|
type LotteryServerServer interface {
|
|
Save(context.Context, *SaveReq) (*SaveRsp, error)
|
|
Find(context.Context, *FindReq) (*FindRsp, error)
|
|
mustEmbedUnimplementedLotteryServerServer()
|
|
}
|
|
|
|
// UnimplementedLotteryServerServer must be embedded to have forward compatible implementations.
|
|
type UnimplementedLotteryServerServer struct {
|
|
}
|
|
|
|
func (UnimplementedLotteryServerServer) Save(context.Context, *SaveReq) (*SaveRsp, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Save not implemented")
|
|
}
|
|
func (UnimplementedLotteryServerServer) Find(context.Context, *FindReq) (*FindRsp, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Find not implemented")
|
|
}
|
|
func (UnimplementedLotteryServerServer) mustEmbedUnimplementedLotteryServerServer() {}
|
|
|
|
// UnsafeLotteryServerServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to LotteryServerServer will
|
|
// result in compilation errors.
|
|
type UnsafeLotteryServerServer interface {
|
|
mustEmbedUnimplementedLotteryServerServer()
|
|
}
|
|
|
|
func RegisterLotteryServerServer(s grpc.ServiceRegistrar, srv LotteryServerServer) {
|
|
s.RegisterService(&LotteryServer_ServiceDesc, srv)
|
|
}
|
|
|
|
func _LotteryServer_Save_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(SaveReq)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(LotteryServerServer).Save(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: LotteryServer_Save_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(LotteryServerServer).Save(ctx, req.(*SaveReq))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _LotteryServer_Find_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(FindReq)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(LotteryServerServer).Find(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: LotteryServer_Find_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(LotteryServerServer).Find(ctx, req.(*FindReq))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// LotteryServer_ServiceDesc is the grpc.ServiceDesc for LotteryServer service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var LotteryServer_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "lottery.LotteryServer",
|
|
HandlerType: (*LotteryServerServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "Save",
|
|
Handler: _LotteryServer_Save_Handler,
|
|
},
|
|
{
|
|
MethodName: "Find",
|
|
Handler: _LotteryServer_Find_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "lottery.proto",
|
|
}
|