409 lines
12 KiB
Go
409 lines
12 KiB
Go
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||
|
// versions:
|
||
|
// - protoc-gen-go-grpc v1.2.0
|
||
|
// - protoc v3.19.4
|
||
|
// source: proto/hermeticum.proto
|
||
|
|
||
|
package proto
|
||
|
|
||
|
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
|
||
|
|
||
|
// GameWorldClient is the client API for GameWorld 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 GameWorldClient interface {
|
||
|
Register(ctx context.Context, in *AuthInfo, opts ...grpc.CallOption) (*SessionInfo, error)
|
||
|
Login(ctx context.Context, in *AuthInfo, opts ...grpc.CallOption) (*SessionInfo, error)
|
||
|
Commands(ctx context.Context, opts ...grpc.CallOption) (GameWorld_CommandsClient, error)
|
||
|
State(ctx context.Context, in *SessionInfo, opts ...grpc.CallOption) (GameWorld_StateClient, error)
|
||
|
Messages(ctx context.Context, in *SessionInfo, opts ...grpc.CallOption) (GameWorld_MessagesClient, error)
|
||
|
Map(ctx context.Context, in *SessionInfo, opts ...grpc.CallOption) (*MapData, error)
|
||
|
Ping(ctx context.Context, in *SessionInfo, opts ...grpc.CallOption) (*Pong, error)
|
||
|
}
|
||
|
|
||
|
type gameWorldClient struct {
|
||
|
cc grpc.ClientConnInterface
|
||
|
}
|
||
|
|
||
|
func NewGameWorldClient(cc grpc.ClientConnInterface) GameWorldClient {
|
||
|
return &gameWorldClient{cc}
|
||
|
}
|
||
|
|
||
|
func (c *gameWorldClient) Register(ctx context.Context, in *AuthInfo, opts ...grpc.CallOption) (*SessionInfo, error) {
|
||
|
out := new(SessionInfo)
|
||
|
err := c.cc.Invoke(ctx, "/proto.GameWorld/Register", in, out, opts...)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return out, nil
|
||
|
}
|
||
|
|
||
|
func (c *gameWorldClient) Login(ctx context.Context, in *AuthInfo, opts ...grpc.CallOption) (*SessionInfo, error) {
|
||
|
out := new(SessionInfo)
|
||
|
err := c.cc.Invoke(ctx, "/proto.GameWorld/Login", in, out, opts...)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return out, nil
|
||
|
}
|
||
|
|
||
|
func (c *gameWorldClient) Commands(ctx context.Context, opts ...grpc.CallOption) (GameWorld_CommandsClient, error) {
|
||
|
stream, err := c.cc.NewStream(ctx, &GameWorld_ServiceDesc.Streams[0], "/proto.GameWorld/Commands", opts...)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
x := &gameWorldCommandsClient{stream}
|
||
|
return x, nil
|
||
|
}
|
||
|
|
||
|
type GameWorld_CommandsClient interface {
|
||
|
Send(*Command) error
|
||
|
Recv() (*CommandAck, error)
|
||
|
grpc.ClientStream
|
||
|
}
|
||
|
|
||
|
type gameWorldCommandsClient struct {
|
||
|
grpc.ClientStream
|
||
|
}
|
||
|
|
||
|
func (x *gameWorldCommandsClient) Send(m *Command) error {
|
||
|
return x.ClientStream.SendMsg(m)
|
||
|
}
|
||
|
|
||
|
func (x *gameWorldCommandsClient) Recv() (*CommandAck, error) {
|
||
|
m := new(CommandAck)
|
||
|
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return m, nil
|
||
|
}
|
||
|
|
||
|
func (c *gameWorldClient) State(ctx context.Context, in *SessionInfo, opts ...grpc.CallOption) (GameWorld_StateClient, error) {
|
||
|
stream, err := c.cc.NewStream(ctx, &GameWorld_ServiceDesc.Streams[1], "/proto.GameWorld/State", opts...)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
x := &gameWorldStateClient{stream}
|
||
|
if err := x.ClientStream.SendMsg(in); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
if err := x.ClientStream.CloseSend(); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return x, nil
|
||
|
}
|
||
|
|
||
|
type GameWorld_StateClient interface {
|
||
|
Recv() (*StateUpdate, error)
|
||
|
grpc.ClientStream
|
||
|
}
|
||
|
|
||
|
type gameWorldStateClient struct {
|
||
|
grpc.ClientStream
|
||
|
}
|
||
|
|
||
|
func (x *gameWorldStateClient) Recv() (*StateUpdate, error) {
|
||
|
m := new(StateUpdate)
|
||
|
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return m, nil
|
||
|
}
|
||
|
|
||
|
func (c *gameWorldClient) Messages(ctx context.Context, in *SessionInfo, opts ...grpc.CallOption) (GameWorld_MessagesClient, error) {
|
||
|
stream, err := c.cc.NewStream(ctx, &GameWorld_ServiceDesc.Streams[2], "/proto.GameWorld/Messages", opts...)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
x := &gameWorldMessagesClient{stream}
|
||
|
if err := x.ClientStream.SendMsg(in); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
if err := x.ClientStream.CloseSend(); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return x, nil
|
||
|
}
|
||
|
|
||
|
type GameWorld_MessagesClient interface {
|
||
|
Recv() (*ClientMessage, error)
|
||
|
grpc.ClientStream
|
||
|
}
|
||
|
|
||
|
type gameWorldMessagesClient struct {
|
||
|
grpc.ClientStream
|
||
|
}
|
||
|
|
||
|
func (x *gameWorldMessagesClient) Recv() (*ClientMessage, error) {
|
||
|
m := new(ClientMessage)
|
||
|
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return m, nil
|
||
|
}
|
||
|
|
||
|
func (c *gameWorldClient) Map(ctx context.Context, in *SessionInfo, opts ...grpc.CallOption) (*MapData, error) {
|
||
|
out := new(MapData)
|
||
|
err := c.cc.Invoke(ctx, "/proto.GameWorld/Map", in, out, opts...)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return out, nil
|
||
|
}
|
||
|
|
||
|
func (c *gameWorldClient) Ping(ctx context.Context, in *SessionInfo, opts ...grpc.CallOption) (*Pong, error) {
|
||
|
out := new(Pong)
|
||
|
err := c.cc.Invoke(ctx, "/proto.GameWorld/Ping", in, out, opts...)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return out, nil
|
||
|
}
|
||
|
|
||
|
// GameWorldServer is the server API for GameWorld service.
|
||
|
// All implementations must embed UnimplementedGameWorldServer
|
||
|
// for forward compatibility
|
||
|
type GameWorldServer interface {
|
||
|
Register(context.Context, *AuthInfo) (*SessionInfo, error)
|
||
|
Login(context.Context, *AuthInfo) (*SessionInfo, error)
|
||
|
Commands(GameWorld_CommandsServer) error
|
||
|
State(*SessionInfo, GameWorld_StateServer) error
|
||
|
Messages(*SessionInfo, GameWorld_MessagesServer) error
|
||
|
Map(context.Context, *SessionInfo) (*MapData, error)
|
||
|
Ping(context.Context, *SessionInfo) (*Pong, error)
|
||
|
mustEmbedUnimplementedGameWorldServer()
|
||
|
}
|
||
|
|
||
|
// UnimplementedGameWorldServer must be embedded to have forward compatible implementations.
|
||
|
type UnimplementedGameWorldServer struct {
|
||
|
}
|
||
|
|
||
|
func (UnimplementedGameWorldServer) Register(context.Context, *AuthInfo) (*SessionInfo, error) {
|
||
|
return nil, status.Errorf(codes.Unimplemented, "method Register not implemented")
|
||
|
}
|
||
|
func (UnimplementedGameWorldServer) Login(context.Context, *AuthInfo) (*SessionInfo, error) {
|
||
|
return nil, status.Errorf(codes.Unimplemented, "method Login not implemented")
|
||
|
}
|
||
|
func (UnimplementedGameWorldServer) Commands(GameWorld_CommandsServer) error {
|
||
|
return status.Errorf(codes.Unimplemented, "method Commands not implemented")
|
||
|
}
|
||
|
func (UnimplementedGameWorldServer) State(*SessionInfo, GameWorld_StateServer) error {
|
||
|
return status.Errorf(codes.Unimplemented, "method State not implemented")
|
||
|
}
|
||
|
func (UnimplementedGameWorldServer) Messages(*SessionInfo, GameWorld_MessagesServer) error {
|
||
|
return status.Errorf(codes.Unimplemented, "method Messages not implemented")
|
||
|
}
|
||
|
func (UnimplementedGameWorldServer) Map(context.Context, *SessionInfo) (*MapData, error) {
|
||
|
return nil, status.Errorf(codes.Unimplemented, "method Map not implemented")
|
||
|
}
|
||
|
func (UnimplementedGameWorldServer) Ping(context.Context, *SessionInfo) (*Pong, error) {
|
||
|
return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented")
|
||
|
}
|
||
|
func (UnimplementedGameWorldServer) mustEmbedUnimplementedGameWorldServer() {}
|
||
|
|
||
|
// UnsafeGameWorldServer may be embedded to opt out of forward compatibility for this service.
|
||
|
// Use of this interface is not recommended, as added methods to GameWorldServer will
|
||
|
// result in compilation errors.
|
||
|
type UnsafeGameWorldServer interface {
|
||
|
mustEmbedUnimplementedGameWorldServer()
|
||
|
}
|
||
|
|
||
|
func RegisterGameWorldServer(s grpc.ServiceRegistrar, srv GameWorldServer) {
|
||
|
s.RegisterService(&GameWorld_ServiceDesc, srv)
|
||
|
}
|
||
|
|
||
|
func _GameWorld_Register_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
in := new(AuthInfo)
|
||
|
if err := dec(in); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
if interceptor == nil {
|
||
|
return srv.(GameWorldServer).Register(ctx, in)
|
||
|
}
|
||
|
info := &grpc.UnaryServerInfo{
|
||
|
Server: srv,
|
||
|
FullMethod: "/proto.GameWorld/Register",
|
||
|
}
|
||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
return srv.(GameWorldServer).Register(ctx, req.(*AuthInfo))
|
||
|
}
|
||
|
return interceptor(ctx, in, info, handler)
|
||
|
}
|
||
|
|
||
|
func _GameWorld_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
in := new(AuthInfo)
|
||
|
if err := dec(in); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
if interceptor == nil {
|
||
|
return srv.(GameWorldServer).Login(ctx, in)
|
||
|
}
|
||
|
info := &grpc.UnaryServerInfo{
|
||
|
Server: srv,
|
||
|
FullMethod: "/proto.GameWorld/Login",
|
||
|
}
|
||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
return srv.(GameWorldServer).Login(ctx, req.(*AuthInfo))
|
||
|
}
|
||
|
return interceptor(ctx, in, info, handler)
|
||
|
}
|
||
|
|
||
|
func _GameWorld_Commands_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||
|
return srv.(GameWorldServer).Commands(&gameWorldCommandsServer{stream})
|
||
|
}
|
||
|
|
||
|
type GameWorld_CommandsServer interface {
|
||
|
Send(*CommandAck) error
|
||
|
Recv() (*Command, error)
|
||
|
grpc.ServerStream
|
||
|
}
|
||
|
|
||
|
type gameWorldCommandsServer struct {
|
||
|
grpc.ServerStream
|
||
|
}
|
||
|
|
||
|
func (x *gameWorldCommandsServer) Send(m *CommandAck) error {
|
||
|
return x.ServerStream.SendMsg(m)
|
||
|
}
|
||
|
|
||
|
func (x *gameWorldCommandsServer) Recv() (*Command, error) {
|
||
|
m := new(Command)
|
||
|
if err := x.ServerStream.RecvMsg(m); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return m, nil
|
||
|
}
|
||
|
|
||
|
func _GameWorld_State_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||
|
m := new(SessionInfo)
|
||
|
if err := stream.RecvMsg(m); err != nil {
|
||
|
return err
|
||
|
}
|
||
|
return srv.(GameWorldServer).State(m, &gameWorldStateServer{stream})
|
||
|
}
|
||
|
|
||
|
type GameWorld_StateServer interface {
|
||
|
Send(*StateUpdate) error
|
||
|
grpc.ServerStream
|
||
|
}
|
||
|
|
||
|
type gameWorldStateServer struct {
|
||
|
grpc.ServerStream
|
||
|
}
|
||
|
|
||
|
func (x *gameWorldStateServer) Send(m *StateUpdate) error {
|
||
|
return x.ServerStream.SendMsg(m)
|
||
|
}
|
||
|
|
||
|
func _GameWorld_Messages_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||
|
m := new(SessionInfo)
|
||
|
if err := stream.RecvMsg(m); err != nil {
|
||
|
return err
|
||
|
}
|
||
|
return srv.(GameWorldServer).Messages(m, &gameWorldMessagesServer{stream})
|
||
|
}
|
||
|
|
||
|
type GameWorld_MessagesServer interface {
|
||
|
Send(*ClientMessage) error
|
||
|
grpc.ServerStream
|
||
|
}
|
||
|
|
||
|
type gameWorldMessagesServer struct {
|
||
|
grpc.ServerStream
|
||
|
}
|
||
|
|
||
|
func (x *gameWorldMessagesServer) Send(m *ClientMessage) error {
|
||
|
return x.ServerStream.SendMsg(m)
|
||
|
}
|
||
|
|
||
|
func _GameWorld_Map_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
in := new(SessionInfo)
|
||
|
if err := dec(in); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
if interceptor == nil {
|
||
|
return srv.(GameWorldServer).Map(ctx, in)
|
||
|
}
|
||
|
info := &grpc.UnaryServerInfo{
|
||
|
Server: srv,
|
||
|
FullMethod: "/proto.GameWorld/Map",
|
||
|
}
|
||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
return srv.(GameWorldServer).Map(ctx, req.(*SessionInfo))
|
||
|
}
|
||
|
return interceptor(ctx, in, info, handler)
|
||
|
}
|
||
|
|
||
|
func _GameWorld_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
in := new(SessionInfo)
|
||
|
if err := dec(in); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
if interceptor == nil {
|
||
|
return srv.(GameWorldServer).Ping(ctx, in)
|
||
|
}
|
||
|
info := &grpc.UnaryServerInfo{
|
||
|
Server: srv,
|
||
|
FullMethod: "/proto.GameWorld/Ping",
|
||
|
}
|
||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
return srv.(GameWorldServer).Ping(ctx, req.(*SessionInfo))
|
||
|
}
|
||
|
return interceptor(ctx, in, info, handler)
|
||
|
}
|
||
|
|
||
|
// GameWorld_ServiceDesc is the grpc.ServiceDesc for GameWorld service.
|
||
|
// It's only intended for direct use with grpc.RegisterService,
|
||
|
// and not to be introspected or modified (even as a copy)
|
||
|
var GameWorld_ServiceDesc = grpc.ServiceDesc{
|
||
|
ServiceName: "proto.GameWorld",
|
||
|
HandlerType: (*GameWorldServer)(nil),
|
||
|
Methods: []grpc.MethodDesc{
|
||
|
{
|
||
|
MethodName: "Register",
|
||
|
Handler: _GameWorld_Register_Handler,
|
||
|
},
|
||
|
{
|
||
|
MethodName: "Login",
|
||
|
Handler: _GameWorld_Login_Handler,
|
||
|
},
|
||
|
{
|
||
|
MethodName: "Map",
|
||
|
Handler: _GameWorld_Map_Handler,
|
||
|
},
|
||
|
{
|
||
|
MethodName: "Ping",
|
||
|
Handler: _GameWorld_Ping_Handler,
|
||
|
},
|
||
|
},
|
||
|
Streams: []grpc.StreamDesc{
|
||
|
{
|
||
|
StreamName: "Commands",
|
||
|
Handler: _GameWorld_Commands_Handler,
|
||
|
ServerStreams: true,
|
||
|
ClientStreams: true,
|
||
|
},
|
||
|
{
|
||
|
StreamName: "State",
|
||
|
Handler: _GameWorld_State_Handler,
|
||
|
ServerStreams: true,
|
||
|
},
|
||
|
{
|
||
|
StreamName: "Messages",
|
||
|
Handler: _GameWorld_Messages_Handler,
|
||
|
ServerStreams: true,
|
||
|
},
|
||
|
},
|
||
|
Metadata: "proto/hermeticum.proto",
|
||
|
}
|