276 lines
10 KiB
Go
276 lines
10 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.6.1
|
|
// - protoc v5.29.6
|
|
// source: game.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.64.0 or later.
|
|
const _ = grpc.SupportPackageIsVersion9
|
|
|
|
const (
|
|
Public_AddGames_FullMethodName = "/pb.public/AddGames"
|
|
Public_UpdateGames_FullMethodName = "/pb.public/UpdateGames"
|
|
Public_DelGames_FullMethodName = "/pb.public/DelGames"
|
|
Public_GetGamesById_FullMethodName = "/pb.public/GetGamesById"
|
|
Public_SearchGames_FullMethodName = "/pb.public/SearchGames"
|
|
)
|
|
|
|
// PublicClient is the client API for Public 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 PublicClient interface {
|
|
// -----------------------games-----------------------
|
|
AddGames(ctx context.Context, in *AddGamesReq, opts ...grpc.CallOption) (*AddGamesResp, error)
|
|
UpdateGames(ctx context.Context, in *UpdateGamesReq, opts ...grpc.CallOption) (*UpdateGamesResp, error)
|
|
DelGames(ctx context.Context, in *DelGamesReq, opts ...grpc.CallOption) (*DelGamesResp, error)
|
|
GetGamesById(ctx context.Context, in *GetGamesByIdReq, opts ...grpc.CallOption) (*GetGamesByIdResp, error)
|
|
SearchGames(ctx context.Context, in *SearchGamesReq, opts ...grpc.CallOption) (*SearchGamesResp, error)
|
|
}
|
|
|
|
type publicClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewPublicClient(cc grpc.ClientConnInterface) PublicClient {
|
|
return &publicClient{cc}
|
|
}
|
|
|
|
func (c *publicClient) AddGames(ctx context.Context, in *AddGamesReq, opts ...grpc.CallOption) (*AddGamesResp, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(AddGamesResp)
|
|
err := c.cc.Invoke(ctx, Public_AddGames_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *publicClient) UpdateGames(ctx context.Context, in *UpdateGamesReq, opts ...grpc.CallOption) (*UpdateGamesResp, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(UpdateGamesResp)
|
|
err := c.cc.Invoke(ctx, Public_UpdateGames_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *publicClient) DelGames(ctx context.Context, in *DelGamesReq, opts ...grpc.CallOption) (*DelGamesResp, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(DelGamesResp)
|
|
err := c.cc.Invoke(ctx, Public_DelGames_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *publicClient) GetGamesById(ctx context.Context, in *GetGamesByIdReq, opts ...grpc.CallOption) (*GetGamesByIdResp, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(GetGamesByIdResp)
|
|
err := c.cc.Invoke(ctx, Public_GetGamesById_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *publicClient) SearchGames(ctx context.Context, in *SearchGamesReq, opts ...grpc.CallOption) (*SearchGamesResp, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(SearchGamesResp)
|
|
err := c.cc.Invoke(ctx, Public_SearchGames_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// PublicServer is the server API for Public service.
|
|
// All implementations must embed UnimplementedPublicServer
|
|
// for forward compatibility.
|
|
type PublicServer interface {
|
|
// -----------------------games-----------------------
|
|
AddGames(context.Context, *AddGamesReq) (*AddGamesResp, error)
|
|
UpdateGames(context.Context, *UpdateGamesReq) (*UpdateGamesResp, error)
|
|
DelGames(context.Context, *DelGamesReq) (*DelGamesResp, error)
|
|
GetGamesById(context.Context, *GetGamesByIdReq) (*GetGamesByIdResp, error)
|
|
SearchGames(context.Context, *SearchGamesReq) (*SearchGamesResp, error)
|
|
mustEmbedUnimplementedPublicServer()
|
|
}
|
|
|
|
// UnimplementedPublicServer must be embedded to have
|
|
// forward compatible implementations.
|
|
//
|
|
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
|
// pointer dereference when methods are called.
|
|
type UnimplementedPublicServer struct{}
|
|
|
|
func (UnimplementedPublicServer) AddGames(context.Context, *AddGamesReq) (*AddGamesResp, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method AddGames not implemented")
|
|
}
|
|
func (UnimplementedPublicServer) UpdateGames(context.Context, *UpdateGamesReq) (*UpdateGamesResp, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method UpdateGames not implemented")
|
|
}
|
|
func (UnimplementedPublicServer) DelGames(context.Context, *DelGamesReq) (*DelGamesResp, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method DelGames not implemented")
|
|
}
|
|
func (UnimplementedPublicServer) GetGamesById(context.Context, *GetGamesByIdReq) (*GetGamesByIdResp, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method GetGamesById not implemented")
|
|
}
|
|
func (UnimplementedPublicServer) SearchGames(context.Context, *SearchGamesReq) (*SearchGamesResp, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method SearchGames not implemented")
|
|
}
|
|
func (UnimplementedPublicServer) mustEmbedUnimplementedPublicServer() {}
|
|
func (UnimplementedPublicServer) testEmbeddedByValue() {}
|
|
|
|
// UnsafePublicServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to PublicServer will
|
|
// result in compilation errors.
|
|
type UnsafePublicServer interface {
|
|
mustEmbedUnimplementedPublicServer()
|
|
}
|
|
|
|
func RegisterPublicServer(s grpc.ServiceRegistrar, srv PublicServer) {
|
|
// If the following call panics, it indicates UnimplementedPublicServer was
|
|
// embedded by pointer and is nil. This will cause panics if an
|
|
// unimplemented method is ever invoked, so we test this at initialization
|
|
// time to prevent it from happening at runtime later due to I/O.
|
|
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
|
t.testEmbeddedByValue()
|
|
}
|
|
s.RegisterService(&Public_ServiceDesc, srv)
|
|
}
|
|
|
|
func _Public_AddGames_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(AddGamesReq)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(PublicServer).AddGames(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Public_AddGames_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(PublicServer).AddGames(ctx, req.(*AddGamesReq))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Public_UpdateGames_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(UpdateGamesReq)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(PublicServer).UpdateGames(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Public_UpdateGames_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(PublicServer).UpdateGames(ctx, req.(*UpdateGamesReq))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Public_DelGames_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(DelGamesReq)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(PublicServer).DelGames(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Public_DelGames_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(PublicServer).DelGames(ctx, req.(*DelGamesReq))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Public_GetGamesById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(GetGamesByIdReq)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(PublicServer).GetGamesById(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Public_GetGamesById_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(PublicServer).GetGamesById(ctx, req.(*GetGamesByIdReq))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Public_SearchGames_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(SearchGamesReq)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(PublicServer).SearchGames(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Public_SearchGames_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(PublicServer).SearchGames(ctx, req.(*SearchGamesReq))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// Public_ServiceDesc is the grpc.ServiceDesc for Public service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var Public_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "pb.public",
|
|
HandlerType: (*PublicServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "AddGames",
|
|
Handler: _Public_AddGames_Handler,
|
|
},
|
|
{
|
|
MethodName: "UpdateGames",
|
|
Handler: _Public_UpdateGames_Handler,
|
|
},
|
|
{
|
|
MethodName: "DelGames",
|
|
Handler: _Public_DelGames_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetGamesById",
|
|
Handler: _Public_GetGamesById_Handler,
|
|
},
|
|
{
|
|
MethodName: "SearchGames",
|
|
Handler: _Public_SearchGames_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "game.proto",
|
|
}
|