Documentation ¶
Index ¶
- Variables
- func FetchSessionID(md metadata.MD) (uuid.UUID, error)
- func RegisterMafiaServer(s grpc.ServiceRegistrar, srv MafiaServer)
- func WithSessionID(id uuid.UUID) metadata.MD
- type CheckTeamRequest
- type CheckTeamResponse
- func (*CheckTeamResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CheckTeamResponse) GetTeam() Team
- func (x *CheckTeamResponse) GetUsername() string
- func (*CheckTeamResponse) ProtoMessage()
- func (x *CheckTeamResponse) ProtoReflect() protoreflect.Message
- func (x *CheckTeamResponse) Reset()
- func (x *CheckTeamResponse) String() string
- type DayVoteRequest
- type DayVoteResponse
- type GameEvent
- func (*GameEvent) Descriptor() ([]byte, []int)deprecated
- func (m *GameEvent) GetPayload() isGameEvent_Payload
- func (x *GameEvent) GetPayloadDayStarted() *GameEvent_PayloadDayStarted
- func (x *GameEvent) GetPayloadGameFinished() *GameEvent_PayloadGameFinished
- func (x *GameEvent) GetPayloadGameStarted() *GameEvent_PayloadGameStarted
- func (x *GameEvent) GetPayloadMessage() *GameEvent_PayloadMessage
- func (x *GameEvent) GetPayloadNightStarted() *GameEvent_PayloadNightStarted
- func (x *GameEvent) GetPayloadPlayerJoined() *GameEvent_PayloadPlayerJoined
- func (x *GameEvent) GetPayloadPlayerLeft() *GameEvent_PayloadPlayerLeft
- func (x *GameEvent) GetType() GameEvent_Type
- func (*GameEvent) ProtoMessage()
- func (x *GameEvent) ProtoReflect() protoreflect.Message
- func (x *GameEvent) Reset()
- func (x *GameEvent) String() string
- type GameEvent_PayloadDayStarted
- func (*GameEvent_PayloadDayStarted) Descriptor() ([]byte, []int)deprecated
- func (x *GameEvent_PayloadDayStarted) GetDayId() uint64
- func (x *GameEvent_PayloadDayStarted) GetKilledPlayer() *Player
- func (*GameEvent_PayloadDayStarted) ProtoMessage()
- func (x *GameEvent_PayloadDayStarted) ProtoReflect() protoreflect.Message
- func (x *GameEvent_PayloadDayStarted) Reset()
- func (x *GameEvent_PayloadDayStarted) String() string
- type GameEvent_PayloadDayStarted_
- type GameEvent_PayloadGameFinished
- func (*GameEvent_PayloadGameFinished) Descriptor() ([]byte, []int)deprecated
- func (x *GameEvent_PayloadGameFinished) GetPlayers() []*Player
- func (x *GameEvent_PayloadGameFinished) GetWinners() Team
- func (*GameEvent_PayloadGameFinished) ProtoMessage()
- func (x *GameEvent_PayloadGameFinished) ProtoReflect() protoreflect.Message
- func (x *GameEvent_PayloadGameFinished) Reset()
- func (x *GameEvent_PayloadGameFinished) String() string
- type GameEvent_PayloadGameFinished_
- type GameEvent_PayloadGameStarted
- func (*GameEvent_PayloadGameStarted) Descriptor() ([]byte, []int)deprecated
- func (x *GameEvent_PayloadGameStarted) GetPlayers() []*Player
- func (x *GameEvent_PayloadGameStarted) GetRole() Role
- func (*GameEvent_PayloadGameStarted) ProtoMessage()
- func (x *GameEvent_PayloadGameStarted) ProtoReflect() protoreflect.Message
- func (x *GameEvent_PayloadGameStarted) Reset()
- func (x *GameEvent_PayloadGameStarted) String() string
- type GameEvent_PayloadGameStarted_
- type GameEvent_PayloadMessage
- func (*GameEvent_PayloadMessage) Descriptor() ([]byte, []int)deprecated
- func (x *GameEvent_PayloadMessage) GetContent() string
- func (x *GameEvent_PayloadMessage) GetSender() *Player
- func (*GameEvent_PayloadMessage) ProtoMessage()
- func (x *GameEvent_PayloadMessage) ProtoReflect() protoreflect.Message
- func (x *GameEvent_PayloadMessage) Reset()
- func (x *GameEvent_PayloadMessage) String() string
- type GameEvent_PayloadMessage_
- type GameEvent_PayloadNightStarted
- func (*GameEvent_PayloadNightStarted) Descriptor() ([]byte, []int)deprecated
- func (x *GameEvent_PayloadNightStarted) GetDayId() uint64
- func (x *GameEvent_PayloadNightStarted) GetKickedPlayer() *Player
- func (x *GameEvent_PayloadNightStarted) GetVotes() []*VotePaper
- func (*GameEvent_PayloadNightStarted) ProtoMessage()
- func (x *GameEvent_PayloadNightStarted) ProtoReflect() protoreflect.Message
- func (x *GameEvent_PayloadNightStarted) Reset()
- func (x *GameEvent_PayloadNightStarted) String() string
- type GameEvent_PayloadNightStarted_
- type GameEvent_PayloadPlayerJoined
- func (*GameEvent_PayloadPlayerJoined) Descriptor() ([]byte, []int)deprecated
- func (x *GameEvent_PayloadPlayerJoined) GetPlayer() *Player
- func (*GameEvent_PayloadPlayerJoined) ProtoMessage()
- func (x *GameEvent_PayloadPlayerJoined) ProtoReflect() protoreflect.Message
- func (x *GameEvent_PayloadPlayerJoined) Reset()
- func (x *GameEvent_PayloadPlayerJoined) String() string
- type GameEvent_PayloadPlayerJoined_
- type GameEvent_PayloadPlayerLeft
- func (*GameEvent_PayloadPlayerLeft) Descriptor() ([]byte, []int)deprecated
- func (x *GameEvent_PayloadPlayerLeft) GetPlayer() *Player
- func (*GameEvent_PayloadPlayerLeft) ProtoMessage()
- func (x *GameEvent_PayloadPlayerLeft) ProtoReflect() protoreflect.Message
- func (x *GameEvent_PayloadPlayerLeft) Reset()
- func (x *GameEvent_PayloadPlayerLeft) String() string
- type GameEvent_PayloadPlayerLeft_
- type GameEvent_Type
- func (GameEvent_Type) Descriptor() protoreflect.EnumDescriptor
- func (x GameEvent_Type) Enum() *GameEvent_Type
- func (GameEvent_Type) EnumDescriptor() ([]byte, []int)deprecated
- func (x GameEvent_Type) Number() protoreflect.EnumNumber
- func (x GameEvent_Type) String() string
- func (GameEvent_Type) Type() protoreflect.EnumType
- type GetGameStateRequest
- type GetGameStateResponse
- func (*GetGameStateResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetGameStateResponse) GetPlayers() []*Player
- func (x *GetGameStateResponse) GetSelf() *Player
- func (x *GetGameStateResponse) GetWinners() Team
- func (*GetGameStateResponse) ProtoMessage()
- func (x *GetGameStateResponse) ProtoReflect() protoreflect.Message
- func (x *GetGameStateResponse) Reset()
- func (x *GetGameStateResponse) String() string
- type GetPlayersWithRolesRequest
- type GetPlayersWithRolesResponse
- func (*GetPlayersWithRolesResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetPlayersWithRolesResponse) GetPlayers() []*Player
- func (*GetPlayersWithRolesResponse) ProtoMessage()
- func (x *GetPlayersWithRolesResponse) ProtoReflect() protoreflect.Message
- func (x *GetPlayersWithRolesResponse) Reset()
- func (x *GetPlayersWithRolesResponse) String() string
- type JoinGameRequest
- type MafiaClient
- type MafiaServer
- type Mafia_JoinGameClient
- type Mafia_JoinGameServer
- type NightVoteRequest
- type NightVoteResponse
- type Player
- type Role
- type SendMessageRequest
- func (*SendMessageRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SendMessageRequest) GetContent() string
- func (*SendMessageRequest) ProtoMessage()
- func (x *SendMessageRequest) ProtoReflect() protoreflect.Message
- func (x *SendMessageRequest) Reset()
- func (x *SendMessageRequest) String() string
- type SendMessageResponse
- func (*SendMessageResponse) Descriptor() ([]byte, []int)deprecated
- func (x *SendMessageResponse) GetReceiverCount() uint64
- func (*SendMessageResponse) ProtoMessage()
- func (x *SendMessageResponse) ProtoReflect() protoreflect.Message
- func (x *SendMessageResponse) Reset()
- func (x *SendMessageResponse) String() string
- type Team
- type UnimplementedMafiaServer
- func (UnimplementedMafiaServer) CheckTeam(context.Context, *CheckTeamRequest) (*CheckTeamResponse, error)
- func (UnimplementedMafiaServer) DayVote(context.Context, *DayVoteRequest) (*DayVoteResponse, error)
- func (UnimplementedMafiaServer) GetGameState(context.Context, *GetGameStateRequest) (*GetGameStateResponse, error)
- func (UnimplementedMafiaServer) JoinGame(*JoinGameRequest, Mafia_JoinGameServer) error
- func (UnimplementedMafiaServer) NightVote(context.Context, *NightVoteRequest) (*NightVoteResponse, error)
- func (UnimplementedMafiaServer) SendMessage(context.Context, *SendMessageRequest) (*SendMessageResponse, error)
- type UnsafeMafiaServer
- type VotePaper
Constants ¶
This section is empty.
Variables ¶
var ( Role_name = map[int32]string{ 0: "ROLE_UNKNOWN", 1: "ROLE_INNOCENT", 2: "ROLE_SHERIFF", 3: "ROLE_MAFIOSI", } Role_value = map[string]int32{ "ROLE_UNKNOWN": 0, "ROLE_INNOCENT": 1, "ROLE_SHERIFF": 2, "ROLE_MAFIOSI": 3, } )
Enum value maps for Role.
var ( Team_name = map[int32]string{ 0: "TEAM_UNKNOWN", 1: "TEAM_VILLAGERS", 2: "TEAM_MAFIA", } Team_value = map[string]int32{ "TEAM_UNKNOWN": 0, "TEAM_VILLAGERS": 1, "TEAM_MAFIA": 2, } )
Enum value maps for Team.
var ( GameEvent_Type_name = map[int32]string{ 0: "EVENT_UNKNOWN", 1: "EVENT_PLAYER_JOINED", 2: "EVENT_PLAYER_LEFT", 3: "EVENT_MESSAGE", 4: "EVENT_GAME_STARTED", 5: "EVENT_GAME_FINISHED", 6: "EVENT_DAY_STARTED", 7: "EVENT_NIGHT_STARTED", } GameEvent_Type_value = map[string]int32{ "EVENT_UNKNOWN": 0, "EVENT_PLAYER_JOINED": 1, "EVENT_PLAYER_LEFT": 2, "EVENT_MESSAGE": 3, "EVENT_GAME_STARTED": 4, "EVENT_GAME_FINISHED": 5, "EVENT_DAY_STARTED": 6, "EVENT_NIGHT_STARTED": 7, } )
Enum value maps for GameEvent_Type.
var File_pkg_mafiapb_mafia_proto protoreflect.FileDescriptor
var Mafia_ServiceDesc = grpc.ServiceDesc{ ServiceName: "mafia.Mafia", HandlerType: (*MafiaServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetGameState", Handler: _Mafia_GetGameState_Handler, }, { MethodName: "SendMessage", Handler: _Mafia_SendMessage_Handler, }, { MethodName: "DayVote", Handler: _Mafia_DayVote_Handler, }, { MethodName: "NightVote", Handler: _Mafia_NightVote_Handler, }, { MethodName: "CheckTeam", Handler: _Mafia_CheckTeam_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "JoinGame", Handler: _Mafia_JoinGame_Handler, ServerStreams: true, }, }, Metadata: "pkg/mafiapb/mafia.proto", }
Mafia_ServiceDesc is the grpc.ServiceDesc for Mafia service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterMafiaServer ¶
func RegisterMafiaServer(s grpc.ServiceRegistrar, srv MafiaServer)
Types ¶
type CheckTeamRequest ¶
type CheckTeamRequest struct { Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` // contains filtered or unexported fields }
func (*CheckTeamRequest) Descriptor
deprecated
func (*CheckTeamRequest) Descriptor() ([]byte, []int)
Deprecated: Use CheckTeamRequest.ProtoReflect.Descriptor instead.
func (*CheckTeamRequest) GetUsername ¶
func (x *CheckTeamRequest) GetUsername() string
func (*CheckTeamRequest) ProtoMessage ¶
func (*CheckTeamRequest) ProtoMessage()
func (*CheckTeamRequest) ProtoReflect ¶
func (x *CheckTeamRequest) ProtoReflect() protoreflect.Message
func (*CheckTeamRequest) Reset ¶
func (x *CheckTeamRequest) Reset()
func (*CheckTeamRequest) String ¶
func (x *CheckTeamRequest) String() string
type CheckTeamResponse ¶
type CheckTeamResponse struct { Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` Team Team `protobuf:"varint,2,opt,name=team,proto3,enum=mafia.Team" json:"team,omitempty"` // contains filtered or unexported fields }
func (*CheckTeamResponse) Descriptor
deprecated
func (*CheckTeamResponse) Descriptor() ([]byte, []int)
Deprecated: Use CheckTeamResponse.ProtoReflect.Descriptor instead.
func (*CheckTeamResponse) GetTeam ¶
func (x *CheckTeamResponse) GetTeam() Team
func (*CheckTeamResponse) GetUsername ¶
func (x *CheckTeamResponse) GetUsername() string
func (*CheckTeamResponse) ProtoMessage ¶
func (*CheckTeamResponse) ProtoMessage()
func (*CheckTeamResponse) ProtoReflect ¶
func (x *CheckTeamResponse) ProtoReflect() protoreflect.Message
func (*CheckTeamResponse) Reset ¶
func (x *CheckTeamResponse) Reset()
func (*CheckTeamResponse) String ¶
func (x *CheckTeamResponse) String() string
type DayVoteRequest ¶
type DayVoteRequest struct { Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` // contains filtered or unexported fields }
func (*DayVoteRequest) Descriptor
deprecated
func (*DayVoteRequest) Descriptor() ([]byte, []int)
Deprecated: Use DayVoteRequest.ProtoReflect.Descriptor instead.
func (*DayVoteRequest) GetUsername ¶
func (x *DayVoteRequest) GetUsername() string
func (*DayVoteRequest) ProtoMessage ¶
func (*DayVoteRequest) ProtoMessage()
func (*DayVoteRequest) ProtoReflect ¶
func (x *DayVoteRequest) ProtoReflect() protoreflect.Message
func (*DayVoteRequest) Reset ¶
func (x *DayVoteRequest) Reset()
func (*DayVoteRequest) String ¶
func (x *DayVoteRequest) String() string
type DayVoteResponse ¶
type DayVoteResponse struct {
// contains filtered or unexported fields
}
func (*DayVoteResponse) Descriptor
deprecated
func (*DayVoteResponse) Descriptor() ([]byte, []int)
Deprecated: Use DayVoteResponse.ProtoReflect.Descriptor instead.
func (*DayVoteResponse) ProtoMessage ¶
func (*DayVoteResponse) ProtoMessage()
func (*DayVoteResponse) ProtoReflect ¶
func (x *DayVoteResponse) ProtoReflect() protoreflect.Message
func (*DayVoteResponse) Reset ¶
func (x *DayVoteResponse) Reset()
func (*DayVoteResponse) String ¶
func (x *DayVoteResponse) String() string
type GameEvent ¶
type GameEvent struct { Type GameEvent_Type `protobuf:"varint,1,opt,name=type,proto3,enum=mafia.GameEvent_Type" json:"type,omitempty"` // Types that are assignable to Payload: // *GameEvent_PayloadPlayerJoined_ // *GameEvent_PayloadPlayerLeft_ // *GameEvent_PayloadMessage_ // *GameEvent_PayloadGameStarted_ // *GameEvent_PayloadGameFinished_ // *GameEvent_PayloadDayStarted_ // *GameEvent_PayloadNightStarted_ Payload isGameEvent_Payload `protobuf_oneof:"payload"` // contains filtered or unexported fields }
func (*GameEvent) Descriptor
deprecated
func (*GameEvent) GetPayload ¶
func (m *GameEvent) GetPayload() isGameEvent_Payload
func (*GameEvent) GetPayloadDayStarted ¶
func (x *GameEvent) GetPayloadDayStarted() *GameEvent_PayloadDayStarted
func (*GameEvent) GetPayloadGameFinished ¶
func (x *GameEvent) GetPayloadGameFinished() *GameEvent_PayloadGameFinished
func (*GameEvent) GetPayloadGameStarted ¶
func (x *GameEvent) GetPayloadGameStarted() *GameEvent_PayloadGameStarted
func (*GameEvent) GetPayloadMessage ¶
func (x *GameEvent) GetPayloadMessage() *GameEvent_PayloadMessage
func (*GameEvent) GetPayloadNightStarted ¶
func (x *GameEvent) GetPayloadNightStarted() *GameEvent_PayloadNightStarted
func (*GameEvent) GetPayloadPlayerJoined ¶
func (x *GameEvent) GetPayloadPlayerJoined() *GameEvent_PayloadPlayerJoined
func (*GameEvent) GetPayloadPlayerLeft ¶
func (x *GameEvent) GetPayloadPlayerLeft() *GameEvent_PayloadPlayerLeft
func (*GameEvent) GetType ¶
func (x *GameEvent) GetType() GameEvent_Type
func (*GameEvent) ProtoMessage ¶
func (*GameEvent) ProtoMessage()
func (*GameEvent) ProtoReflect ¶
func (x *GameEvent) ProtoReflect() protoreflect.Message
type GameEvent_PayloadDayStarted ¶
type GameEvent_PayloadDayStarted struct { DayId uint64 `protobuf:"varint,1,opt,name=day_id,json=dayId,proto3" json:"day_id,omitempty"` // Who was killed that night. KilledPlayer *Player `protobuf:"bytes,2,opt,name=killed_player,json=killedPlayer,proto3,oneof" json:"killed_player,omitempty"` // contains filtered or unexported fields }
func (*GameEvent_PayloadDayStarted) Descriptor
deprecated
func (*GameEvent_PayloadDayStarted) Descriptor() ([]byte, []int)
Deprecated: Use GameEvent_PayloadDayStarted.ProtoReflect.Descriptor instead.
func (*GameEvent_PayloadDayStarted) GetDayId ¶
func (x *GameEvent_PayloadDayStarted) GetDayId() uint64
func (*GameEvent_PayloadDayStarted) GetKilledPlayer ¶
func (x *GameEvent_PayloadDayStarted) GetKilledPlayer() *Player
func (*GameEvent_PayloadDayStarted) ProtoMessage ¶
func (*GameEvent_PayloadDayStarted) ProtoMessage()
func (*GameEvent_PayloadDayStarted) ProtoReflect ¶
func (x *GameEvent_PayloadDayStarted) ProtoReflect() protoreflect.Message
func (*GameEvent_PayloadDayStarted) Reset ¶
func (x *GameEvent_PayloadDayStarted) Reset()
func (*GameEvent_PayloadDayStarted) String ¶
func (x *GameEvent_PayloadDayStarted) String() string
type GameEvent_PayloadDayStarted_ ¶
type GameEvent_PayloadDayStarted_ struct {
PayloadDayStarted *GameEvent_PayloadDayStarted `protobuf:"bytes,10,opt,name=payload_day_started,json=payloadDayStarted,proto3,oneof"`
}
type GameEvent_PayloadGameFinished ¶
type GameEvent_PayloadGameFinished struct { Winners Team `protobuf:"varint,1,opt,name=winners,proto3,enum=mafia.Team" json:"winners,omitempty"` Players []*Player `protobuf:"bytes,2,rep,name=players,proto3" json:"players,omitempty"` // contains filtered or unexported fields }
func (*GameEvent_PayloadGameFinished) Descriptor
deprecated
func (*GameEvent_PayloadGameFinished) Descriptor() ([]byte, []int)
Deprecated: Use GameEvent_PayloadGameFinished.ProtoReflect.Descriptor instead.
func (*GameEvent_PayloadGameFinished) GetPlayers ¶
func (x *GameEvent_PayloadGameFinished) GetPlayers() []*Player
func (*GameEvent_PayloadGameFinished) GetWinners ¶
func (x *GameEvent_PayloadGameFinished) GetWinners() Team
func (*GameEvent_PayloadGameFinished) ProtoMessage ¶
func (*GameEvent_PayloadGameFinished) ProtoMessage()
func (*GameEvent_PayloadGameFinished) ProtoReflect ¶
func (x *GameEvent_PayloadGameFinished) ProtoReflect() protoreflect.Message
func (*GameEvent_PayloadGameFinished) Reset ¶
func (x *GameEvent_PayloadGameFinished) Reset()
func (*GameEvent_PayloadGameFinished) String ¶
func (x *GameEvent_PayloadGameFinished) String() string
type GameEvent_PayloadGameFinished_ ¶
type GameEvent_PayloadGameFinished_ struct {
PayloadGameFinished *GameEvent_PayloadGameFinished `protobuf:"bytes,9,opt,name=payload_game_finished,json=payloadGameFinished,proto3,oneof"`
}
type GameEvent_PayloadGameStarted ¶
type GameEvent_PayloadGameStarted struct { Players []*Player `protobuf:"bytes,1,rep,name=players,proto3" json:"players,omitempty"` Role Role `protobuf:"varint,2,opt,name=role,proto3,enum=mafia.Role" json:"role,omitempty"` // contains filtered or unexported fields }
func (*GameEvent_PayloadGameStarted) Descriptor
deprecated
func (*GameEvent_PayloadGameStarted) Descriptor() ([]byte, []int)
Deprecated: Use GameEvent_PayloadGameStarted.ProtoReflect.Descriptor instead.
func (*GameEvent_PayloadGameStarted) GetPlayers ¶
func (x *GameEvent_PayloadGameStarted) GetPlayers() []*Player
func (*GameEvent_PayloadGameStarted) GetRole ¶
func (x *GameEvent_PayloadGameStarted) GetRole() Role
func (*GameEvent_PayloadGameStarted) ProtoMessage ¶
func (*GameEvent_PayloadGameStarted) ProtoMessage()
func (*GameEvent_PayloadGameStarted) ProtoReflect ¶
func (x *GameEvent_PayloadGameStarted) ProtoReflect() protoreflect.Message
func (*GameEvent_PayloadGameStarted) Reset ¶
func (x *GameEvent_PayloadGameStarted) Reset()
func (*GameEvent_PayloadGameStarted) String ¶
func (x *GameEvent_PayloadGameStarted) String() string
type GameEvent_PayloadGameStarted_ ¶
type GameEvent_PayloadGameStarted_ struct {
PayloadGameStarted *GameEvent_PayloadGameStarted `protobuf:"bytes,8,opt,name=payload_game_started,json=payloadGameStarted,proto3,oneof"`
}
type GameEvent_PayloadMessage ¶
type GameEvent_PayloadMessage struct { Sender *Player `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` // contains filtered or unexported fields }
func (*GameEvent_PayloadMessage) Descriptor
deprecated
func (*GameEvent_PayloadMessage) Descriptor() ([]byte, []int)
Deprecated: Use GameEvent_PayloadMessage.ProtoReflect.Descriptor instead.
func (*GameEvent_PayloadMessage) GetContent ¶
func (x *GameEvent_PayloadMessage) GetContent() string
func (*GameEvent_PayloadMessage) GetSender ¶
func (x *GameEvent_PayloadMessage) GetSender() *Player
func (*GameEvent_PayloadMessage) ProtoMessage ¶
func (*GameEvent_PayloadMessage) ProtoMessage()
func (*GameEvent_PayloadMessage) ProtoReflect ¶
func (x *GameEvent_PayloadMessage) ProtoReflect() protoreflect.Message
func (*GameEvent_PayloadMessage) Reset ¶
func (x *GameEvent_PayloadMessage) Reset()
func (*GameEvent_PayloadMessage) String ¶
func (x *GameEvent_PayloadMessage) String() string
type GameEvent_PayloadMessage_ ¶
type GameEvent_PayloadMessage_ struct {
PayloadMessage *GameEvent_PayloadMessage `protobuf:"bytes,7,opt,name=payload_message,json=payloadMessage,proto3,oneof"`
}
type GameEvent_PayloadNightStarted ¶
type GameEvent_PayloadNightStarted struct { DayId uint64 `protobuf:"varint,1,opt,name=day_id,json=dayId,proto3" json:"day_id,omitempty"` // Who was kicked that day. KickedPlayer *Player `protobuf:"bytes,2,opt,name=kicked_player,json=kickedPlayer,proto3,oneof" json:"kicked_player,omitempty"` Votes []*VotePaper `protobuf:"bytes,3,rep,name=votes,proto3" json:"votes,omitempty"` // contains filtered or unexported fields }
func (*GameEvent_PayloadNightStarted) Descriptor
deprecated
func (*GameEvent_PayloadNightStarted) Descriptor() ([]byte, []int)
Deprecated: Use GameEvent_PayloadNightStarted.ProtoReflect.Descriptor instead.
func (*GameEvent_PayloadNightStarted) GetDayId ¶
func (x *GameEvent_PayloadNightStarted) GetDayId() uint64
func (*GameEvent_PayloadNightStarted) GetKickedPlayer ¶
func (x *GameEvent_PayloadNightStarted) GetKickedPlayer() *Player
func (*GameEvent_PayloadNightStarted) GetVotes ¶
func (x *GameEvent_PayloadNightStarted) GetVotes() []*VotePaper
func (*GameEvent_PayloadNightStarted) ProtoMessage ¶
func (*GameEvent_PayloadNightStarted) ProtoMessage()
func (*GameEvent_PayloadNightStarted) ProtoReflect ¶
func (x *GameEvent_PayloadNightStarted) ProtoReflect() protoreflect.Message
func (*GameEvent_PayloadNightStarted) Reset ¶
func (x *GameEvent_PayloadNightStarted) Reset()
func (*GameEvent_PayloadNightStarted) String ¶
func (x *GameEvent_PayloadNightStarted) String() string
type GameEvent_PayloadNightStarted_ ¶
type GameEvent_PayloadNightStarted_ struct {
PayloadNightStarted *GameEvent_PayloadNightStarted `protobuf:"bytes,11,opt,name=payload_night_started,json=payloadNightStarted,proto3,oneof"`
}
type GameEvent_PayloadPlayerJoined ¶
type GameEvent_PayloadPlayerJoined struct { Player *Player `protobuf:"bytes,1,opt,name=player,proto3" json:"player,omitempty"` // contains filtered or unexported fields }
func (*GameEvent_PayloadPlayerJoined) Descriptor
deprecated
func (*GameEvent_PayloadPlayerJoined) Descriptor() ([]byte, []int)
Deprecated: Use GameEvent_PayloadPlayerJoined.ProtoReflect.Descriptor instead.
func (*GameEvent_PayloadPlayerJoined) GetPlayer ¶
func (x *GameEvent_PayloadPlayerJoined) GetPlayer() *Player
func (*GameEvent_PayloadPlayerJoined) ProtoMessage ¶
func (*GameEvent_PayloadPlayerJoined) ProtoMessage()
func (*GameEvent_PayloadPlayerJoined) ProtoReflect ¶
func (x *GameEvent_PayloadPlayerJoined) ProtoReflect() protoreflect.Message
func (*GameEvent_PayloadPlayerJoined) Reset ¶
func (x *GameEvent_PayloadPlayerJoined) Reset()
func (*GameEvent_PayloadPlayerJoined) String ¶
func (x *GameEvent_PayloadPlayerJoined) String() string
type GameEvent_PayloadPlayerJoined_ ¶
type GameEvent_PayloadPlayerJoined_ struct {
PayloadPlayerJoined *GameEvent_PayloadPlayerJoined `protobuf:"bytes,5,opt,name=payload_player_joined,json=payloadPlayerJoined,proto3,oneof"`
}
type GameEvent_PayloadPlayerLeft ¶
type GameEvent_PayloadPlayerLeft struct { Player *Player `protobuf:"bytes,1,opt,name=player,proto3" json:"player,omitempty"` // contains filtered or unexported fields }
func (*GameEvent_PayloadPlayerLeft) Descriptor
deprecated
func (*GameEvent_PayloadPlayerLeft) Descriptor() ([]byte, []int)
Deprecated: Use GameEvent_PayloadPlayerLeft.ProtoReflect.Descriptor instead.
func (*GameEvent_PayloadPlayerLeft) GetPlayer ¶
func (x *GameEvent_PayloadPlayerLeft) GetPlayer() *Player
func (*GameEvent_PayloadPlayerLeft) ProtoMessage ¶
func (*GameEvent_PayloadPlayerLeft) ProtoMessage()
func (*GameEvent_PayloadPlayerLeft) ProtoReflect ¶
func (x *GameEvent_PayloadPlayerLeft) ProtoReflect() protoreflect.Message
func (*GameEvent_PayloadPlayerLeft) Reset ¶
func (x *GameEvent_PayloadPlayerLeft) Reset()
func (*GameEvent_PayloadPlayerLeft) String ¶
func (x *GameEvent_PayloadPlayerLeft) String() string
type GameEvent_PayloadPlayerLeft_ ¶
type GameEvent_PayloadPlayerLeft_ struct {
PayloadPlayerLeft *GameEvent_PayloadPlayerLeft `protobuf:"bytes,6,opt,name=payload_player_left,json=payloadPlayerLeft,proto3,oneof"`
}
type GameEvent_Type ¶
type GameEvent_Type int32
const ( GameEvent_EVENT_UNKNOWN GameEvent_Type = 0 GameEvent_EVENT_PLAYER_JOINED GameEvent_Type = 1 GameEvent_EVENT_PLAYER_LEFT GameEvent_Type = 2 GameEvent_EVENT_MESSAGE GameEvent_Type = 3 GameEvent_EVENT_GAME_STARTED GameEvent_Type = 4 GameEvent_EVENT_GAME_FINISHED GameEvent_Type = 5 GameEvent_EVENT_DAY_STARTED GameEvent_Type = 6 GameEvent_EVENT_NIGHT_STARTED GameEvent_Type = 7 )
func (GameEvent_Type) Descriptor ¶
func (GameEvent_Type) Descriptor() protoreflect.EnumDescriptor
func (GameEvent_Type) Enum ¶
func (x GameEvent_Type) Enum() *GameEvent_Type
func (GameEvent_Type) EnumDescriptor
deprecated
func (GameEvent_Type) EnumDescriptor() ([]byte, []int)
Deprecated: Use GameEvent_Type.Descriptor instead.
func (GameEvent_Type) Number ¶
func (x GameEvent_Type) Number() protoreflect.EnumNumber
func (GameEvent_Type) String ¶
func (x GameEvent_Type) String() string
func (GameEvent_Type) Type ¶
func (GameEvent_Type) Type() protoreflect.EnumType
type GetGameStateRequest ¶
type GetGameStateRequest struct {
// contains filtered or unexported fields
}
func (*GetGameStateRequest) Descriptor
deprecated
func (*GetGameStateRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetGameStateRequest.ProtoReflect.Descriptor instead.
func (*GetGameStateRequest) ProtoMessage ¶
func (*GetGameStateRequest) ProtoMessage()
func (*GetGameStateRequest) ProtoReflect ¶
func (x *GetGameStateRequest) ProtoReflect() protoreflect.Message
func (*GetGameStateRequest) Reset ¶
func (x *GetGameStateRequest) Reset()
func (*GetGameStateRequest) String ¶
func (x *GetGameStateRequest) String() string
type GetGameStateResponse ¶
type GetGameStateResponse struct { Players []*Player `protobuf:"bytes,1,rep,name=players,proto3" json:"players,omitempty"` Self *Player `protobuf:"bytes,2,opt,name=self,proto3" json:"self,omitempty"` Winners *Team `protobuf:"varint,3,opt,name=winners,proto3,enum=mafia.Team,oneof" json:"winners,omitempty"` // contains filtered or unexported fields }
func (*GetGameStateResponse) Descriptor
deprecated
func (*GetGameStateResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetGameStateResponse.ProtoReflect.Descriptor instead.
func (*GetGameStateResponse) GetPlayers ¶
func (x *GetGameStateResponse) GetPlayers() []*Player
func (*GetGameStateResponse) GetSelf ¶
func (x *GetGameStateResponse) GetSelf() *Player
func (*GetGameStateResponse) GetWinners ¶
func (x *GetGameStateResponse) GetWinners() Team
func (*GetGameStateResponse) ProtoMessage ¶
func (*GetGameStateResponse) ProtoMessage()
func (*GetGameStateResponse) ProtoReflect ¶
func (x *GetGameStateResponse) ProtoReflect() protoreflect.Message
func (*GetGameStateResponse) Reset ¶
func (x *GetGameStateResponse) Reset()
func (*GetGameStateResponse) String ¶
func (x *GetGameStateResponse) String() string
type GetPlayersWithRolesRequest ¶
type GetPlayersWithRolesRequest struct {
// contains filtered or unexported fields
}
func (*GetPlayersWithRolesRequest) Descriptor
deprecated
func (*GetPlayersWithRolesRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetPlayersWithRolesRequest.ProtoReflect.Descriptor instead.
func (*GetPlayersWithRolesRequest) ProtoMessage ¶
func (*GetPlayersWithRolesRequest) ProtoMessage()
func (*GetPlayersWithRolesRequest) ProtoReflect ¶
func (x *GetPlayersWithRolesRequest) ProtoReflect() protoreflect.Message
func (*GetPlayersWithRolesRequest) Reset ¶
func (x *GetPlayersWithRolesRequest) Reset()
func (*GetPlayersWithRolesRequest) String ¶
func (x *GetPlayersWithRolesRequest) String() string
type GetPlayersWithRolesResponse ¶
type GetPlayersWithRolesResponse struct { Players []*Player `protobuf:"bytes,1,rep,name=players,proto3" json:"players,omitempty"` // contains filtered or unexported fields }
func (*GetPlayersWithRolesResponse) Descriptor
deprecated
func (*GetPlayersWithRolesResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetPlayersWithRolesResponse.ProtoReflect.Descriptor instead.
func (*GetPlayersWithRolesResponse) GetPlayers ¶
func (x *GetPlayersWithRolesResponse) GetPlayers() []*Player
func (*GetPlayersWithRolesResponse) ProtoMessage ¶
func (*GetPlayersWithRolesResponse) ProtoMessage()
func (*GetPlayersWithRolesResponse) ProtoReflect ¶
func (x *GetPlayersWithRolesResponse) ProtoReflect() protoreflect.Message
func (*GetPlayersWithRolesResponse) Reset ¶
func (x *GetPlayersWithRolesResponse) Reset()
func (*GetPlayersWithRolesResponse) String ¶
func (x *GetPlayersWithRolesResponse) String() string
type JoinGameRequest ¶
type JoinGameRequest struct { Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` // contains filtered or unexported fields }
func (*JoinGameRequest) Descriptor
deprecated
func (*JoinGameRequest) Descriptor() ([]byte, []int)
Deprecated: Use JoinGameRequest.ProtoReflect.Descriptor instead.
func (*JoinGameRequest) GetUsername ¶
func (x *JoinGameRequest) GetUsername() string
func (*JoinGameRequest) ProtoMessage ¶
func (*JoinGameRequest) ProtoMessage()
func (*JoinGameRequest) ProtoReflect ¶
func (x *JoinGameRequest) ProtoReflect() protoreflect.Message
func (*JoinGameRequest) Reset ¶
func (x *JoinGameRequest) Reset()
func (*JoinGameRequest) String ¶
func (x *JoinGameRequest) String() string
type MafiaClient ¶
type MafiaClient interface { JoinGame(ctx context.Context, in *JoinGameRequest, opts ...grpc.CallOption) (Mafia_JoinGameClient, error) GetGameState(ctx context.Context, in *GetGameStateRequest, opts ...grpc.CallOption) (*GetGameStateResponse, error) SendMessage(ctx context.Context, in *SendMessageRequest, opts ...grpc.CallOption) (*SendMessageResponse, error) DayVote(ctx context.Context, in *DayVoteRequest, opts ...grpc.CallOption) (*DayVoteResponse, error) NightVote(ctx context.Context, in *NightVoteRequest, opts ...grpc.CallOption) (*NightVoteResponse, error) CheckTeam(ctx context.Context, in *CheckTeamRequest, opts ...grpc.CallOption) (*CheckTeamResponse, error) }
MafiaClient is the client API for Mafia 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 NewMafiaClient ¶
func NewMafiaClient(cc grpc.ClientConnInterface) MafiaClient
type MafiaServer ¶
type MafiaServer interface { JoinGame(*JoinGameRequest, Mafia_JoinGameServer) error GetGameState(context.Context, *GetGameStateRequest) (*GetGameStateResponse, error) SendMessage(context.Context, *SendMessageRequest) (*SendMessageResponse, error) DayVote(context.Context, *DayVoteRequest) (*DayVoteResponse, error) NightVote(context.Context, *NightVoteRequest) (*NightVoteResponse, error) CheckTeam(context.Context, *CheckTeamRequest) (*CheckTeamResponse, error) // contains filtered or unexported methods }
MafiaServer is the server API for Mafia service. All implementations must embed UnimplementedMafiaServer for forward compatibility
type Mafia_JoinGameClient ¶
type Mafia_JoinGameClient interface { Recv() (*GameEvent, error) grpc.ClientStream }
type Mafia_JoinGameServer ¶
type Mafia_JoinGameServer interface { Send(*GameEvent) error grpc.ServerStream }
type NightVoteRequest ¶
type NightVoteRequest struct { Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` // contains filtered or unexported fields }
func (*NightVoteRequest) Descriptor
deprecated
func (*NightVoteRequest) Descriptor() ([]byte, []int)
Deprecated: Use NightVoteRequest.ProtoReflect.Descriptor instead.
func (*NightVoteRequest) GetUsername ¶
func (x *NightVoteRequest) GetUsername() string
func (*NightVoteRequest) ProtoMessage ¶
func (*NightVoteRequest) ProtoMessage()
func (*NightVoteRequest) ProtoReflect ¶
func (x *NightVoteRequest) ProtoReflect() protoreflect.Message
func (*NightVoteRequest) Reset ¶
func (x *NightVoteRequest) Reset()
func (*NightVoteRequest) String ¶
func (x *NightVoteRequest) String() string
type NightVoteResponse ¶
type NightVoteResponse struct {
// contains filtered or unexported fields
}
func (*NightVoteResponse) Descriptor
deprecated
func (*NightVoteResponse) Descriptor() ([]byte, []int)
Deprecated: Use NightVoteResponse.ProtoReflect.Descriptor instead.
func (*NightVoteResponse) ProtoMessage ¶
func (*NightVoteResponse) ProtoMessage()
func (*NightVoteResponse) ProtoReflect ¶
func (x *NightVoteResponse) ProtoReflect() protoreflect.Message
func (*NightVoteResponse) Reset ¶
func (x *NightVoteResponse) Reset()
func (*NightVoteResponse) String ¶
func (x *NightVoteResponse) String() string
type Player ¶
type Player struct { Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` Alive bool `protobuf:"varint,2,opt,name=alive,proto3" json:"alive,omitempty"` Role *Role `protobuf:"varint,3,opt,name=role,proto3,enum=mafia.Role,oneof" json:"role,omitempty"` // contains filtered or unexported fields }
func (*Player) Descriptor
deprecated
func (*Player) GetUsername ¶
func (*Player) ProtoMessage ¶
func (*Player) ProtoMessage()
func (*Player) ProtoReflect ¶
func (x *Player) ProtoReflect() protoreflect.Message
type Role ¶
type Role int32
func (Role) Descriptor ¶
func (Role) Descriptor() protoreflect.EnumDescriptor
func (Role) EnumDescriptor
deprecated
func (Role) Number ¶
func (x Role) Number() protoreflect.EnumNumber
func (Role) Type ¶
func (Role) Type() protoreflect.EnumType
type SendMessageRequest ¶
type SendMessageRequest struct { Content string `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` // contains filtered or unexported fields }
func (*SendMessageRequest) Descriptor
deprecated
func (*SendMessageRequest) Descriptor() ([]byte, []int)
Deprecated: Use SendMessageRequest.ProtoReflect.Descriptor instead.
func (*SendMessageRequest) GetContent ¶
func (x *SendMessageRequest) GetContent() string
func (*SendMessageRequest) ProtoMessage ¶
func (*SendMessageRequest) ProtoMessage()
func (*SendMessageRequest) ProtoReflect ¶
func (x *SendMessageRequest) ProtoReflect() protoreflect.Message
func (*SendMessageRequest) Reset ¶
func (x *SendMessageRequest) Reset()
func (*SendMessageRequest) String ¶
func (x *SendMessageRequest) String() string
type SendMessageResponse ¶
type SendMessageResponse struct { ReceiverCount uint64 `protobuf:"varint,1,opt,name=receiver_count,json=receiverCount,proto3" json:"receiver_count,omitempty"` // contains filtered or unexported fields }
func (*SendMessageResponse) Descriptor
deprecated
func (*SendMessageResponse) Descriptor() ([]byte, []int)
Deprecated: Use SendMessageResponse.ProtoReflect.Descriptor instead.
func (*SendMessageResponse) GetReceiverCount ¶
func (x *SendMessageResponse) GetReceiverCount() uint64
func (*SendMessageResponse) ProtoMessage ¶
func (*SendMessageResponse) ProtoMessage()
func (*SendMessageResponse) ProtoReflect ¶
func (x *SendMessageResponse) ProtoReflect() protoreflect.Message
func (*SendMessageResponse) Reset ¶
func (x *SendMessageResponse) Reset()
func (*SendMessageResponse) String ¶
func (x *SendMessageResponse) String() string
type Team ¶
type Team int32
func (Team) Descriptor ¶
func (Team) Descriptor() protoreflect.EnumDescriptor
func (Team) EnumDescriptor
deprecated
func (Team) Number ¶
func (x Team) Number() protoreflect.EnumNumber
func (Team) Type ¶
func (Team) Type() protoreflect.EnumType
type UnimplementedMafiaServer ¶
type UnimplementedMafiaServer struct { }
UnimplementedMafiaServer must be embedded to have forward compatible implementations.
func (UnimplementedMafiaServer) CheckTeam ¶
func (UnimplementedMafiaServer) CheckTeam(context.Context, *CheckTeamRequest) (*CheckTeamResponse, error)
func (UnimplementedMafiaServer) DayVote ¶
func (UnimplementedMafiaServer) DayVote(context.Context, *DayVoteRequest) (*DayVoteResponse, error)
func (UnimplementedMafiaServer) GetGameState ¶
func (UnimplementedMafiaServer) GetGameState(context.Context, *GetGameStateRequest) (*GetGameStateResponse, error)
func (UnimplementedMafiaServer) JoinGame ¶
func (UnimplementedMafiaServer) JoinGame(*JoinGameRequest, Mafia_JoinGameServer) error
func (UnimplementedMafiaServer) NightVote ¶
func (UnimplementedMafiaServer) NightVote(context.Context, *NightVoteRequest) (*NightVoteResponse, error)
func (UnimplementedMafiaServer) SendMessage ¶
func (UnimplementedMafiaServer) SendMessage(context.Context, *SendMessageRequest) (*SendMessageResponse, error)
type UnsafeMafiaServer ¶
type UnsafeMafiaServer interface {
// contains filtered or unexported methods
}
UnsafeMafiaServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to MafiaServer will result in compilation errors.
type VotePaper ¶
type VotePaper struct { Voter *Player `protobuf:"bytes,1,opt,name=voter,proto3" json:"voter,omitempty"` Candidate *Player `protobuf:"bytes,2,opt,name=candidate,proto3,oneof" json:"candidate,omitempty"` // contains filtered or unexported fields }
func (*VotePaper) Descriptor
deprecated
func (*VotePaper) GetCandidate ¶
func (*VotePaper) ProtoMessage ¶
func (*VotePaper) ProtoMessage()
func (*VotePaper) ProtoReflect ¶
func (x *VotePaper) ProtoReflect() protoreflect.Message