game

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GameCreateReq deprecated

type GameCreateReq = GameCreateRequest

Deprecated: Use GameCreateRequest directly

type GameCreateRequest

type GameCreateRequest struct {
	Name        string `json:"name"`
	AliasName   string `json:"aliasName"`
	Description string `json:"description"`
	Config      string `json:"config"`
}

GameCreateRequest represents the request to create a game

type GameCreateResp deprecated

type GameCreateResp = GameCreateResponse

Deprecated: Use GameCreateResponse directly

type GameCreateResponse

type GameCreateResponse struct {
	Game GameInfo `json:"game"`
}

GameCreateResponse represents the response after creating a game

type GameDeleteReq deprecated

type GameDeleteReq = GameDeleteRequest

Deprecated: Use GameDeleteRequest directly

type GameDeleteRequest

type GameDeleteRequest struct {
	ID string `uri:"id"`
}

GameDeleteRequest represents the request to delete a game

type GameDeleteResp deprecated

type GameDeleteResp = GameDeleteResponse

Deprecated: Use GameDeleteResponse directly

type GameDeleteResponse

type GameDeleteResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

GameDeleteResponse represents the response after deleting a game

type GameDetailReq deprecated

type GameDetailReq = GameDetailRequest

Deprecated: Use GameDetailRequest directly

type GameDetailRequest

type GameDetailRequest struct {
	ID string `uri:"id"`
}

GameDetailRequest represents the request to get game details

type GameDetailResp deprecated

type GameDetailResp = GameDetailResponse

Deprecated: Use GameDetailResponse directly

type GameDetailResponse

type GameDetailResponse struct {
	Game GameInfo `json:"game"`
}

GameDetailResponse represents the response with game details

type GameEnvAddReq deprecated

type GameEnvAddReq = GameEnvAddRequest

Deprecated: Use GameEnvAddRequest directly

type GameEnvAddRequest

type GameEnvAddRequest struct {
	ID   string `uri:"id"`
	Name string `json:"name"`
	Type string `json:"type"`
}

GameEnvAddRequest represents the request to add a game environment

type GameEnvAddResp deprecated

type GameEnvAddResp = GameEnvAddResponse

Deprecated: Use GameEnvAddResponse directly

type GameEnvAddResponse

type GameEnvAddResponse struct {
	Envs []GameEnvItem `json:"envs"`
}

GameEnvAddResponse represents the response after adding a game environment

type GameEnvDeleteReq deprecated

type GameEnvDeleteReq = GameEnvDeleteRequest

Deprecated: Use GameEnvDeleteRequest directly

type GameEnvDeleteRequest

type GameEnvDeleteRequest struct {
	ID    string `uri:"id"`
	EnvID string `uri:"envId"`
}

GameEnvDeleteRequest represents the request to delete a game environment

type GameEnvDeleteResp deprecated

type GameEnvDeleteResp = GameEnvDeleteResponse

Deprecated: Use GameEnvDeleteResponse directly

type GameEnvDeleteResponse

type GameEnvDeleteResponse struct {
	Envs []GameEnvItem `json:"envs"`
}

GameEnvDeleteResponse represents the response after deleting a game environment

type GameEnvItem

type GameEnvItem struct {
	Env         string `json:"env"`
	Description string `json:"description"`
	Color       string `json:"color"`
}

GameEnvItem represents a game environment

type GameEnvUpdateReq deprecated

type GameEnvUpdateReq = GameEnvUpdateRequest

Deprecated: Use GameEnvUpdateRequest directly

type GameEnvUpdateRequest

type GameEnvUpdateRequest struct {
	ID    string `uri:"id"`
	EnvID string `uri:"envId"`
	Name  string `json:"name"`
	Type  string `json:"type"`
}

GameEnvUpdateRequest represents the request to update a game environment

type GameEnvUpdateResp deprecated

type GameEnvUpdateResp = GameEnvUpdateResponse

Deprecated: Use GameEnvUpdateResponse directly

type GameEnvUpdateResponse

type GameEnvUpdateResponse struct {
	Envs []GameEnvItem `json:"envs"`
}

GameEnvUpdateResponse represents the response after updating a game environment

type GameEnvsData

type GameEnvsData struct {
	Envs []GameEnvItem `json:"envs"`
}

GameEnvsData represents game environments data

type GameEnvsListReq deprecated

type GameEnvsListReq = GameEnvsListRequest

Deprecated: Use GameEnvsListRequest directly

type GameEnvsListRequest

type GameEnvsListRequest struct {
	ID string `uri:"id"`
}

GameEnvsListRequest represents the request to list game environments

type GameEnvsListResp deprecated

type GameEnvsListResp = GameEnvsListResponse

Deprecated: Use GameEnvsListResponse directly

type GameEnvsListResponse

type GameEnvsListResponse struct {
	Envs []GameEnvItem `json:"envs"`
}

GameEnvsListResponse represents the response with game environments

type GameInfo

type GameInfo struct {
	ID          uint          `json:"id"`
	Name        string        `json:"name"`
	Icon        string        `json:"icon"`
	Description string        `json:"description"`
	Enabled     bool          `json:"enabled"`
	AliasName   string        `json:"aliasName"`
	Homepage    string        `json:"homepage"`
	Status      string        `json:"status"`
	GameType    string        `json:"gameType"`
	GenreCode   string        `json:"genreCode"`
	Color       string        `json:"color"`
	Envs        []GameEnvItem `json:"envs"`
	CreatedAt   string        `json:"createdAt"`
	UpdatedAt   string        `json:"updatedAt"`
}

GameInfo represents game information

type GameUpdateReq deprecated

type GameUpdateReq = GameUpdateRequest

Deprecated: Use GameUpdateRequest directly

type GameUpdateRequest

type GameUpdateRequest struct {
	ID          string `uri:"id"`
	Name        string `json:"name"`
	AliasName   string `json:"aliasName"`
	Description string `json:"description"`
	Config      string `json:"config"`
	Status      string `json:"status"`
}

GameUpdateRequest represents the request to update a game

type GameUpdateResp deprecated

type GameUpdateResp = GameUpdateResponse

Deprecated: Use GameUpdateResponse directly

type GameUpdateResponse

type GameUpdateResponse struct {
	Game GameInfo `json:"game"`
}

GameUpdateResponse represents the response after updating a game

type GamesData

type GamesData struct {
	Games []GameInfo `json:"games"`
	Total int        `json:"total"`
}

GamesData represents games data

type GamesListReq deprecated

type GamesListReq = GamesListRequest

Deprecated: Use GamesListRequest directly

type GamesListRequest

type GamesListRequest struct {
	Page     int    `form:"page"`
	PageSize int    `form:"pageSize"`
	Status   string `form:"status"`
}

GamesListRequest represents the request to list games

type GamesListResp deprecated

type GamesListResp = GamesListResponse

Deprecated: Use GamesListResponse directly

type GamesListResponse

type GamesListResponse struct {
	Games []GameInfo `json:"games"`
	Total int        `json:"total"`
	Page  int        `json:"page"`
	Size  int        `json:"size"`
}

GamesListResponse represents the response with a list of games

type Handler

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

func NewHandler

func NewHandler(service *Service) *Handler

func (*Handler) Create

func (h *Handler) Create(c *gin.Context)

Create handles the request to create a new game

func (*Handler) Delete

func (h *Handler) Delete(c *gin.Context)

Delete handles the request to delete a game

func (*Handler) Detail

func (h *Handler) Detail(c *gin.Context)

Detail handles the request to get game details

func (*Handler) EnvAdd

func (h *Handler) EnvAdd(c *gin.Context)

EnvAdd handles the request to add a game environment

func (*Handler) EnvDelete

func (h *Handler) EnvDelete(c *gin.Context)

EnvDelete handles the request to delete a game environment

func (*Handler) EnvUpdate

func (h *Handler) EnvUpdate(c *gin.Context)

EnvUpdate handles the request to update a game environment

func (*Handler) EnvsList

func (h *Handler) EnvsList(c *gin.Context)

EnvsList handles the request to list game environments

func (*Handler) List

func (h *Handler) List(c *gin.Context)

List handles the request to list games

func (*Handler) Update

func (h *Handler) Update(c *gin.Context)

Update handles the request to update a game

type Service

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

func NewService

func NewService(svcCtx *svc.ServiceContext) *Service

func (*Service) Create

Create creates a new game

func (*Service) Delete

func (s *Service) Delete(ctx context.Context, req *GameDeleteRequest) error

Delete deletes a game

func (*Service) Detail

Detail retrieves details of a specific game

func (*Service) EnvAdd

EnvAdd adds a new environment to a game

func (*Service) EnvDelete

EnvDelete deletes an environment from a game

func (*Service) EnvUpdate

EnvUpdate updates an existing environment in a game

func (*Service) EnvsList

EnvsList retrieves the environments for a game

func (*Service) List

List retrieves a paginated list of games

func (*Service) Update

Update updates an existing game

Jump to

Keyboard shortcuts

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