models

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BgScore = map[string]BgPartialData{}

<summary>: 対応しているボードゲームの情報

View Source
var ErrBoardgameNotFound = ErrorMessage{
	Error:   "E003",
	Message: "指定されたボードゲームは存在しません",
}

<summary>: 【エラー】対象のボードゲーム情報が存在しません

View Source
var ErrConnectionNotFound = ErrorMessage{
	Error:   "E002",
	Message: "指定された接続元は存在しません",
}

<summary>: 【エラー】対象の接続が存在しません

View Source
var ErrEnteredAnotherRoom = ErrorMessage{
	Error:   "E201",
	Message: "一つの部屋へ既に入室しています",
}

<summary>: 【エラー】別室へ既に入室している

View Source
var ErrIllegalConnId = ErrorMessage{
	Error:   "E102",
	Message: "不正なconnection_idが検知されました",
}

<summary>: 【エラー】不正なConnectionID

View Source
var ErrInvalidMethod = ErrorMessage{
	Error:   "E101",
	Message: "無効なメソッドが指定されました",
}

<summary>: 【エラー】無効なメソッド

View Source
var ErrMismatchGame = ErrorMessage{
	Error:   "E203",
	Message: "指定された部屋のゲーム内容が違います",
}

<summary>: 【エラー】部屋のゲーム内容に誤りがある

View Source
var ErrNotInRoom = ErrorMessage{
	Error:   "E004",
	Message: "指定された部屋にまだ入室していません",
}

<summary>: 【エラー】部屋の中に入室していません

View Source
var ErrRoomExisted = ErrorMessage{
	Error:   "E202",
	Message: "指定された部屋は既に存在しています",
}

<summary>: 【エラー】部屋が既に存在します

View Source
var ErrRoomNotFound = ErrorMessage{
	Error:   "E001",
	Message: "指定された部屋は存在しません",
}

<summary>: 【エラー】部屋が存在しません

View Source
var ErrSameColorExistedInRoom = ErrorMessage{
	Error:   "E204",
	Message: "指定された部屋には既に同色のプレイヤーが入室しています",
}

<summary>: 【エラー】部屋に同じ色のプレイヤーが参加しようとしている

Functions

func MapStructsToTables

func MapStructsToTables(dbmap *gorp.DbMap)

MapStructsToTables 構造体と物理テーブルの紐付け

Types

type BgPartialData

type BgPartialData struct {
	Title      string   `json:"title"`
	MinPlayers int      `json:"min_players"`
	MaxPlayers int      `json:"max_players"`
	Colors     []string `json:"colors"`
}

<summary>: スコアツール対応のボードゲームデータを格納します

type BgScoreSupport

type BgScoreSupport struct {
	GameId     string `db:"game_id"`
	Title      string `db:"title"`
	MinPlayers int    `db:"min_players"`
	MaxPlayers int    `db:"max_players"`
	Color      string `db:"color"`
}

type CheckRoomResult

type CheckRoomResult struct {
	IsExist bool   `json:"is_exist"`
	GameId  string `json:"game_id"`
}

<summary>: 部屋の存在確認に使用される構造体

type ConnectedResponse

type ConnectedResponse struct {
	ConnId string `json:"connection_id"`
}

<summary>: 接続時、Response内のParamsに使用される構造体

type ConnectionSummary

type ConnectionSummary struct {
	ConnId       string          `json:"connection_id"`
	RoomId       string          `json:"room_id"`
	GameId       string          `json:"game_id"`
	GameData     BgPartialData   `json:"gama_data"`
	PlayerColor  string          `json:"player_color"`
	OtherPlayers []PlayerInfoSet `json:"other_players"`
}

<summary>: 接続情報を一覧表示するための構造体

type ErrorMessage

type ErrorMessage struct {
	Error   string `json:"error"`
	Message string `json:"message"`
}

<summary>: エラーに関する情報を格納する構造体

type Method

type Method string
const (
	BROADCAST Method = "BROADCAST"
	CREATE    Method = "CREATE"
	JOIN      Method = "JOIN"
	LEAVE     Method = "LEAVE"

	NONE       Method = "NONE"
	CONNECT    Method = "CONNECT"
	DISCONNECT Method = "DISCONNECT"
	EJECT      Method = "EJECT"
	NOTIFY     Method = "NOTIFY"
	OK         Method = "OK"
	ERROR      Method = "ERROR"
)

func ParseMethod

func ParseMethod(s string) (m Method)

<summary>: 文字列をMethodとして表現します

func (Method) String

func (m Method) String() string

<summary>: Methodを文字列として表現します

type MstrBoardgame

type MstrBoardgame struct {
	Id              string `db:"id, primarykey" json:"id"`
	UniqueName      string `db:"unique_name" json:"unique_name"`
	Title           string `db:"title" json:"title"`
	MinPlayers      int    `db:"min_players" json:"min_players"`
	MaxPlayers      int    `db:"max_players" json:"max_players"`
	PlayingTime     string `db:"playing_time" json:"playing_time"`
	MinAge          int    `db:"min_age" json:"min_age"`
	IsExpansion     bool   `db:"is_expansion" json:"is_expansion"`
	ExpansionBaseId string `db:"expansion_base_id" json:"expansion_base_id"`
	ProductUrl      string `db:"product_url" json:"product_url"`
	BodogeHoobbyNet bool   `db:"bodoge_hoobby_net" json:"bodoge_hoobby_net"`
	ScoreTool       bool   `db:"score_tool" json:"score_tool"`
}

type MstrColor

type MstrColor struct {
	GameId string `db:"game_id" json:"game_id"`
	Color  string `db:"color" json:"color"`
}

type MstrUser

type MstrUser struct {
	Id          string `db:"id, primarykey" json:"id"`
	UserName    string `db:"user_name" json:"user_name"`
	MailAddress string `db:"mail_address" json:"mail_address"`
	AuthKey     string `db:"auth_key" json:"auth_key"`
}

type PlayerInfoSet

type PlayerInfoSet struct {
	ConnId      string `json:"connection_id"`
	PlayerColor string `json:"player_color"`
}

<summary>: プレーヤーの情報

type PointResponse

type PointResponse struct {
	Player PlayerInfoSet `json:"player"`
	Points []int         `json:"points"`
}

<summary>: 得点のブロードキャスト時、Response内のParamsに使用される構造体

type RoomInfoSet

type RoomInfoSet struct {
	GameId  string          `json:"game_id"`
	Players []PlayerInfoSet `json:"players"`
}

<summary>: 部屋のゲーム内容と部屋にいるプレーヤー情報

type RoomResponse

type RoomResponse struct {
	IsWait   bool        `json:"is_wait"`
	RoomInfo RoomInfoSet `json:"room"`
}

<summary>: 部屋の情報伝達時、Response内のParamsに使用される構造体

type RoomSummary

type RoomSummary struct {
	RoomId   string          `json:"room_id"`
	GameId   string          `json:"game_id"`
	GameData BgPartialData   `json:"gama_data"`
	Players  []PlayerInfoSet `json:"players"`
}

<summary>: 部屋情報を一覧表示するための構造体

type TranOwn

type TranOwn struct {
	UserId string `db:"user_id" json:"user_id"`
	GameId string `db:"game_id" json:"game_id"`
}

type WsRequest

type WsRequest struct {
	Method      string `json:"method"`
	ConnId      string `json:"connection_id"`
	RoomId      string `json:"room_id"`
	GameId      string `json:"game_id"`
	PlayerColor string `json:"player_color"`
	Points      []int  `json:"points"`
}

<summary>: WebSocketでの受信用データの構造体

type WsResponse

type WsResponse struct {
	Method string      `json:"method"`
	Params interface{} `json:"params"`
}

<summary>: WebSocketからの返却用データの構造体

Jump to

Keyboard shortcuts

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