game

package
v0.0.0-...-2275561 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_proto_game_game_proto protoreflect.FileDescriptor
View Source
var Game_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "game.Game",
	HandlerType: (*GameServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Move",
			Handler:    _Game_Move_Handler,
		},
		{
			MethodName: "Status",
			Handler:    _Game_Status_Handler,
		},
		{
			MethodName: "NewGame",
			Handler:    _Game_NewGame_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "proto/game/game.proto",
}

Game_ServiceDesc is the grpc.ServiceDesc for Game service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterGameServer

func RegisterGameServer(s grpc.ServiceRegistrar, srv GameServer)

Types

type ArrayButton

type ArrayButton struct {
	Buttons []*Button `protobuf:"bytes,1,rep,name=Buttons,proto3" json:"Buttons,omitempty"`
	// contains filtered or unexported fields
}

func (*ArrayButton) Descriptor deprecated

func (*ArrayButton) Descriptor() ([]byte, []int)

Deprecated: Use ArrayButton.ProtoReflect.Descriptor instead.

func (*ArrayButton) GetButtons

func (x *ArrayButton) GetButtons() []*Button

func (*ArrayButton) ProtoMessage

func (*ArrayButton) ProtoMessage()

func (*ArrayButton) ProtoReflect

func (x *ArrayButton) ProtoReflect() protoreflect.Message

func (*ArrayButton) Reset

func (x *ArrayButton) Reset()

func (*ArrayButton) String

func (x *ArrayButton) String() string

type Button

type Button struct {
	Text         string `protobuf:"bytes,1,opt,name=Text,proto3" json:"Text,omitempty"`
	CallbackData string `protobuf:"bytes,2,opt,name=CallbackData,proto3" json:"CallbackData,omitempty"`
	// contains filtered or unexported fields
}

func (*Button) Descriptor deprecated

func (*Button) Descriptor() ([]byte, []int)

Deprecated: Use Button.ProtoReflect.Descriptor instead.

func (*Button) GetCallbackData

func (x *Button) GetCallbackData() string

func (*Button) GetText

func (x *Button) GetText() string

func (*Button) ProtoMessage

func (*Button) ProtoMessage()

func (*Button) ProtoReflect

func (x *Button) ProtoReflect() protoreflect.Message

func (*Button) Reset

func (x *Button) Reset()

func (*Button) String

func (x *Button) String() string

type GameClient

type GameClient interface {
	Move(ctx context.Context, in *MoveRequest, opts ...grpc.CallOption) (*empty.Empty, error)
	Status(ctx context.Context, in *GameID, opts ...grpc.CallOption) (*GameStatus, error)
	NewGame(ctx context.Context, in *NewGameRequest, opts ...grpc.CallOption) (*GameID, error)
}

GameClient is the client API for Game 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.

func NewGameClient

func NewGameClient(cc grpc.ClientConnInterface) GameClient

type GameID

type GameID struct {
	ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"`
	// contains filtered or unexported fields
}

func (*GameID) Descriptor deprecated

func (*GameID) Descriptor() ([]byte, []int)

Deprecated: Use GameID.ProtoReflect.Descriptor instead.

func (*GameID) GetID

func (x *GameID) GetID() int64

func (*GameID) ProtoMessage

func (*GameID) ProtoMessage()

func (*GameID) ProtoReflect

func (x *GameID) ProtoReflect() protoreflect.Message

func (*GameID) Reset

func (x *GameID) Reset()

func (*GameID) String

func (x *GameID) String() string

type GameServer

type GameServer interface {
	Move(context.Context, *MoveRequest) (*empty.Empty, error)
	Status(context.Context, *GameID) (*GameStatus, error)
	NewGame(context.Context, *NewGameRequest) (*GameID, error)
	// contains filtered or unexported methods
}

GameServer is the server API for Game service. All implementations must embed UnimplementedGameServer for forward compatibility

type GameStatus

type GameStatus struct {
	Description string         `protobuf:"bytes,1,opt,name=Description,proto3" json:"Description,omitempty"`
	Keyboard    []*ArrayButton `protobuf:"bytes,2,rep,name=Keyboard,proto3" json:"Keyboard,omitempty"`
	// contains filtered or unexported fields
}

func (*GameStatus) Descriptor deprecated

func (*GameStatus) Descriptor() ([]byte, []int)

Deprecated: Use GameStatus.ProtoReflect.Descriptor instead.

func (*GameStatus) GetDescription

func (x *GameStatus) GetDescription() string

func (*GameStatus) GetKeyboard

func (x *GameStatus) GetKeyboard() []*ArrayButton

func (*GameStatus) ProtoMessage

func (*GameStatus) ProtoMessage()

func (*GameStatus) ProtoReflect

func (x *GameStatus) ProtoReflect() protoreflect.Message

func (*GameStatus) Reset

func (x *GameStatus) Reset()

func (*GameStatus) String

func (x *GameStatus) String() string

type MoveRequest

type MoveRequest struct {
	GameID   int64  `protobuf:"varint,1,opt,name=gameID,proto3" json:"gameID,omitempty"`
	PlayerID int64  `protobuf:"varint,2,opt,name=playerID,proto3" json:"playerID,omitempty"`
	Text     string `protobuf:"bytes,3,opt,name=text,proto3" json:"text,omitempty"`
	// contains filtered or unexported fields
}

func (*MoveRequest) Descriptor deprecated

func (*MoveRequest) Descriptor() ([]byte, []int)

Deprecated: Use MoveRequest.ProtoReflect.Descriptor instead.

func (*MoveRequest) GetGameID

func (x *MoveRequest) GetGameID() int64

func (*MoveRequest) GetPlayerID

func (x *MoveRequest) GetPlayerID() int64

func (*MoveRequest) GetText

func (x *MoveRequest) GetText() string

func (*MoveRequest) ProtoMessage

func (*MoveRequest) ProtoMessage()

func (*MoveRequest) ProtoReflect

func (x *MoveRequest) ProtoReflect() protoreflect.Message

func (*MoveRequest) Reset

func (x *MoveRequest) Reset()

func (*MoveRequest) String

func (x *MoveRequest) String() string

type NewGameRequest

type NewGameRequest struct {
	PlayersID []int64 `protobuf:"varint,1,rep,packed,name=playersID,proto3" json:"playersID,omitempty"`
	// contains filtered or unexported fields
}

func (*NewGameRequest) Descriptor deprecated

func (*NewGameRequest) Descriptor() ([]byte, []int)

Deprecated: Use NewGameRequest.ProtoReflect.Descriptor instead.

func (*NewGameRequest) GetPlayersID

func (x *NewGameRequest) GetPlayersID() []int64

func (*NewGameRequest) ProtoMessage

func (*NewGameRequest) ProtoMessage()

func (*NewGameRequest) ProtoReflect

func (x *NewGameRequest) ProtoReflect() protoreflect.Message

func (*NewGameRequest) Reset

func (x *NewGameRequest) Reset()

func (*NewGameRequest) String

func (x *NewGameRequest) String() string

type UnimplementedGameServer

type UnimplementedGameServer struct {
}

UnimplementedGameServer must be embedded to have forward compatible implementations.

func (UnimplementedGameServer) Move

func (UnimplementedGameServer) NewGame

func (UnimplementedGameServer) Status

type UnsafeGameServer

type UnsafeGameServer interface {
	// contains filtered or unexported methods
}

UnsafeGameServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to GameServer will result in compilation errors.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL