You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
108 lines
3.4 KiB
Go
108 lines
3.4 KiB
Go
3 years ago
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||
|
// versions:
|
||
|
// - protoc-gen-go-grpc v1.2.0
|
||
|
// - protoc v3.19.4
|
||
|
// source: gift.proto
|
||
|
|
||
|
package pb
|
||
|
|
||
|
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
|
||
|
|
||
|
// GiftClient is the client API for Gift 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 GiftClient interface {
|
||
|
// collectGift 收集礼物,仅作为收集使用
|
||
|
CollectGift(ctx context.Context, in *CollectGift, opts ...grpc.CallOption) (*Empty, error)
|
||
|
}
|
||
|
|
||
|
type giftClient struct {
|
||
|
cc grpc.ClientConnInterface
|
||
|
}
|
||
|
|
||
|
func NewGiftClient(cc grpc.ClientConnInterface) GiftClient {
|
||
|
return &giftClient{cc}
|
||
|
}
|
||
|
|
||
|
func (c *giftClient) CollectGift(ctx context.Context, in *CollectGift, opts ...grpc.CallOption) (*Empty, error) {
|
||
|
out := new(Empty)
|
||
|
err := c.cc.Invoke(ctx, "/pb.gift/collectGift", in, out, opts...)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return out, nil
|
||
|
}
|
||
|
|
||
|
// GiftServer is the server API for Gift service.
|
||
|
// All implementations must embed UnimplementedGiftServer
|
||
|
// for forward compatibility
|
||
|
type GiftServer interface {
|
||
|
// collectGift 收集礼物,仅作为收集使用
|
||
|
CollectGift(context.Context, *CollectGift) (*Empty, error)
|
||
|
mustEmbedUnimplementedGiftServer()
|
||
|
}
|
||
|
|
||
|
// UnimplementedGiftServer must be embedded to have forward compatible implementations.
|
||
|
type UnimplementedGiftServer struct {
|
||
|
}
|
||
|
|
||
|
func (UnimplementedGiftServer) CollectGift(context.Context, *CollectGift) (*Empty, error) {
|
||
|
return nil, status.Errorf(codes.Unimplemented, "method CollectGift not implemented")
|
||
|
}
|
||
|
func (UnimplementedGiftServer) mustEmbedUnimplementedGiftServer() {}
|
||
|
|
||
|
// UnsafeGiftServer may be embedded to opt out of forward compatibility for this service.
|
||
|
// Use of this interface is not recommended, as added methods to GiftServer will
|
||
|
// result in compilation errors.
|
||
|
type UnsafeGiftServer interface {
|
||
|
mustEmbedUnimplementedGiftServer()
|
||
|
}
|
||
|
|
||
|
func RegisterGiftServer(s grpc.ServiceRegistrar, srv GiftServer) {
|
||
|
s.RegisterService(&Gift_ServiceDesc, srv)
|
||
|
}
|
||
|
|
||
|
func _Gift_CollectGift_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
in := new(CollectGift)
|
||
|
if err := dec(in); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
if interceptor == nil {
|
||
|
return srv.(GiftServer).CollectGift(ctx, in)
|
||
|
}
|
||
|
info := &grpc.UnaryServerInfo{
|
||
|
Server: srv,
|
||
|
FullMethod: "/pb.gift/collectGift",
|
||
|
}
|
||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
return srv.(GiftServer).CollectGift(ctx, req.(*CollectGift))
|
||
|
}
|
||
|
return interceptor(ctx, in, info, handler)
|
||
|
}
|
||
|
|
||
|
// Gift_ServiceDesc is the grpc.ServiceDesc for Gift service.
|
||
|
// It's only intended for direct use with grpc.RegisterService,
|
||
|
// and not to be introspected or modified (even as a copy)
|
||
|
var Gift_ServiceDesc = grpc.ServiceDesc{
|
||
|
ServiceName: "pb.gift",
|
||
|
HandlerType: (*GiftServer)(nil),
|
||
|
Methods: []grpc.MethodDesc{
|
||
|
{
|
||
|
MethodName: "collectGift",
|
||
|
Handler: _Gift_CollectGift_Handler,
|
||
|
},
|
||
|
},
|
||
|
Streams: []grpc.StreamDesc{},
|
||
|
Metadata: "gift.proto",
|
||
|
}
|