Documentation ¶
Index ¶
- Variables
- func RegisterGameServiceServer(s *grpc.Server, srv GameServiceServer)
- type CancelCommandRequest
- func (*CancelCommandRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CancelCommandRequest) GetCommandKey() string
- func (*CancelCommandRequest) ProtoMessage()
- func (x *CancelCommandRequest) ProtoReflect() protoreflect.Message
- func (x *CancelCommandRequest) Reset()
- func (x *CancelCommandRequest) String() string
- type CancelCommandResponse
- func (*CancelCommandResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CancelCommandResponse) GetErr() string
- func (*CancelCommandResponse) ProtoMessage()
- func (x *CancelCommandResponse) ProtoReflect() protoreflect.Message
- func (x *CancelCommandResponse) Reset()
- func (x *CancelCommandResponse) String() string
- type CreateGameRequest
- type GameServiceClient
- type GameServiceServer
- type GameService_StreamGameClient
- type GameService_StreamGameServer
- type GameState
- type SendCommandRequest
- func (*SendCommandRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SendCommandRequest) GetCommandType() string
- func (x *SendCommandRequest) GetGameKey() string
- func (*SendCommandRequest) ProtoMessage()
- func (x *SendCommandRequest) ProtoReflect() protoreflect.Message
- func (x *SendCommandRequest) Reset()
- func (x *SendCommandRequest) String() string
- type SendCommandResponse
- func (*SendCommandResponse) Descriptor() ([]byte, []int)deprecated
- func (x *SendCommandResponse) GetCommandKey() string
- func (*SendCommandResponse) ProtoMessage()
- func (x *SendCommandResponse) ProtoReflect() protoreflect.Message
- func (x *SendCommandResponse) Reset()
- func (x *SendCommandResponse) String() string
- type SetSpeedRequest
- func (*SetSpeedRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SetSpeedRequest) GetGameKey() string
- func (x *SetSpeedRequest) GetSpeed() SetSpeedRequest_Speed
- func (*SetSpeedRequest) ProtoMessage()
- func (x *SetSpeedRequest) ProtoReflect() protoreflect.Message
- func (x *SetSpeedRequest) Reset()
- func (x *SetSpeedRequest) String() string
- type SetSpeedRequest_Speed
- func (SetSpeedRequest_Speed) Descriptor() protoreflect.EnumDescriptor
- func (x SetSpeedRequest_Speed) Enum() *SetSpeedRequest_Speed
- func (SetSpeedRequest_Speed) EnumDescriptor() ([]byte, []int)deprecated
- func (x SetSpeedRequest_Speed) Number() protoreflect.EnumNumber
- func (x SetSpeedRequest_Speed) String() string
- func (SetSpeedRequest_Speed) Type() protoreflect.EnumType
- type SetSpeedResponse
- type StreamGameRequest
- type UnimplementedGameServiceServer
- func (*UnimplementedGameServiceServer) CancelCommand(context.Context, *CancelCommandRequest) (*CancelCommandResponse, error)
- func (*UnimplementedGameServiceServer) CreateGame(context.Context, *CreateGameRequest) (*GameState, error)
- func (*UnimplementedGameServiceServer) SendCommand(context.Context, *SendCommandRequest) (*SendCommandResponse, error)
- func (*UnimplementedGameServiceServer) SetSpeed(context.Context, *SetSpeedRequest) (*SetSpeedResponse, error)
- func (*UnimplementedGameServiceServer) StreamGame(*StreamGameRequest, GameService_StreamGameServer) error
Constants ¶
This section is empty.
Variables ¶
var ( SetSpeedRequest_Speed_name = map[int32]string{ 0: "PAUSE", 1: "NORMAL", 2: "FAST", 3: "FASTEST", } SetSpeedRequest_Speed_value = map[string]int32{ "PAUSE": 0, "NORMAL": 1, "FAST": 2, "FASTEST": 3, } )
Enum value maps for SetSpeedRequest_Speed.
var File_game_proto protoreflect.FileDescriptor
Functions ¶
func RegisterGameServiceServer ¶
func RegisterGameServiceServer(s *grpc.Server, srv GameServiceServer)
Types ¶
type CancelCommandRequest ¶
type CancelCommandRequest struct { CommandKey string `protobuf:"bytes,1,opt,name=command_key,json=commandKey,proto3" json:"command_key,omitempty"` // contains filtered or unexported fields }
func (*CancelCommandRequest) Descriptor
deprecated
func (*CancelCommandRequest) Descriptor() ([]byte, []int)
Deprecated: Use CancelCommandRequest.ProtoReflect.Descriptor instead.
func (*CancelCommandRequest) GetCommandKey ¶
func (x *CancelCommandRequest) GetCommandKey() string
func (*CancelCommandRequest) ProtoMessage ¶
func (*CancelCommandRequest) ProtoMessage()
func (*CancelCommandRequest) ProtoReflect ¶
func (x *CancelCommandRequest) ProtoReflect() protoreflect.Message
func (*CancelCommandRequest) Reset ¶
func (x *CancelCommandRequest) Reset()
func (*CancelCommandRequest) String ¶
func (x *CancelCommandRequest) String() string
type CancelCommandResponse ¶
type CancelCommandResponse struct { Err string `protobuf:"bytes,1,opt,name=err,proto3" json:"err,omitempty"` // contains filtered or unexported fields }
func (*CancelCommandResponse) Descriptor
deprecated
func (*CancelCommandResponse) Descriptor() ([]byte, []int)
Deprecated: Use CancelCommandResponse.ProtoReflect.Descriptor instead.
func (*CancelCommandResponse) GetErr ¶
func (x *CancelCommandResponse) GetErr() string
func (*CancelCommandResponse) ProtoMessage ¶
func (*CancelCommandResponse) ProtoMessage()
func (*CancelCommandResponse) ProtoReflect ¶
func (x *CancelCommandResponse) ProtoReflect() protoreflect.Message
func (*CancelCommandResponse) Reset ¶
func (x *CancelCommandResponse) Reset()
func (*CancelCommandResponse) String ¶
func (x *CancelCommandResponse) String() string
type CreateGameRequest ¶
type CreateGameRequest struct {
// contains filtered or unexported fields
}
func (*CreateGameRequest) Descriptor
deprecated
func (*CreateGameRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateGameRequest.ProtoReflect.Descriptor instead.
func (*CreateGameRequest) ProtoMessage ¶
func (*CreateGameRequest) ProtoMessage()
func (*CreateGameRequest) ProtoReflect ¶
func (x *CreateGameRequest) ProtoReflect() protoreflect.Message
func (*CreateGameRequest) Reset ¶
func (x *CreateGameRequest) Reset()
func (*CreateGameRequest) String ¶
func (x *CreateGameRequest) String() string
type GameServiceClient ¶
type GameServiceClient interface { CreateGame(ctx context.Context, in *CreateGameRequest, opts ...grpc.CallOption) (*GameState, error) StreamGame(ctx context.Context, in *StreamGameRequest, opts ...grpc.CallOption) (GameService_StreamGameClient, error) SendCommand(ctx context.Context, in *SendCommandRequest, opts ...grpc.CallOption) (*SendCommandResponse, error) CancelCommand(ctx context.Context, in *CancelCommandRequest, opts ...grpc.CallOption) (*CancelCommandResponse, error) SetSpeed(ctx context.Context, in *SetSpeedRequest, opts ...grpc.CallOption) (*SetSpeedResponse, error) }
GameServiceClient is the client API for GameService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewGameServiceClient ¶
func NewGameServiceClient(cc grpc.ClientConnInterface) GameServiceClient
type GameServiceServer ¶
type GameServiceServer interface { CreateGame(context.Context, *CreateGameRequest) (*GameState, error) StreamGame(*StreamGameRequest, GameService_StreamGameServer) error SendCommand(context.Context, *SendCommandRequest) (*SendCommandResponse, error) CancelCommand(context.Context, *CancelCommandRequest) (*CancelCommandResponse, error) SetSpeed(context.Context, *SetSpeedRequest) (*SetSpeedResponse, error) }
GameServiceServer is the server API for GameService service.
type GameService_StreamGameClient ¶
type GameService_StreamGameClient interface { Recv() (*GameState, error) grpc.ClientStream }
type GameService_StreamGameServer ¶
type GameService_StreamGameServer interface { Send(*GameState) error grpc.ServerStream }
type GameState ¶
type GameState struct { GameKey string `protobuf:"bytes,1,opt,name=game_key,json=gameKey,proto3" json:"game_key,omitempty"` Json string `protobuf:"bytes,2,opt,name=json,proto3" json:"json,omitempty"` // contains filtered or unexported fields }
func (*GameState) Descriptor
deprecated
func (*GameState) GetGameKey ¶
func (*GameState) ProtoMessage ¶
func (*GameState) ProtoMessage()
func (*GameState) ProtoReflect ¶
func (x *GameState) ProtoReflect() protoreflect.Message
type SendCommandRequest ¶
type SendCommandRequest struct { GameKey string `protobuf:"bytes,1,opt,name=game_key,json=gameKey,proto3" json:"game_key,omitempty"` CommandType string `protobuf:"bytes,2,opt,name=command_type,json=commandType,proto3" json:"command_type,omitempty"` // contains filtered or unexported fields }
func (*SendCommandRequest) Descriptor
deprecated
func (*SendCommandRequest) Descriptor() ([]byte, []int)
Deprecated: Use SendCommandRequest.ProtoReflect.Descriptor instead.
func (*SendCommandRequest) GetCommandType ¶
func (x *SendCommandRequest) GetCommandType() string
func (*SendCommandRequest) GetGameKey ¶
func (x *SendCommandRequest) GetGameKey() string
func (*SendCommandRequest) ProtoMessage ¶
func (*SendCommandRequest) ProtoMessage()
func (*SendCommandRequest) ProtoReflect ¶
func (x *SendCommandRequest) ProtoReflect() protoreflect.Message
func (*SendCommandRequest) Reset ¶
func (x *SendCommandRequest) Reset()
func (*SendCommandRequest) String ¶
func (x *SendCommandRequest) String() string
type SendCommandResponse ¶
type SendCommandResponse struct { CommandKey string `protobuf:"bytes,1,opt,name=command_key,json=commandKey,proto3" json:"command_key,omitempty"` // contains filtered or unexported fields }
func (*SendCommandResponse) Descriptor
deprecated
func (*SendCommandResponse) Descriptor() ([]byte, []int)
Deprecated: Use SendCommandResponse.ProtoReflect.Descriptor instead.
func (*SendCommandResponse) GetCommandKey ¶
func (x *SendCommandResponse) GetCommandKey() string
func (*SendCommandResponse) ProtoMessage ¶
func (*SendCommandResponse) ProtoMessage()
func (*SendCommandResponse) ProtoReflect ¶
func (x *SendCommandResponse) ProtoReflect() protoreflect.Message
func (*SendCommandResponse) Reset ¶
func (x *SendCommandResponse) Reset()
func (*SendCommandResponse) String ¶
func (x *SendCommandResponse) String() string
type SetSpeedRequest ¶
type SetSpeedRequest struct { GameKey string `protobuf:"bytes,4,opt,name=game_key,json=gameKey,proto3" json:"game_key,omitempty"` Speed SetSpeedRequest_Speed `protobuf:"varint,5,opt,name=speed,proto3,enum=SetSpeedRequest_Speed" json:"speed,omitempty"` // contains filtered or unexported fields }
func (*SetSpeedRequest) Descriptor
deprecated
func (*SetSpeedRequest) Descriptor() ([]byte, []int)
Deprecated: Use SetSpeedRequest.ProtoReflect.Descriptor instead.
func (*SetSpeedRequest) GetGameKey ¶
func (x *SetSpeedRequest) GetGameKey() string
func (*SetSpeedRequest) GetSpeed ¶
func (x *SetSpeedRequest) GetSpeed() SetSpeedRequest_Speed
func (*SetSpeedRequest) ProtoMessage ¶
func (*SetSpeedRequest) ProtoMessage()
func (*SetSpeedRequest) ProtoReflect ¶
func (x *SetSpeedRequest) ProtoReflect() protoreflect.Message
func (*SetSpeedRequest) Reset ¶
func (x *SetSpeedRequest) Reset()
func (*SetSpeedRequest) String ¶
func (x *SetSpeedRequest) String() string
type SetSpeedRequest_Speed ¶
type SetSpeedRequest_Speed int32
const ( SetSpeedRequest_PAUSE SetSpeedRequest_Speed = 0 SetSpeedRequest_NORMAL SetSpeedRequest_Speed = 1 SetSpeedRequest_FAST SetSpeedRequest_Speed = 2 SetSpeedRequest_FASTEST SetSpeedRequest_Speed = 3 )
func (SetSpeedRequest_Speed) Descriptor ¶
func (SetSpeedRequest_Speed) Descriptor() protoreflect.EnumDescriptor
func (SetSpeedRequest_Speed) Enum ¶
func (x SetSpeedRequest_Speed) Enum() *SetSpeedRequest_Speed
func (SetSpeedRequest_Speed) EnumDescriptor
deprecated
func (SetSpeedRequest_Speed) EnumDescriptor() ([]byte, []int)
Deprecated: Use SetSpeedRequest_Speed.Descriptor instead.
func (SetSpeedRequest_Speed) Number ¶
func (x SetSpeedRequest_Speed) Number() protoreflect.EnumNumber
func (SetSpeedRequest_Speed) String ¶
func (x SetSpeedRequest_Speed) String() string
func (SetSpeedRequest_Speed) Type ¶
func (SetSpeedRequest_Speed) Type() protoreflect.EnumType
type SetSpeedResponse ¶
type SetSpeedResponse struct { Err string `protobuf:"bytes,1,opt,name=err,proto3" json:"err,omitempty"` // contains filtered or unexported fields }
func (*SetSpeedResponse) Descriptor
deprecated
func (*SetSpeedResponse) Descriptor() ([]byte, []int)
Deprecated: Use SetSpeedResponse.ProtoReflect.Descriptor instead.
func (*SetSpeedResponse) GetErr ¶
func (x *SetSpeedResponse) GetErr() string
func (*SetSpeedResponse) ProtoMessage ¶
func (*SetSpeedResponse) ProtoMessage()
func (*SetSpeedResponse) ProtoReflect ¶
func (x *SetSpeedResponse) ProtoReflect() protoreflect.Message
func (*SetSpeedResponse) Reset ¶
func (x *SetSpeedResponse) Reset()
func (*SetSpeedResponse) String ¶
func (x *SetSpeedResponse) String() string
type StreamGameRequest ¶
type StreamGameRequest struct { GameKey string `protobuf:"bytes,1,opt,name=game_key,json=gameKey,proto3" json:"game_key,omitempty"` // contains filtered or unexported fields }
func (*StreamGameRequest) Descriptor
deprecated
func (*StreamGameRequest) Descriptor() ([]byte, []int)
Deprecated: Use StreamGameRequest.ProtoReflect.Descriptor instead.
func (*StreamGameRequest) GetGameKey ¶
func (x *StreamGameRequest) GetGameKey() string
func (*StreamGameRequest) ProtoMessage ¶
func (*StreamGameRequest) ProtoMessage()
func (*StreamGameRequest) ProtoReflect ¶
func (x *StreamGameRequest) ProtoReflect() protoreflect.Message
func (*StreamGameRequest) Reset ¶
func (x *StreamGameRequest) Reset()
func (*StreamGameRequest) String ¶
func (x *StreamGameRequest) String() string
type UnimplementedGameServiceServer ¶
type UnimplementedGameServiceServer struct { }
UnimplementedGameServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedGameServiceServer) CancelCommand ¶
func (*UnimplementedGameServiceServer) CancelCommand(context.Context, *CancelCommandRequest) (*CancelCommandResponse, error)
func (*UnimplementedGameServiceServer) CreateGame ¶
func (*UnimplementedGameServiceServer) CreateGame(context.Context, *CreateGameRequest) (*GameState, error)
func (*UnimplementedGameServiceServer) SendCommand ¶
func (*UnimplementedGameServiceServer) SendCommand(context.Context, *SendCommandRequest) (*SendCommandResponse, error)
func (*UnimplementedGameServiceServer) SetSpeed ¶
func (*UnimplementedGameServiceServer) SetSpeed(context.Context, *SetSpeedRequest) (*SetSpeedResponse, error)
func (*UnimplementedGameServiceServer) StreamGame ¶
func (*UnimplementedGameServiceServer) StreamGame(*StreamGameRequest, GameService_StreamGameServer) error