server

package
v0.0.0-...-73c2e26 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2025 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleCards

func HandleCards(c echo.Context, conn *sql.DB) error

func HandleDeleteAdminAntenna

func HandleDeleteAdminAntenna(c echo.Context, conn *sql.DB) error

func HandleDeleteAdminGame

func HandleDeleteAdminGame(c echo.Context, conn *sql.DB) error

func HandleDeleteAdminPlayerHand

func HandleDeleteAdminPlayerHand(c echo.Context, conn *sql.DB) error

func HandleDeviceBoot

func HandleDeviceBoot(c echo.Context, conn *sql.DB) error

HandleDeviceBoot handle booting device

func HandleGetAdminAntenna

func HandleGetAdminAntenna(c echo.Context, conn *sql.DB) error

func HandleGetAdminPlayerHand

func HandleGetAdminPlayerHand(c echo.Context, conn *sql.DB) error

func HandleGetAdminPlayers

func HandleGetAdminPlayers(c echo.Context, conn *sql.DB) error

func HandlePostAdminAntenna

func HandlePostAdminAntenna(c echo.Context, conn *sql.DB) error

func HandlePostAdminPlayer

func HandlePostAdminPlayer(c echo.Context, conn *sql.DB) error

func Run

func Run(ctx context.Context) error

Types

type Antenna

type Antenna struct {
	ID              int32  `json:"id"`
	DeviceID        string `json:"device_id"`
	PairID          int    `json:"pair_id"`
	AntennaTypeName string `json:"antenna_type_name"`
}

type Card

type Card struct {
	Suit string `json:"suit"`
	Rank string `json:"rank"`
}

type Device

type Device struct {
	DeviceID string `json:"device_id"`
	PairIDs  []int  `json:"pair_ids"`
}

type ErrorResponse

type ErrorResponse struct {
	Error string `json:"error"`
}

ErrorResponse is response for error

type GetAdminAntennaResponse

type GetAdminAntennaResponse struct {
	Antenna []Antenna `json:"antenna"`
}

type GetAdminPlayerHandResponse

type GetAdminPlayerHandResponse struct {
	Hand Hand `json:"hand"`
}

type GetAdminPlayersResponse

type GetAdminPlayersResponse struct {
	Players []Player `json:"players"`
}

type Hand

type Hand struct {
	ID       int32   `json:"id"`
	PlayerID int32   `json:"player_id"`
	IsMuck   bool    `json:"is_muck"`
	Card     [2]Card `json:"cards"`
}

type Player

type Player struct {
	ID   int32  `json:"id"`
	Name string `json:"name"`

	DeviceID string `json:"device_id"`
	PairID   int    `json:"pair_id"`
}

type PostAdminAntennaRequest

type PostAdminAntennaRequest struct {
	ID              string `param:"id" json:"id"`
	AntennaTypeName string `json:"antenna_type_name"`
}

type PostAdminPlayerRequest

type PostAdminPlayerRequest struct {
	ID   string `param:"id"`
	Name string `json:"name"`
}

type PostAdminPlayerResponse

type PostAdminPlayerResponse struct {
	Player Player `json:"player"`
}

type PostCardRequest

type PostCardRequest struct {
	UID      string `json:"uid"`
	DeviceID string `json:"device_id"`
	PairID   int    `json:"pair_id"`
}

type Send

type Send struct {
	Players []SendPlayer `json:"players"`
	Board   []SendCard   `json:"board"`
}

Send is struct for WebSocket sending

type SendCard

type SendCard struct {
	Suit string `json:"suit"`
	Rank string `json:"rank"`
}

type SendPlayer

type SendPlayer struct {
	Name   string     `json:"name"`
	Hand   []SendCard `json:"hand"`
	Equity float64    `json:"equity"`
}

type WebSocketManager

type WebSocketManager struct {
	// contains filtered or unexported fields
}

WebSocketManager manages WebSocket connections

Jump to

Keyboard shortcuts

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