baldaapi

package
v0.0.0-...-0a9bd2c Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Overview

Code generated by ogen, DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRolesForBearerAuth

func GetRolesForBearerAuth(operation string) []string

GetRolesForBearerAuth returns the required roles for the given operation.

This is useful for authorization scenarios where you need to know which roles are required for an operation.

Example:

requiredRoles := GetRolesForBearerAuth(AddPetOperation)

Returns nil if the operation has no role requirements or if the operation is unknown.

func WithServerURL

func WithServerURL(ctx context.Context, u *url.URL) context.Context

WithServerURL sets context key to override server URL.

Types

type AcceptEndGameConflict

type AcceptEndGameConflict ErrorResponse

func (*AcceptEndGameConflict) Decode

func (s *AcceptEndGameConflict) Decode(d *jx.Decoder) error

Decode decodes AcceptEndGameConflict from json.

func (*AcceptEndGameConflict) Encode

func (s *AcceptEndGameConflict) Encode(e *jx.Encoder)

Encode encodes AcceptEndGameConflict as json.

func (*AcceptEndGameConflict) MarshalJSON

func (s *AcceptEndGameConflict) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AcceptEndGameConflict) UnmarshalJSON

func (s *AcceptEndGameConflict) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type AcceptEndGameForbidden

type AcceptEndGameForbidden ErrorResponse

func (*AcceptEndGameForbidden) Decode

func (s *AcceptEndGameForbidden) Decode(d *jx.Decoder) error

Decode decodes AcceptEndGameForbidden from json.

func (*AcceptEndGameForbidden) Encode

func (s *AcceptEndGameForbidden) Encode(e *jx.Encoder)

Encode encodes AcceptEndGameForbidden as json.

func (*AcceptEndGameForbidden) MarshalJSON

func (s *AcceptEndGameForbidden) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AcceptEndGameForbidden) UnmarshalJSON

func (s *AcceptEndGameForbidden) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type AcceptEndGameNoContent

type AcceptEndGameNoContent struct{}

AcceptEndGameNoContent is response for AcceptEndGame operation.

type AcceptEndGameNotFound

type AcceptEndGameNotFound ErrorResponse

func (*AcceptEndGameNotFound) Decode

func (s *AcceptEndGameNotFound) Decode(d *jx.Decoder) error

Decode decodes AcceptEndGameNotFound from json.

func (*AcceptEndGameNotFound) Encode

func (s *AcceptEndGameNotFound) Encode(e *jx.Encoder)

Encode encodes AcceptEndGameNotFound as json.

func (*AcceptEndGameNotFound) MarshalJSON

func (s *AcceptEndGameNotFound) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AcceptEndGameNotFound) UnmarshalJSON

func (s *AcceptEndGameNotFound) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type AcceptEndGameParams

type AcceptEndGameParams struct {
	// ID of the game.
	ID uuid.UUID
}

AcceptEndGameParams is parameters of acceptEndGame operation.

type AcceptEndGameRes

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

type AcceptEndGameUnauthorized

type AcceptEndGameUnauthorized ErrorResponse

func (*AcceptEndGameUnauthorized) Decode

func (s *AcceptEndGameUnauthorized) Decode(d *jx.Decoder) error

Decode decodes AcceptEndGameUnauthorized from json.

func (*AcceptEndGameUnauthorized) Encode

func (s *AcceptEndGameUnauthorized) Encode(e *jx.Encoder)

Encode encodes AcceptEndGameUnauthorized as json.

func (*AcceptEndGameUnauthorized) MarshalJSON

func (s *AcceptEndGameUnauthorized) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AcceptEndGameUnauthorized) UnmarshalJSON

func (s *AcceptEndGameUnauthorized) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type Achievement

type Achievement struct {
	// Achievement identifier.
	ID OptAchievementID `json:"id"`
	// Achievement display name.
	Name OptString `json:"name"`
	// Achievement description.
	Description OptString `json:"description"`
	// Whether the achievement has been unlocked.
	Unlocked OptBool `json:"unlocked"`
}

Ref: #/components/schemas/Achievement

func (*Achievement) Decode

func (s *Achievement) Decode(d *jx.Decoder) error

Decode decodes Achievement from json.

func (*Achievement) Encode

func (s *Achievement) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Achievement) GetDescription

func (s *Achievement) GetDescription() OptString

GetDescription returns the value of Description.

func (*Achievement) GetID

func (s *Achievement) GetID() OptAchievementID

GetID returns the value of ID.

func (*Achievement) GetName

func (s *Achievement) GetName() OptString

GetName returns the value of Name.

func (*Achievement) GetUnlocked

func (s *Achievement) GetUnlocked() OptBool

GetUnlocked returns the value of Unlocked.

func (*Achievement) MarshalJSON

func (s *Achievement) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Achievement) SetDescription

func (s *Achievement) SetDescription(val OptString)

SetDescription sets the value of Description.

func (*Achievement) SetID

func (s *Achievement) SetID(val OptAchievementID)

SetID sets the value of ID.

func (*Achievement) SetName

func (s *Achievement) SetName(val OptString)

SetName sets the value of Name.

func (*Achievement) SetUnlocked

func (s *Achievement) SetUnlocked(val OptBool)

SetUnlocked sets the value of Unlocked.

func (*Achievement) UnmarshalJSON

func (s *Achievement) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Achievement) Validate

func (s *Achievement) Validate() error

type AchievementID

type AchievementID string

Achievement identifier.

const (
	AchievementIDFirstGame      AchievementID = "first_game"
	AchievementIDFirstWin       AchievementID = "first_win"
	AchievementIDHighScorer50   AchievementID = "high_scorer_50"
	AchievementIDWordsmith10    AchievementID = "wordsmith_10"
	AchievementIDGiantWord      AchievementID = "giant_word"
	AchievementIDWinningStreak3 AchievementID = "winning_streak_3"
	AchievementIDVeteran10      AchievementID = "veteran_10"
)

func (AchievementID) AllValues

func (AchievementID) AllValues() []AchievementID

AllValues returns all AchievementID values.

func (*AchievementID) Decode

func (s *AchievementID) Decode(d *jx.Decoder) error

Decode decodes AchievementID from json.

func (AchievementID) Encode

func (s AchievementID) Encode(e *jx.Encoder)

Encode encodes AchievementID as json.

func (AchievementID) MarshalJSON

func (s AchievementID) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (AchievementID) MarshalText

func (s AchievementID) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*AchievementID) UnmarshalJSON

func (s *AchievementID) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*AchievementID) UnmarshalText

func (s *AchievementID) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (AchievementID) Validate

func (s AchievementID) Validate() error

type ActiveGame

type ActiveGame struct {
	// ID of the active game.
	GameID OptUUID `json:"game_id"`
	// Centrifugo subscription JWT for the game channel.
	GameToken OptString `json:"game_token"`
	// Current 5x5 board state.
	Board [][]string `json:"board"`
	// ID of the player whose turn it is.
	CurrentTurnUID OptUUID           `json:"current_turn_uid"`
	MoveNumber     OptInt            `json:"move_number"`
	Status         OptGameStatus     `json:"status"`
	Players        []PlayerGameState `json:"players"`
}

Ref: #/components/schemas/ActiveGame

func (*ActiveGame) Decode

func (s *ActiveGame) Decode(d *jx.Decoder) error

Decode decodes ActiveGame from json.

func (*ActiveGame) Encode

func (s *ActiveGame) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*ActiveGame) GetBoard

func (s *ActiveGame) GetBoard() [][]string

GetBoard returns the value of Board.

func (*ActiveGame) GetCurrentTurnUID

func (s *ActiveGame) GetCurrentTurnUID() OptUUID

GetCurrentTurnUID returns the value of CurrentTurnUID.

func (*ActiveGame) GetGameID

func (s *ActiveGame) GetGameID() OptUUID

GetGameID returns the value of GameID.

func (*ActiveGame) GetGameToken

func (s *ActiveGame) GetGameToken() OptString

GetGameToken returns the value of GameToken.

func (*ActiveGame) GetMoveNumber

func (s *ActiveGame) GetMoveNumber() OptInt

GetMoveNumber returns the value of MoveNumber.

func (*ActiveGame) GetPlayers

func (s *ActiveGame) GetPlayers() []PlayerGameState

GetPlayers returns the value of Players.

func (*ActiveGame) GetStatus

func (s *ActiveGame) GetStatus() OptGameStatus

GetStatus returns the value of Status.

func (*ActiveGame) MarshalJSON

func (s *ActiveGame) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*ActiveGame) SetBoard

func (s *ActiveGame) SetBoard(val [][]string)

SetBoard sets the value of Board.

func (*ActiveGame) SetCurrentTurnUID

func (s *ActiveGame) SetCurrentTurnUID(val OptUUID)

SetCurrentTurnUID sets the value of CurrentTurnUID.

func (*ActiveGame) SetGameID

func (s *ActiveGame) SetGameID(val OptUUID)

SetGameID sets the value of GameID.

func (*ActiveGame) SetGameToken

func (s *ActiveGame) SetGameToken(val OptString)

SetGameToken sets the value of GameToken.

func (*ActiveGame) SetMoveNumber

func (s *ActiveGame) SetMoveNumber(val OptInt)

SetMoveNumber sets the value of MoveNumber.

func (*ActiveGame) SetPlayers

func (s *ActiveGame) SetPlayers(val []PlayerGameState)

SetPlayers sets the value of Players.

func (*ActiveGame) SetStatus

func (s *ActiveGame) SetStatus(val OptGameStatus)

SetStatus sets the value of Status.

func (*ActiveGame) UnmarshalJSON

func (s *ActiveGame) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ActiveGame) Validate

func (s *ActiveGame) Validate() error

type AuthRequest

type AuthRequest struct {
	// User's email.
	Email string `json:"email"`
	// User's password.
	Password string `json:"password"`
}

Ref: #/components/schemas/AuthRequest

func (*AuthRequest) Decode

func (s *AuthRequest) Decode(d *jx.Decoder) error

Decode decodes AuthRequest from json.

func (*AuthRequest) Encode

func (s *AuthRequest) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*AuthRequest) GetEmail

func (s *AuthRequest) GetEmail() string

GetEmail returns the value of Email.

func (*AuthRequest) GetPassword

func (s *AuthRequest) GetPassword() string

GetPassword returns the value of Password.

func (*AuthRequest) MarshalJSON

func (s *AuthRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AuthRequest) SetEmail

func (s *AuthRequest) SetEmail(val string)

SetEmail sets the value of Email.

func (*AuthRequest) SetPassword

func (s *AuthRequest) SetPassword(val string)

SetPassword sets the value of Password.

func (*AuthRequest) UnmarshalJSON

func (s *AuthRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type AuthRes

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

type AuthResponse

type AuthResponse struct {
	Player OptPlayer `json:"player"`
	// Short-lived JWT access token (Authorization: Bearer).
	AccessToken OptString `json:"access_token"`
	// Opaque long-lived token used to obtain a new access token.
	RefreshToken OptString `json:"refresh_token"`
	// Always "Bearer".
	TokenType OptString `json:"token_type"`
	// Access token lifetime in seconds.
	ExpiresIn OptInt `json:"expires_in"`
	// JWT for connecting to the Centrifugo WebSocket.
	CentrifugoToken OptString `json:"centrifugo_token"`
	// Centrifugo subscription JWT for the lobby channel.
	LobbyToken OptString `json:"lobby_token"`
	// Present when the player is currently in an active game. Use this to reconnect after a disconnect.
	ActiveGame OptActiveGame `json:"active_game"`
}

Ref: #/components/schemas/AuthResponse

func (*AuthResponse) Decode

func (s *AuthResponse) Decode(d *jx.Decoder) error

Decode decodes AuthResponse from json.

func (*AuthResponse) Encode

func (s *AuthResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*AuthResponse) GetAccessToken

func (s *AuthResponse) GetAccessToken() OptString

GetAccessToken returns the value of AccessToken.

func (*AuthResponse) GetActiveGame

func (s *AuthResponse) GetActiveGame() OptActiveGame

GetActiveGame returns the value of ActiveGame.

func (*AuthResponse) GetCentrifugoToken

func (s *AuthResponse) GetCentrifugoToken() OptString

GetCentrifugoToken returns the value of CentrifugoToken.

func (*AuthResponse) GetExpiresIn

func (s *AuthResponse) GetExpiresIn() OptInt

GetExpiresIn returns the value of ExpiresIn.

func (*AuthResponse) GetLobbyToken

func (s *AuthResponse) GetLobbyToken() OptString

GetLobbyToken returns the value of LobbyToken.

func (*AuthResponse) GetPlayer

func (s *AuthResponse) GetPlayer() OptPlayer

GetPlayer returns the value of Player.

func (*AuthResponse) GetRefreshToken

func (s *AuthResponse) GetRefreshToken() OptString

GetRefreshToken returns the value of RefreshToken.

func (*AuthResponse) GetTokenType

func (s *AuthResponse) GetTokenType() OptString

GetTokenType returns the value of TokenType.

func (*AuthResponse) MarshalJSON

func (s *AuthResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AuthResponse) SetAccessToken

func (s *AuthResponse) SetAccessToken(val OptString)

SetAccessToken sets the value of AccessToken.

func (*AuthResponse) SetActiveGame

func (s *AuthResponse) SetActiveGame(val OptActiveGame)

SetActiveGame sets the value of ActiveGame.

func (*AuthResponse) SetCentrifugoToken

func (s *AuthResponse) SetCentrifugoToken(val OptString)

SetCentrifugoToken sets the value of CentrifugoToken.

func (*AuthResponse) SetExpiresIn

func (s *AuthResponse) SetExpiresIn(val OptInt)

SetExpiresIn sets the value of ExpiresIn.

func (*AuthResponse) SetLobbyToken

func (s *AuthResponse) SetLobbyToken(val OptString)

SetLobbyToken sets the value of LobbyToken.

func (*AuthResponse) SetPlayer

func (s *AuthResponse) SetPlayer(val OptPlayer)

SetPlayer sets the value of Player.

func (*AuthResponse) SetRefreshToken

func (s *AuthResponse) SetRefreshToken(val OptString)

SetRefreshToken sets the value of RefreshToken.

func (*AuthResponse) SetTokenType

func (s *AuthResponse) SetTokenType(val OptString)

SetTokenType sets the value of TokenType.

func (*AuthResponse) UnmarshalJSON

func (s *AuthResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*AuthResponse) Validate

func (s *AuthResponse) Validate() error

type AuthTelegramInternalServerError

type AuthTelegramInternalServerError ErrorResponse

func (*AuthTelegramInternalServerError) Decode

Decode decodes AuthTelegramInternalServerError from json.

func (*AuthTelegramInternalServerError) Encode

Encode encodes AuthTelegramInternalServerError as json.

func (*AuthTelegramInternalServerError) MarshalJSON

func (s *AuthTelegramInternalServerError) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AuthTelegramInternalServerError) UnmarshalJSON

func (s *AuthTelegramInternalServerError) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type AuthTelegramRes

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

type AuthTelegramServiceUnavailable

type AuthTelegramServiceUnavailable ErrorResponse

func (*AuthTelegramServiceUnavailable) Decode

Decode decodes AuthTelegramServiceUnavailable from json.

func (*AuthTelegramServiceUnavailable) Encode

Encode encodes AuthTelegramServiceUnavailable as json.

func (*AuthTelegramServiceUnavailable) MarshalJSON

func (s *AuthTelegramServiceUnavailable) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AuthTelegramServiceUnavailable) UnmarshalJSON

func (s *AuthTelegramServiceUnavailable) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type AuthTelegramUnauthorized

type AuthTelegramUnauthorized ErrorResponse

func (*AuthTelegramUnauthorized) Decode

func (s *AuthTelegramUnauthorized) Decode(d *jx.Decoder) error

Decode decodes AuthTelegramUnauthorized from json.

func (*AuthTelegramUnauthorized) Encode

func (s *AuthTelegramUnauthorized) Encode(e *jx.Encoder)

Encode encodes AuthTelegramUnauthorized as json.

func (*AuthTelegramUnauthorized) MarshalJSON

func (s *AuthTelegramUnauthorized) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AuthTelegramUnauthorized) UnmarshalJSON

func (s *AuthTelegramUnauthorized) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type BearerAuth

type BearerAuth struct {
	Token string
	Roles []string
}

func (*BearerAuth) GetRoles

func (s *BearerAuth) GetRoles() []string

GetRoles returns the value of Roles.

func (*BearerAuth) GetToken

func (s *BearerAuth) GetToken() string

GetToken returns the value of Token.

func (*BearerAuth) SetRoles

func (s *BearerAuth) SetRoles(val []string)

SetRoles sets the value of Roles.

func (*BearerAuth) SetToken

func (s *BearerAuth) SetToken(val string)

SetToken sets the value of Token.

type BoardCell

type BoardCell struct {
	Row int `json:"row"`
	Col int `json:"col"`
}

A cell position on the 5×5 board, used in word_path. The character at each cell is resolved server-side from the current board state; clients do not need to send it. The new letter being placed is provided separately in new_letter.char. Ref: #/components/schemas/BoardCell

func (*BoardCell) Decode

func (s *BoardCell) Decode(d *jx.Decoder) error

Decode decodes BoardCell from json.

func (*BoardCell) Encode

func (s *BoardCell) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*BoardCell) GetCol

func (s *BoardCell) GetCol() int

GetCol returns the value of Col.

func (*BoardCell) GetRow

func (s *BoardCell) GetRow() int

GetRow returns the value of Row.

func (*BoardCell) MarshalJSON

func (s *BoardCell) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*BoardCell) SetCol

func (s *BoardCell) SetCol(val int)

SetCol sets the value of Col.

func (*BoardCell) SetRow

func (s *BoardCell) SetRow(val int)

SetRow sets the value of Row.

func (*BoardCell) UnmarshalJSON

func (s *BoardCell) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*BoardCell) Validate

func (s *BoardCell) Validate() error

type Client

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

Client implements OAS client.

func NewClient

func NewClient(serverURL string, sec SecuritySource, opts ...ClientOption) (*Client, error)

NewClient initializes new Client defined by OAS.

func (*Client) AcceptEndGame

func (c *Client) AcceptEndGame(ctx context.Context, params AcceptEndGameParams) (AcceptEndGameRes, error)

AcceptEndGame invokes acceptEndGame operation.

The opponent accepts the end-game proposal. The game ends immediately with the current scores. Only the non-proposing player may call this.

POST /games/{id}/accept-end

func (*Client) Auth

func (c *Client) Auth(ctx context.Context, request *AuthRequest) (AuthRes, error)

Auth invokes auth operation.

Auth request.

POST /auth

func (*Client) AuthTelegram

func (c *Client) AuthTelegram(ctx context.Context, request *TelegramAuthRequest) (AuthTelegramRes, error)

AuthTelegram invokes authTelegram operation.

Validates the signed init data produced by the Telegram WebView against the bot token, then logs in an existing user or creates a new one linked to their Telegram account.

POST /auth/telegram

func (*Client) CreateGame

func (c *Client) CreateGame(ctx context.Context) (CreateGameRes, error)

CreateGame invokes createGame operation.

Create a new game.

POST /games

func (*Client) CreateGameWithBot

func (c *Client) CreateGameWithBot(ctx context.Context) (CreateGameWithBotRes, error)

CreateGameWithBot invokes createGameWithBot operation.

Creates a new game where the authenticated player plays against a server-side bot. The game starts immediately and the first move belongs to the human player.

POST /games/with-bot

func (*Client) GetConfig

func (c *Client) GetConfig(ctx context.Context) (*ConfigResponse, error)

GetConfig invokes getConfig operation.

Returns feature flags the client needs before authentication, e.g. whether email/password registration is available.

GET /config

func (*Client) GetLeaderboard

func (c *Client) GetLeaderboard(ctx context.Context, params GetLeaderboardParams) (GetLeaderboardRes, error)

GetLeaderboard invokes getLeaderboard operation.

Returns the top players by current rating or total EXP who were active during the requested period. Results are cached for 5 minutes.

GET /leaderboard

func (*Client) GetPlayerAchievements

func (c *Client) GetPlayerAchievements(ctx context.Context) (GetPlayerAchievementsRes, error)

GetPlayerAchievements invokes getPlayerAchievements operation.

Returns the full list of achievements with their unlocked status for the currently authenticated player.

GET /player/achievements

func (*Client) GetPlayerStateUID

func (c *Client) GetPlayerStateUID(ctx context.Context, params GetPlayerStateUIDParams) (GetPlayerStateUIDRes, error)

GetPlayerStateUID invokes getPlayerStateUID operation.

Get user state.

GET /player/state/{uid}

func (*Client) GetPlayerStats

func (c *Client) GetPlayerStats(ctx context.Context) (GetPlayerStatsRes, error)

GetPlayerStats invokes getPlayerStats operation.

Returns lifetime aggregated statistics for the currently authenticated player: games played, wins/losses/draws, win rate, average word length, best word and favorite letter.

GET /player/stats

func (*Client) JoinGame

func (c *Client) JoinGame(ctx context.Context, params JoinGameParams) (JoinGameRes, error)

JoinGame invokes joinGame operation.

Adds the authenticated player to the specified waiting game. When the second player joins (quorum of 2 is reached) the game transitions to in_progress and the first move belongs to the player who created the game.

POST /games/{id}/join

func (*Client) LeaveGame

func (c *Client) LeaveGame(ctx context.Context, params LeaveGameParams) (LeaveGameRes, error)

LeaveGame invokes leaveGame operation.

Removes the player from a game in waiting status. If the game becomes empty, it is deleted. In-progress games cannot be left this way.

POST /games/{id}/leave

func (*Client) ListGames

func (c *Client) ListGames(ctx context.Context) (ListGamesRes, error)

ListGames invokes listGames operation.

Returns a snapshot of all currently active games.

GET /games

func (*Client) Logout

func (c *Client) Logout(ctx context.Context, request OptLogoutRequest) (LogoutRes, error)

Logout invokes logout operation.

Revoke the current refresh token.

POST /auth/logout

func (*Client) MatchmakingJoin

func (c *Client) MatchmakingJoin(ctx context.Context) (MatchmakingJoinRes, error)

MatchmakingJoin invokes matchmakingJoin operation.

Enqueues the player for quick matchmaking. When a human opponent with a close rating is found, a match_found event is published to the lobby channel; after a timeout the server starts a bot game.

POST /matchmaking/join

func (*Client) MatchmakingLeave

func (c *Client) MatchmakingLeave(ctx context.Context) (MatchmakingLeaveRes, error)

MatchmakingLeave invokes matchmakingLeave operation.

Idempotent — leaving without being queued is not an error.

POST /matchmaking/leave

func (*Client) MoveGame

func (c *Client) MoveGame(ctx context.Context, request *MoveRequest, params MoveGameParams) (MoveGameRes, error)

MoveGame invokes moveGame operation.

Places a new letter on the board and submits a word. If the word is valid, the player's score is updated and the turn passes to the opponent.

POST /games/{id}/move

func (*Client) Ping

func (c *Client) Ping(ctx context.Context, params PingParams) (PingRes, error)

Ping invokes ping operation.

POST not GET — mutates session TTL. Returns 204 with X-Server-Time header instead of a JSON body to minimize bandwidth on frequent pings (every ping_delay ms).

POST /session/ping

func (*Client) ProposeEndGame

func (c *Client) ProposeEndGame(ctx context.Context, params ProposeEndGameParams) (ProposeEndGameRes, error)

ProposeEndGame invokes proposeEndGame operation.

The current player proposes to end the game (e.g. no valid moves are available). The turn timer is paused until the opponent responds. Only the player whose turn it currently is may call this.

POST /games/{id}/propose-end

func (*Client) RefreshToken

func (c *Client) RefreshToken(ctx context.Context, request *RefreshRequest) (RefreshTokenRes, error)

RefreshToken invokes refreshToken operation.

Exchange a refresh token for a new access/refresh pair.

POST /auth/refresh

func (*Client) RejectEndGame

func (c *Client) RejectEndGame(ctx context.Context, params RejectEndGameParams) (RejectEndGameRes, error)

RejectEndGame invokes rejectEndGame operation.

The opponent rejects the end-game proposal. The game resumes with the remaining turn time (minimum 10 seconds). Only the non-proposing player may call this.

POST /games/{id}/reject-end

func (*Client) Signup

func (c *Client) Signup(ctx context.Context, request *SignupRequest) (SignupRes, error)

Signup invokes signup operation.

Sign-up request.

POST /signup

func (*Client) SkipGame

func (c *Client) SkipGame(ctx context.Context, params SkipGameParams) (SkipGameRes, error)

SkipGame invokes skipGame operation.

Ends the current turn without making a move. The turn passes to the opponent.

POST /games/{id}/skip

type ClientOption

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

ClientOption is client config option.

func WithClient

func WithClient(client ht.Client) ClientOption

WithClient specifies http client to use.

type ConfigResponse

type ConfigResponse struct {
	// Whether email/password registration is available.
	EmailSignupEnabled OptBool `json:"email_signup_enabled"`
}

Ref: #/components/schemas/ConfigResponse

func (*ConfigResponse) Decode

func (s *ConfigResponse) Decode(d *jx.Decoder) error

Decode decodes ConfigResponse from json.

func (*ConfigResponse) Encode

func (s *ConfigResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*ConfigResponse) GetEmailSignupEnabled

func (s *ConfigResponse) GetEmailSignupEnabled() OptBool

GetEmailSignupEnabled returns the value of EmailSignupEnabled.

func (*ConfigResponse) MarshalJSON

func (s *ConfigResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*ConfigResponse) SetEmailSignupEnabled

func (s *ConfigResponse) SetEmailSignupEnabled(val OptBool)

SetEmailSignupEnabled sets the value of EmailSignupEnabled.

func (*ConfigResponse) UnmarshalJSON

func (s *ConfigResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type CreateGameRes

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

type CreateGameResponse

type CreateGameResponse struct {
	Game OptGameSummary `json:"game"`
	// Centrifugo subscription JWT for the game channel.
	GameToken OptString `json:"game_token"`
}

Ref: #/components/schemas/CreateGameResponse

func (*CreateGameResponse) Decode

func (s *CreateGameResponse) Decode(d *jx.Decoder) error

Decode decodes CreateGameResponse from json.

func (*CreateGameResponse) Encode

func (s *CreateGameResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*CreateGameResponse) GetGame

func (s *CreateGameResponse) GetGame() OptGameSummary

GetGame returns the value of Game.

func (*CreateGameResponse) GetGameToken

func (s *CreateGameResponse) GetGameToken() OptString

GetGameToken returns the value of GameToken.

func (*CreateGameResponse) MarshalJSON

func (s *CreateGameResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateGameResponse) SetGame

func (s *CreateGameResponse) SetGame(val OptGameSummary)

SetGame sets the value of Game.

func (*CreateGameResponse) SetGameToken

func (s *CreateGameResponse) SetGameToken(val OptString)

SetGameToken sets the value of GameToken.

func (*CreateGameResponse) UnmarshalJSON

func (s *CreateGameResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CreateGameResponse) Validate

func (s *CreateGameResponse) Validate() error

type CreateGameWithBotConflict

type CreateGameWithBotConflict ErrorResponse

func (*CreateGameWithBotConflict) Decode

func (s *CreateGameWithBotConflict) Decode(d *jx.Decoder) error

Decode decodes CreateGameWithBotConflict from json.

func (*CreateGameWithBotConflict) Encode

func (s *CreateGameWithBotConflict) Encode(e *jx.Encoder)

Encode encodes CreateGameWithBotConflict as json.

func (*CreateGameWithBotConflict) MarshalJSON

func (s *CreateGameWithBotConflict) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateGameWithBotConflict) UnmarshalJSON

func (s *CreateGameWithBotConflict) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type CreateGameWithBotInternalServerError

type CreateGameWithBotInternalServerError ErrorResponse

func (*CreateGameWithBotInternalServerError) Decode

Decode decodes CreateGameWithBotInternalServerError from json.

func (*CreateGameWithBotInternalServerError) Encode

Encode encodes CreateGameWithBotInternalServerError as json.

func (*CreateGameWithBotInternalServerError) MarshalJSON

func (s *CreateGameWithBotInternalServerError) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateGameWithBotInternalServerError) UnmarshalJSON

func (s *CreateGameWithBotInternalServerError) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type CreateGameWithBotRes

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

type CreateGameWithBotUnauthorized

type CreateGameWithBotUnauthorized ErrorResponse

func (*CreateGameWithBotUnauthorized) Decode

Decode decodes CreateGameWithBotUnauthorized from json.

func (*CreateGameWithBotUnauthorized) Encode

Encode encodes CreateGameWithBotUnauthorized as json.

func (*CreateGameWithBotUnauthorized) MarshalJSON

func (s *CreateGameWithBotUnauthorized) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateGameWithBotUnauthorized) UnmarshalJSON

func (s *CreateGameWithBotUnauthorized) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type ErrorHandler

type ErrorHandler = ogenerrors.ErrorHandler

ErrorHandler is error handler.

type ErrorResponse

type ErrorResponse struct {
	// The HTTP response code.
	Status OptInt `json:"status"`
	// A human-readable explanation of the error.
	Message OptString `json:"message"`
	// Type of the error message.
	Type OptString `json:"type"`
}

Ref: #/components/schemas/ErrorResponse

func (*ErrorResponse) Decode

func (s *ErrorResponse) Decode(d *jx.Decoder) error

Decode decodes ErrorResponse from json.

func (*ErrorResponse) Encode

func (s *ErrorResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*ErrorResponse) GetMessage

func (s *ErrorResponse) GetMessage() OptString

GetMessage returns the value of Message.

func (*ErrorResponse) GetStatus

func (s *ErrorResponse) GetStatus() OptInt

GetStatus returns the value of Status.

func (*ErrorResponse) GetType

func (s *ErrorResponse) GetType() OptString

GetType returns the value of Type.

func (*ErrorResponse) MarshalJSON

func (s *ErrorResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*ErrorResponse) SetMessage

func (s *ErrorResponse) SetMessage(val OptString)

SetMessage sets the value of Message.

func (*ErrorResponse) SetStatus

func (s *ErrorResponse) SetStatus(val OptInt)

SetStatus sets the value of Status.

func (*ErrorResponse) SetType

func (s *ErrorResponse) SetType(val OptString)

SetType sets the value of Type.

func (*ErrorResponse) UnmarshalJSON

func (s *ErrorResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type GameStatus

type GameStatus string

Current state of the game. Ref: #/components/schemas/GameStatus

const (
	GameStatusWaiting    GameStatus = "waiting"
	GameStatusInProgress GameStatus = "in_progress"
	GameStatusFinished   GameStatus = "finished"
)

func (GameStatus) AllValues

func (GameStatus) AllValues() []GameStatus

AllValues returns all GameStatus values.

func (*GameStatus) Decode

func (s *GameStatus) Decode(d *jx.Decoder) error

Decode decodes GameStatus from json.

func (GameStatus) Encode

func (s GameStatus) Encode(e *jx.Encoder)

Encode encodes GameStatus as json.

func (GameStatus) MarshalJSON

func (s GameStatus) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (GameStatus) MarshalText

func (s GameStatus) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*GameStatus) UnmarshalJSON

func (s *GameStatus) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*GameStatus) UnmarshalText

func (s *GameStatus) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (GameStatus) Validate

func (s GameStatus) Validate() error

type GameSummary

type GameSummary struct {
	// Game ID.
	ID OptUUID `json:"id"`
	// IDs of players participating in the game.
	PlayerIds []uuid.UUID `json:"player_ids"`
	// Players with EXP info.
	Players []LobbyPlayer `json:"players"`
	Status  OptGameStatus `json:"status"`
	// When the game was started (Unix timestamp in milliseconds).
	StartedAt OptInt64 `json:"started_at"`
}

Ref: #/components/schemas/GameSummary

func (*GameSummary) Decode

func (s *GameSummary) Decode(d *jx.Decoder) error

Decode decodes GameSummary from json.

func (*GameSummary) Encode

func (s *GameSummary) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*GameSummary) GetID

func (s *GameSummary) GetID() OptUUID

GetID returns the value of ID.

func (*GameSummary) GetPlayerIds

func (s *GameSummary) GetPlayerIds() []uuid.UUID

GetPlayerIds returns the value of PlayerIds.

func (*GameSummary) GetPlayers

func (s *GameSummary) GetPlayers() []LobbyPlayer

GetPlayers returns the value of Players.

func (*GameSummary) GetStartedAt

func (s *GameSummary) GetStartedAt() OptInt64

GetStartedAt returns the value of StartedAt.

func (*GameSummary) GetStatus

func (s *GameSummary) GetStatus() OptGameStatus

GetStatus returns the value of Status.

func (*GameSummary) MarshalJSON

func (s *GameSummary) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*GameSummary) SetID

func (s *GameSummary) SetID(val OptUUID)

SetID sets the value of ID.

func (*GameSummary) SetPlayerIds

func (s *GameSummary) SetPlayerIds(val []uuid.UUID)

SetPlayerIds sets the value of PlayerIds.

func (*GameSummary) SetPlayers

func (s *GameSummary) SetPlayers(val []LobbyPlayer)

SetPlayers sets the value of Players.

func (*GameSummary) SetStartedAt

func (s *GameSummary) SetStartedAt(val OptInt64)

SetStartedAt sets the value of StartedAt.

func (*GameSummary) SetStatus

func (s *GameSummary) SetStatus(val OptGameStatus)

SetStatus sets the value of Status.

func (*GameSummary) UnmarshalJSON

func (s *GameSummary) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*GameSummary) Validate

func (s *GameSummary) Validate() error

type GetLeaderboardBadRequest

type GetLeaderboardBadRequest ErrorResponse

func (*GetLeaderboardBadRequest) Decode

func (s *GetLeaderboardBadRequest) Decode(d *jx.Decoder) error

Decode decodes GetLeaderboardBadRequest from json.

func (*GetLeaderboardBadRequest) Encode

func (s *GetLeaderboardBadRequest) Encode(e *jx.Encoder)

Encode encodes GetLeaderboardBadRequest as json.

func (*GetLeaderboardBadRequest) MarshalJSON

func (s *GetLeaderboardBadRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*GetLeaderboardBadRequest) UnmarshalJSON

func (s *GetLeaderboardBadRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type GetLeaderboardInternalServerError

type GetLeaderboardInternalServerError ErrorResponse

func (*GetLeaderboardInternalServerError) Decode

Decode decodes GetLeaderboardInternalServerError from json.

func (*GetLeaderboardInternalServerError) Encode

Encode encodes GetLeaderboardInternalServerError as json.

func (*GetLeaderboardInternalServerError) MarshalJSON

func (s *GetLeaderboardInternalServerError) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*GetLeaderboardInternalServerError) UnmarshalJSON

func (s *GetLeaderboardInternalServerError) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type GetLeaderboardParams

type GetLeaderboardParams struct {
	// Leaderboard period.
	Period GetLeaderboardPeriod
	// Sort field.
	Sort OptGetLeaderboardSort `json:",omitempty,omitzero"`
	// Maximum number of entries to return.
	Limit OptInt `json:",omitempty,omitzero"`
}

GetLeaderboardParams is parameters of getLeaderboard operation.

type GetLeaderboardPeriod

type GetLeaderboardPeriod string
const (
	GetLeaderboardPeriodWeek  GetLeaderboardPeriod = "week"
	GetLeaderboardPeriodMonth GetLeaderboardPeriod = "month"
)

func (GetLeaderboardPeriod) AllValues

AllValues returns all GetLeaderboardPeriod values.

func (GetLeaderboardPeriod) MarshalText

func (s GetLeaderboardPeriod) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*GetLeaderboardPeriod) UnmarshalText

func (s *GetLeaderboardPeriod) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (GetLeaderboardPeriod) Validate

func (s GetLeaderboardPeriod) Validate() error

type GetLeaderboardRes

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

type GetLeaderboardSort

type GetLeaderboardSort string
const (
	GetLeaderboardSortRating GetLeaderboardSort = "rating"
	GetLeaderboardSortExp    GetLeaderboardSort = "exp"
)

func (GetLeaderboardSort) AllValues

func (GetLeaderboardSort) AllValues() []GetLeaderboardSort

AllValues returns all GetLeaderboardSort values.

func (GetLeaderboardSort) MarshalText

func (s GetLeaderboardSort) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*GetLeaderboardSort) UnmarshalText

func (s *GetLeaderboardSort) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (GetLeaderboardSort) Validate

func (s GetLeaderboardSort) Validate() error

type GetPlayerAchievementsInternalServerError

type GetPlayerAchievementsInternalServerError ErrorResponse

func (*GetPlayerAchievementsInternalServerError) Decode

Decode decodes GetPlayerAchievementsInternalServerError from json.

func (*GetPlayerAchievementsInternalServerError) Encode

Encode encodes GetPlayerAchievementsInternalServerError as json.

func (*GetPlayerAchievementsInternalServerError) MarshalJSON

func (s *GetPlayerAchievementsInternalServerError) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*GetPlayerAchievementsInternalServerError) UnmarshalJSON

func (s *GetPlayerAchievementsInternalServerError) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type GetPlayerAchievementsRes

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

type GetPlayerAchievementsUnauthorized

type GetPlayerAchievementsUnauthorized ErrorResponse

func (*GetPlayerAchievementsUnauthorized) Decode

Decode decodes GetPlayerAchievementsUnauthorized from json.

func (*GetPlayerAchievementsUnauthorized) Encode

Encode encodes GetPlayerAchievementsUnauthorized as json.

func (*GetPlayerAchievementsUnauthorized) MarshalJSON

func (s *GetPlayerAchievementsUnauthorized) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*GetPlayerAchievementsUnauthorized) UnmarshalJSON

func (s *GetPlayerAchievementsUnauthorized) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type GetPlayerStateUIDBadRequest

type GetPlayerStateUIDBadRequest ErrorResponse

func (*GetPlayerStateUIDBadRequest) Decode

Decode decodes GetPlayerStateUIDBadRequest from json.

func (*GetPlayerStateUIDBadRequest) Encode

func (s *GetPlayerStateUIDBadRequest) Encode(e *jx.Encoder)

Encode encodes GetPlayerStateUIDBadRequest as json.

func (*GetPlayerStateUIDBadRequest) MarshalJSON

func (s *GetPlayerStateUIDBadRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*GetPlayerStateUIDBadRequest) UnmarshalJSON

func (s *GetPlayerStateUIDBadRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type GetPlayerStateUIDForbidden

type GetPlayerStateUIDForbidden ErrorResponse

func (*GetPlayerStateUIDForbidden) Decode

Decode decodes GetPlayerStateUIDForbidden from json.

func (*GetPlayerStateUIDForbidden) Encode

func (s *GetPlayerStateUIDForbidden) Encode(e *jx.Encoder)

Encode encodes GetPlayerStateUIDForbidden as json.

func (*GetPlayerStateUIDForbidden) MarshalJSON

func (s *GetPlayerStateUIDForbidden) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*GetPlayerStateUIDForbidden) UnmarshalJSON

func (s *GetPlayerStateUIDForbidden) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type GetPlayerStateUIDParams

type GetPlayerStateUIDParams struct {
	// Player ID.
	UID uuid.UUID
}

GetPlayerStateUIDParams is parameters of getPlayerStateUID operation.

type GetPlayerStateUIDRes

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

type GetPlayerStateUIDUnauthorized

type GetPlayerStateUIDUnauthorized ErrorResponse

func (*GetPlayerStateUIDUnauthorized) Decode

Decode decodes GetPlayerStateUIDUnauthorized from json.

func (*GetPlayerStateUIDUnauthorized) Encode

Encode encodes GetPlayerStateUIDUnauthorized as json.

func (*GetPlayerStateUIDUnauthorized) MarshalJSON

func (s *GetPlayerStateUIDUnauthorized) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*GetPlayerStateUIDUnauthorized) UnmarshalJSON

func (s *GetPlayerStateUIDUnauthorized) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type GetPlayerStatsInternalServerError

type GetPlayerStatsInternalServerError ErrorResponse

func (*GetPlayerStatsInternalServerError) Decode

Decode decodes GetPlayerStatsInternalServerError from json.

func (*GetPlayerStatsInternalServerError) Encode

Encode encodes GetPlayerStatsInternalServerError as json.

func (*GetPlayerStatsInternalServerError) MarshalJSON

func (s *GetPlayerStatsInternalServerError) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*GetPlayerStatsInternalServerError) UnmarshalJSON

func (s *GetPlayerStatsInternalServerError) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type GetPlayerStatsRes

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

type GetPlayerStatsUnauthorized

type GetPlayerStatsUnauthorized ErrorResponse

func (*GetPlayerStatsUnauthorized) Decode

Decode decodes GetPlayerStatsUnauthorized from json.

func (*GetPlayerStatsUnauthorized) Encode

func (s *GetPlayerStatsUnauthorized) Encode(e *jx.Encoder)

Encode encodes GetPlayerStatsUnauthorized as json.

func (*GetPlayerStatsUnauthorized) MarshalJSON

func (s *GetPlayerStatsUnauthorized) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*GetPlayerStatsUnauthorized) UnmarshalJSON

func (s *GetPlayerStatsUnauthorized) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type Handler

type Handler interface {
	// AcceptEndGame implements acceptEndGame operation.
	//
	// The opponent accepts the end-game proposal. The game ends immediately with the current scores. Only
	// the non-proposing player may call this.
	//
	// POST /games/{id}/accept-end
	AcceptEndGame(ctx context.Context, params AcceptEndGameParams) (AcceptEndGameRes, error)
	// Auth implements auth operation.
	//
	// Auth request.
	//
	// POST /auth
	Auth(ctx context.Context, req *AuthRequest) (AuthRes, error)
	// AuthTelegram implements authTelegram operation.
	//
	// Validates the signed init data produced by the Telegram WebView against the bot token, then logs in
	// an existing user or creates a new one linked to their Telegram account.
	//
	// POST /auth/telegram
	AuthTelegram(ctx context.Context, req *TelegramAuthRequest) (AuthTelegramRes, error)
	// CreateGame implements createGame operation.
	//
	// Create a new game.
	//
	// POST /games
	CreateGame(ctx context.Context) (CreateGameRes, error)
	// CreateGameWithBot implements createGameWithBot operation.
	//
	// Creates a new game where the authenticated player plays against a server-side bot. The game starts
	// immediately and the first move belongs to the human player.
	//
	// POST /games/with-bot
	CreateGameWithBot(ctx context.Context) (CreateGameWithBotRes, error)
	// GetConfig implements getConfig operation.
	//
	// Returns feature flags the client needs before authentication, e.g. whether email/password
	// registration is available.
	//
	// GET /config
	GetConfig(ctx context.Context) (*ConfigResponse, error)
	// GetLeaderboard implements getLeaderboard operation.
	//
	// Returns the top players by current rating or total EXP who were active during the requested period.
	// Results are cached for 5 minutes.
	//
	// GET /leaderboard
	GetLeaderboard(ctx context.Context, params GetLeaderboardParams) (GetLeaderboardRes, error)
	// GetPlayerAchievements implements getPlayerAchievements operation.
	//
	// Returns the full list of achievements with their unlocked status for the currently authenticated
	// player.
	//
	// GET /player/achievements
	GetPlayerAchievements(ctx context.Context) (GetPlayerAchievementsRes, error)
	// GetPlayerStateUID implements getPlayerStateUID operation.
	//
	// Get user state.
	//
	// GET /player/state/{uid}
	GetPlayerStateUID(ctx context.Context, params GetPlayerStateUIDParams) (GetPlayerStateUIDRes, error)
	// GetPlayerStats implements getPlayerStats operation.
	//
	// Returns lifetime aggregated statistics for the currently authenticated player: games played,
	// wins/losses/draws, win rate, average word length, best word and favorite letter.
	//
	// GET /player/stats
	GetPlayerStats(ctx context.Context) (GetPlayerStatsRes, error)
	// JoinGame implements joinGame operation.
	//
	// Adds the authenticated player to the specified waiting game. When the second player joins (quorum of
	// 2 is reached) the game transitions to in_progress and the first move belongs to the player who
	// created the game.
	//
	// POST /games/{id}/join
	JoinGame(ctx context.Context, params JoinGameParams) (JoinGameRes, error)
	// LeaveGame implements leaveGame operation.
	//
	// Removes the player from a game in waiting status. If the game becomes empty, it is deleted.
	// In-progress games cannot be left this way.
	//
	// POST /games/{id}/leave
	LeaveGame(ctx context.Context, params LeaveGameParams) (LeaveGameRes, error)
	// ListGames implements listGames operation.
	//
	// Returns a snapshot of all currently active games.
	//
	// GET /games
	ListGames(ctx context.Context) (ListGamesRes, error)
	// Logout implements logout operation.
	//
	// Revoke the current refresh token.
	//
	// POST /auth/logout
	Logout(ctx context.Context, req OptLogoutRequest) (LogoutRes, error)
	// MatchmakingJoin implements matchmakingJoin operation.
	//
	// Enqueues the player for quick matchmaking. When a human opponent with a close rating is found, a
	// match_found event is published to the lobby channel; after a timeout the server starts a bot game.
	//
	// POST /matchmaking/join
	MatchmakingJoin(ctx context.Context) (MatchmakingJoinRes, error)
	// MatchmakingLeave implements matchmakingLeave operation.
	//
	// Idempotent — leaving without being queued is not an error.
	//
	// POST /matchmaking/leave
	MatchmakingLeave(ctx context.Context) (MatchmakingLeaveRes, error)
	// MoveGame implements moveGame operation.
	//
	// Places a new letter on the board and submits a word. If the word is valid, the player's score is
	// updated and the turn passes to the opponent.
	//
	// POST /games/{id}/move
	MoveGame(ctx context.Context, req *MoveRequest, params MoveGameParams) (MoveGameRes, error)
	// Ping implements ping operation.
	//
	// POST not GET — mutates session TTL. Returns 204 with X-Server-Time header instead of a JSON body
	// to minimize bandwidth on frequent pings (every ping_delay ms).
	//
	// POST /session/ping
	Ping(ctx context.Context, params PingParams) (PingRes, error)
	// ProposeEndGame implements proposeEndGame operation.
	//
	// The current player proposes to end the game (e.g. no valid moves are available). The turn timer is
	// paused until the opponent responds. Only the player whose turn it currently is may call this.
	//
	// POST /games/{id}/propose-end
	ProposeEndGame(ctx context.Context, params ProposeEndGameParams) (ProposeEndGameRes, error)
	// RefreshToken implements refreshToken operation.
	//
	// Exchange a refresh token for a new access/refresh pair.
	//
	// POST /auth/refresh
	RefreshToken(ctx context.Context, req *RefreshRequest) (RefreshTokenRes, error)
	// RejectEndGame implements rejectEndGame operation.
	//
	// The opponent rejects the end-game proposal. The game resumes with the remaining turn time (minimum
	// 10 seconds). Only the non-proposing player may call this.
	//
	// POST /games/{id}/reject-end
	RejectEndGame(ctx context.Context, params RejectEndGameParams) (RejectEndGameRes, error)
	// Signup implements signup operation.
	//
	// Sign-up request.
	//
	// POST /signup
	Signup(ctx context.Context, req *SignupRequest) (SignupRes, error)
	// SkipGame implements skipGame operation.
	//
	// Ends the current turn without making a move. The turn passes to the opponent.
	//
	// POST /games/{id}/skip
	SkipGame(ctx context.Context, params SkipGameParams) (SkipGameRes, error)
}

Handler handles operations described by OpenAPI v3 specification.

type Invoker

type Invoker interface {
	// AcceptEndGame invokes acceptEndGame operation.
	//
	// The opponent accepts the end-game proposal. The game ends immediately with the current scores. Only
	// the non-proposing player may call this.
	//
	// POST /games/{id}/accept-end
	AcceptEndGame(ctx context.Context, params AcceptEndGameParams) (AcceptEndGameRes, error)
	// Auth invokes auth operation.
	//
	// Auth request.
	//
	// POST /auth
	Auth(ctx context.Context, request *AuthRequest) (AuthRes, error)
	// AuthTelegram invokes authTelegram operation.
	//
	// Validates the signed init data produced by the Telegram WebView against the bot token, then logs in
	// an existing user or creates a new one linked to their Telegram account.
	//
	// POST /auth/telegram
	AuthTelegram(ctx context.Context, request *TelegramAuthRequest) (AuthTelegramRes, error)
	// CreateGame invokes createGame operation.
	//
	// Create a new game.
	//
	// POST /games
	CreateGame(ctx context.Context) (CreateGameRes, error)
	// CreateGameWithBot invokes createGameWithBot operation.
	//
	// Creates a new game where the authenticated player plays against a server-side bot. The game starts
	// immediately and the first move belongs to the human player.
	//
	// POST /games/with-bot
	CreateGameWithBot(ctx context.Context) (CreateGameWithBotRes, error)
	// GetConfig invokes getConfig operation.
	//
	// Returns feature flags the client needs before authentication, e.g. whether email/password
	// registration is available.
	//
	// GET /config
	GetConfig(ctx context.Context) (*ConfigResponse, error)
	// GetLeaderboard invokes getLeaderboard operation.
	//
	// Returns the top players by current rating or total EXP who were active during the requested period.
	// Results are cached for 5 minutes.
	//
	// GET /leaderboard
	GetLeaderboard(ctx context.Context, params GetLeaderboardParams) (GetLeaderboardRes, error)
	// GetPlayerAchievements invokes getPlayerAchievements operation.
	//
	// Returns the full list of achievements with their unlocked status for the currently authenticated
	// player.
	//
	// GET /player/achievements
	GetPlayerAchievements(ctx context.Context) (GetPlayerAchievementsRes, error)
	// GetPlayerStateUID invokes getPlayerStateUID operation.
	//
	// Get user state.
	//
	// GET /player/state/{uid}
	GetPlayerStateUID(ctx context.Context, params GetPlayerStateUIDParams) (GetPlayerStateUIDRes, error)
	// GetPlayerStats invokes getPlayerStats operation.
	//
	// Returns lifetime aggregated statistics for the currently authenticated player: games played,
	// wins/losses/draws, win rate, average word length, best word and favorite letter.
	//
	// GET /player/stats
	GetPlayerStats(ctx context.Context) (GetPlayerStatsRes, error)
	// JoinGame invokes joinGame operation.
	//
	// Adds the authenticated player to the specified waiting game. When the second player joins (quorum of
	// 2 is reached) the game transitions to in_progress and the first move belongs to the player who
	// created the game.
	//
	// POST /games/{id}/join
	JoinGame(ctx context.Context, params JoinGameParams) (JoinGameRes, error)
	// LeaveGame invokes leaveGame operation.
	//
	// Removes the player from a game in waiting status. If the game becomes empty, it is deleted.
	// In-progress games cannot be left this way.
	//
	// POST /games/{id}/leave
	LeaveGame(ctx context.Context, params LeaveGameParams) (LeaveGameRes, error)
	// ListGames invokes listGames operation.
	//
	// Returns a snapshot of all currently active games.
	//
	// GET /games
	ListGames(ctx context.Context) (ListGamesRes, error)
	// Logout invokes logout operation.
	//
	// Revoke the current refresh token.
	//
	// POST /auth/logout
	Logout(ctx context.Context, request OptLogoutRequest) (LogoutRes, error)
	// MatchmakingJoin invokes matchmakingJoin operation.
	//
	// Enqueues the player for quick matchmaking. When a human opponent with a close rating is found, a
	// match_found event is published to the lobby channel; after a timeout the server starts a bot game.
	//
	// POST /matchmaking/join
	MatchmakingJoin(ctx context.Context) (MatchmakingJoinRes, error)
	// MatchmakingLeave invokes matchmakingLeave operation.
	//
	// Idempotent — leaving without being queued is not an error.
	//
	// POST /matchmaking/leave
	MatchmakingLeave(ctx context.Context) (MatchmakingLeaveRes, error)
	// MoveGame invokes moveGame operation.
	//
	// Places a new letter on the board and submits a word. If the word is valid, the player's score is
	// updated and the turn passes to the opponent.
	//
	// POST /games/{id}/move
	MoveGame(ctx context.Context, request *MoveRequest, params MoveGameParams) (MoveGameRes, error)
	// Ping invokes ping operation.
	//
	// POST not GET — mutates session TTL. Returns 204 with X-Server-Time header instead of a JSON body
	// to minimize bandwidth on frequent pings (every ping_delay ms).
	//
	// POST /session/ping
	Ping(ctx context.Context, params PingParams) (PingRes, error)
	// ProposeEndGame invokes proposeEndGame operation.
	//
	// The current player proposes to end the game (e.g. no valid moves are available). The turn timer is
	// paused until the opponent responds. Only the player whose turn it currently is may call this.
	//
	// POST /games/{id}/propose-end
	ProposeEndGame(ctx context.Context, params ProposeEndGameParams) (ProposeEndGameRes, error)
	// RefreshToken invokes refreshToken operation.
	//
	// Exchange a refresh token for a new access/refresh pair.
	//
	// POST /auth/refresh
	RefreshToken(ctx context.Context, request *RefreshRequest) (RefreshTokenRes, error)
	// RejectEndGame invokes rejectEndGame operation.
	//
	// The opponent rejects the end-game proposal. The game resumes with the remaining turn time (minimum
	// 10 seconds). Only the non-proposing player may call this.
	//
	// POST /games/{id}/reject-end
	RejectEndGame(ctx context.Context, params RejectEndGameParams) (RejectEndGameRes, error)
	// Signup invokes signup operation.
	//
	// Sign-up request.
	//
	// POST /signup
	Signup(ctx context.Context, request *SignupRequest) (SignupRes, error)
	// SkipGame invokes skipGame operation.
	//
	// Ends the current turn without making a move. The turn passes to the opponent.
	//
	// POST /games/{id}/skip
	SkipGame(ctx context.Context, params SkipGameParams) (SkipGameRes, error)
}

Invoker invokes operations described by OpenAPI v3 specification.

type JoinGameConflict

type JoinGameConflict ErrorResponse

func (*JoinGameConflict) Decode

func (s *JoinGameConflict) Decode(d *jx.Decoder) error

Decode decodes JoinGameConflict from json.

func (*JoinGameConflict) Encode

func (s *JoinGameConflict) Encode(e *jx.Encoder)

Encode encodes JoinGameConflict as json.

func (*JoinGameConflict) MarshalJSON

func (s *JoinGameConflict) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*JoinGameConflict) UnmarshalJSON

func (s *JoinGameConflict) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type JoinGameInternalServerError

type JoinGameInternalServerError ErrorResponse

func (*JoinGameInternalServerError) Decode

Decode decodes JoinGameInternalServerError from json.

func (*JoinGameInternalServerError) Encode

func (s *JoinGameInternalServerError) Encode(e *jx.Encoder)

Encode encodes JoinGameInternalServerError as json.

func (*JoinGameInternalServerError) MarshalJSON

func (s *JoinGameInternalServerError) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*JoinGameInternalServerError) UnmarshalJSON

func (s *JoinGameInternalServerError) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type JoinGameNotFound

type JoinGameNotFound ErrorResponse

func (*JoinGameNotFound) Decode

func (s *JoinGameNotFound) Decode(d *jx.Decoder) error

Decode decodes JoinGameNotFound from json.

func (*JoinGameNotFound) Encode

func (s *JoinGameNotFound) Encode(e *jx.Encoder)

Encode encodes JoinGameNotFound as json.

func (*JoinGameNotFound) MarshalJSON

func (s *JoinGameNotFound) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*JoinGameNotFound) UnmarshalJSON

func (s *JoinGameNotFound) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type JoinGameParams

type JoinGameParams struct {
	// ID of the game to join.
	ID uuid.UUID
}

JoinGameParams is parameters of joinGame operation.

type JoinGameRes

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

type JoinGameResponse

type JoinGameResponse struct {
	Game OptGameSummary `json:"game"`
	// Centrifugo subscription JWT for the game channel.
	GameToken OptString `json:"game_token"`
	// Initial 5x5 board state. Each row is an array of 5 single-character strings (empty string means
	// empty cell). Included so the joining player can render the board immediately without waiting for the
	// Centrifugo game_state event.
	Board [][]string `json:"board"`
	// ID of the player whose turn it is first (the game creator).
	CurrentTurnUID OptString `json:"current_turn_uid"`
}

Ref: #/components/schemas/JoinGameResponse

func (*JoinGameResponse) Decode

func (s *JoinGameResponse) Decode(d *jx.Decoder) error

Decode decodes JoinGameResponse from json.

func (*JoinGameResponse) Encode

func (s *JoinGameResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*JoinGameResponse) GetBoard

func (s *JoinGameResponse) GetBoard() [][]string

GetBoard returns the value of Board.

func (*JoinGameResponse) GetCurrentTurnUID

func (s *JoinGameResponse) GetCurrentTurnUID() OptString

GetCurrentTurnUID returns the value of CurrentTurnUID.

func (*JoinGameResponse) GetGame

func (s *JoinGameResponse) GetGame() OptGameSummary

GetGame returns the value of Game.

func (*JoinGameResponse) GetGameToken

func (s *JoinGameResponse) GetGameToken() OptString

GetGameToken returns the value of GameToken.

func (*JoinGameResponse) MarshalJSON

func (s *JoinGameResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*JoinGameResponse) SetBoard

func (s *JoinGameResponse) SetBoard(val [][]string)

SetBoard sets the value of Board.

func (*JoinGameResponse) SetCurrentTurnUID

func (s *JoinGameResponse) SetCurrentTurnUID(val OptString)

SetCurrentTurnUID sets the value of CurrentTurnUID.

func (*JoinGameResponse) SetGame

func (s *JoinGameResponse) SetGame(val OptGameSummary)

SetGame sets the value of Game.

func (*JoinGameResponse) SetGameToken

func (s *JoinGameResponse) SetGameToken(val OptString)

SetGameToken sets the value of GameToken.

func (*JoinGameResponse) UnmarshalJSON

func (s *JoinGameResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*JoinGameResponse) Validate

func (s *JoinGameResponse) Validate() error

type JoinGameUnauthorized

type JoinGameUnauthorized ErrorResponse

func (*JoinGameUnauthorized) Decode

func (s *JoinGameUnauthorized) Decode(d *jx.Decoder) error

Decode decodes JoinGameUnauthorized from json.

func (*JoinGameUnauthorized) Encode

func (s *JoinGameUnauthorized) Encode(e *jx.Encoder)

Encode encodes JoinGameUnauthorized as json.

func (*JoinGameUnauthorized) MarshalJSON

func (s *JoinGameUnauthorized) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*JoinGameUnauthorized) UnmarshalJSON

func (s *JoinGameUnauthorized) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type Labeler

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

Labeler is used to allow adding custom attributes to the server request metrics.

func LabelerFromContext

func LabelerFromContext(ctx context.Context) (*Labeler, bool)

LabelerFromContext retrieves the Labeler from the provided context, if present.

If no Labeler was found in the provided context a new, empty Labeler is returned and the second return value is false. In this case it is safe to use the Labeler but any attributes added to it will not be used.

func (*Labeler) Add

func (l *Labeler) Add(attrs ...attribute.KeyValue)

Add attributes to the Labeler.

func (*Labeler) AttributeSet

func (l *Labeler) AttributeSet() attribute.Set

AttributeSet returns the attributes added to the Labeler as an attribute.Set.

type LeaderboardEntry

type LeaderboardEntry struct {
	// Position in the leaderboard (1-based).
	Rank OptInt `json:"rank"`
	// Player's ID.
	UID OptUUID `json:"uid"`
	// Player's generated nickname.
	Nickname OptString `json:"nickname"`
	// Player's ELO rating.
	Rating OptInt64 `json:"rating"`
	// Player's total EXP.
	Exp OptInt64 `json:"exp"`
}

Ref: #/components/schemas/LeaderboardEntry

func (*LeaderboardEntry) Decode

func (s *LeaderboardEntry) Decode(d *jx.Decoder) error

Decode decodes LeaderboardEntry from json.

func (*LeaderboardEntry) Encode

func (s *LeaderboardEntry) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*LeaderboardEntry) GetExp

func (s *LeaderboardEntry) GetExp() OptInt64

GetExp returns the value of Exp.

func (*LeaderboardEntry) GetNickname

func (s *LeaderboardEntry) GetNickname() OptString

GetNickname returns the value of Nickname.

func (*LeaderboardEntry) GetRank

func (s *LeaderboardEntry) GetRank() OptInt

GetRank returns the value of Rank.

func (*LeaderboardEntry) GetRating

func (s *LeaderboardEntry) GetRating() OptInt64

GetRating returns the value of Rating.

func (*LeaderboardEntry) GetUID

func (s *LeaderboardEntry) GetUID() OptUUID

GetUID returns the value of UID.

func (*LeaderboardEntry) MarshalJSON

func (s *LeaderboardEntry) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*LeaderboardEntry) SetExp

func (s *LeaderboardEntry) SetExp(val OptInt64)

SetExp sets the value of Exp.

func (*LeaderboardEntry) SetNickname

func (s *LeaderboardEntry) SetNickname(val OptString)

SetNickname sets the value of Nickname.

func (*LeaderboardEntry) SetRank

func (s *LeaderboardEntry) SetRank(val OptInt)

SetRank sets the value of Rank.

func (*LeaderboardEntry) SetRating

func (s *LeaderboardEntry) SetRating(val OptInt64)

SetRating sets the value of Rating.

func (*LeaderboardEntry) SetUID

func (s *LeaderboardEntry) SetUID(val OptUUID)

SetUID sets the value of UID.

func (*LeaderboardEntry) UnmarshalJSON

func (s *LeaderboardEntry) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type LeaderboardResponse

type LeaderboardResponse struct {
	// Leaderboard period.
	Period OptLeaderboardResponsePeriod `json:"period"`
	// Sort field.
	Sort OptLeaderboardResponseSort `json:"sort"`
	// Unix timestamp in milliseconds when the leaderboard was generated.
	GeneratedAt OptInt64 `json:"generated_at"`
	// Leaderboard entries ordered by rank.
	Players []LeaderboardEntry `json:"players"`
}

Ref: #/components/schemas/LeaderboardResponse

func (*LeaderboardResponse) Decode

func (s *LeaderboardResponse) Decode(d *jx.Decoder) error

Decode decodes LeaderboardResponse from json.

func (*LeaderboardResponse) Encode

func (s *LeaderboardResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*LeaderboardResponse) GetGeneratedAt

func (s *LeaderboardResponse) GetGeneratedAt() OptInt64

GetGeneratedAt returns the value of GeneratedAt.

func (*LeaderboardResponse) GetPeriod

GetPeriod returns the value of Period.

func (*LeaderboardResponse) GetPlayers

func (s *LeaderboardResponse) GetPlayers() []LeaderboardEntry

GetPlayers returns the value of Players.

func (*LeaderboardResponse) GetSort

GetSort returns the value of Sort.

func (*LeaderboardResponse) MarshalJSON

func (s *LeaderboardResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*LeaderboardResponse) SetGeneratedAt

func (s *LeaderboardResponse) SetGeneratedAt(val OptInt64)

SetGeneratedAt sets the value of GeneratedAt.

func (*LeaderboardResponse) SetPeriod

SetPeriod sets the value of Period.

func (*LeaderboardResponse) SetPlayers

func (s *LeaderboardResponse) SetPlayers(val []LeaderboardEntry)

SetPlayers sets the value of Players.

func (*LeaderboardResponse) SetSort

SetSort sets the value of Sort.

func (*LeaderboardResponse) UnmarshalJSON

func (s *LeaderboardResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*LeaderboardResponse) Validate

func (s *LeaderboardResponse) Validate() error

type LeaderboardResponsePeriod

type LeaderboardResponsePeriod string

Leaderboard period.

const (
	LeaderboardResponsePeriodWeek  LeaderboardResponsePeriod = "week"
	LeaderboardResponsePeriodMonth LeaderboardResponsePeriod = "month"
)

func (LeaderboardResponsePeriod) AllValues

AllValues returns all LeaderboardResponsePeriod values.

func (*LeaderboardResponsePeriod) Decode

func (s *LeaderboardResponsePeriod) Decode(d *jx.Decoder) error

Decode decodes LeaderboardResponsePeriod from json.

func (LeaderboardResponsePeriod) Encode

func (s LeaderboardResponsePeriod) Encode(e *jx.Encoder)

Encode encodes LeaderboardResponsePeriod as json.

func (LeaderboardResponsePeriod) MarshalJSON

func (s LeaderboardResponsePeriod) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (LeaderboardResponsePeriod) MarshalText

func (s LeaderboardResponsePeriod) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*LeaderboardResponsePeriod) UnmarshalJSON

func (s *LeaderboardResponsePeriod) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*LeaderboardResponsePeriod) UnmarshalText

func (s *LeaderboardResponsePeriod) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (LeaderboardResponsePeriod) Validate

func (s LeaderboardResponsePeriod) Validate() error

type LeaderboardResponseSort

type LeaderboardResponseSort string

Sort field.

const (
	LeaderboardResponseSortRating LeaderboardResponseSort = "rating"
	LeaderboardResponseSortExp    LeaderboardResponseSort = "exp"
)

func (LeaderboardResponseSort) AllValues

AllValues returns all LeaderboardResponseSort values.

func (*LeaderboardResponseSort) Decode

func (s *LeaderboardResponseSort) Decode(d *jx.Decoder) error

Decode decodes LeaderboardResponseSort from json.

func (LeaderboardResponseSort) Encode

func (s LeaderboardResponseSort) Encode(e *jx.Encoder)

Encode encodes LeaderboardResponseSort as json.

func (LeaderboardResponseSort) MarshalJSON

func (s LeaderboardResponseSort) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (LeaderboardResponseSort) MarshalText

func (s LeaderboardResponseSort) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*LeaderboardResponseSort) UnmarshalJSON

func (s *LeaderboardResponseSort) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*LeaderboardResponseSort) UnmarshalText

func (s *LeaderboardResponseSort) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (LeaderboardResponseSort) Validate

func (s LeaderboardResponseSort) Validate() error

type LeaveGameConflict

type LeaveGameConflict ErrorResponse

func (*LeaveGameConflict) Decode

func (s *LeaveGameConflict) Decode(d *jx.Decoder) error

Decode decodes LeaveGameConflict from json.

func (*LeaveGameConflict) Encode

func (s *LeaveGameConflict) Encode(e *jx.Encoder)

Encode encodes LeaveGameConflict as json.

func (*LeaveGameConflict) MarshalJSON

func (s *LeaveGameConflict) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*LeaveGameConflict) UnmarshalJSON

func (s *LeaveGameConflict) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type LeaveGameForbidden

type LeaveGameForbidden ErrorResponse

func (*LeaveGameForbidden) Decode

func (s *LeaveGameForbidden) Decode(d *jx.Decoder) error

Decode decodes LeaveGameForbidden from json.

func (*LeaveGameForbidden) Encode

func (s *LeaveGameForbidden) Encode(e *jx.Encoder)

Encode encodes LeaveGameForbidden as json.

func (*LeaveGameForbidden) MarshalJSON

func (s *LeaveGameForbidden) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*LeaveGameForbidden) UnmarshalJSON

func (s *LeaveGameForbidden) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type LeaveGameNoContent

type LeaveGameNoContent struct{}

LeaveGameNoContent is response for LeaveGame operation.

type LeaveGameNotFound

type LeaveGameNotFound ErrorResponse

func (*LeaveGameNotFound) Decode

func (s *LeaveGameNotFound) Decode(d *jx.Decoder) error

Decode decodes LeaveGameNotFound from json.

func (*LeaveGameNotFound) Encode

func (s *LeaveGameNotFound) Encode(e *jx.Encoder)

Encode encodes LeaveGameNotFound as json.

func (*LeaveGameNotFound) MarshalJSON

func (s *LeaveGameNotFound) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*LeaveGameNotFound) UnmarshalJSON

func (s *LeaveGameNotFound) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type LeaveGameParams

type LeaveGameParams struct {
	// ID of the game.
	ID uuid.UUID
}

LeaveGameParams is parameters of leaveGame operation.

type LeaveGameRes

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

type LeaveGameUnauthorized

type LeaveGameUnauthorized ErrorResponse

func (*LeaveGameUnauthorized) Decode

func (s *LeaveGameUnauthorized) Decode(d *jx.Decoder) error

Decode decodes LeaveGameUnauthorized from json.

func (*LeaveGameUnauthorized) Encode

func (s *LeaveGameUnauthorized) Encode(e *jx.Encoder)

Encode encodes LeaveGameUnauthorized as json.

func (*LeaveGameUnauthorized) MarshalJSON

func (s *LeaveGameUnauthorized) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*LeaveGameUnauthorized) UnmarshalJSON

func (s *LeaveGameUnauthorized) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type ListGamesRes

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

type ListGamesResponse

type ListGamesResponse struct {
	Games []GameSummary `json:"games"`
}

Ref: #/components/schemas/ListGamesResponse

func (*ListGamesResponse) Decode

func (s *ListGamesResponse) Decode(d *jx.Decoder) error

Decode decodes ListGamesResponse from json.

func (*ListGamesResponse) Encode

func (s *ListGamesResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*ListGamesResponse) GetGames

func (s *ListGamesResponse) GetGames() []GameSummary

GetGames returns the value of Games.

func (*ListGamesResponse) MarshalJSON

func (s *ListGamesResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*ListGamesResponse) SetGames

func (s *ListGamesResponse) SetGames(val []GameSummary)

SetGames sets the value of Games.

func (*ListGamesResponse) UnmarshalJSON

func (s *ListGamesResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ListGamesResponse) Validate

func (s *ListGamesResponse) Validate() error

type LobbyPlayer

type LobbyPlayer struct {
	// Player's ID.
	UID OptUUID `json:"uid"`
	// Player's total EXP.
	Exp OptInt64 `json:"exp"`
	// Player's ELO rating.
	Rating OptInt64 `json:"rating"`
}

Ref: #/components/schemas/LobbyPlayer

func (*LobbyPlayer) Decode

func (s *LobbyPlayer) Decode(d *jx.Decoder) error

Decode decodes LobbyPlayer from json.

func (*LobbyPlayer) Encode

func (s *LobbyPlayer) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*LobbyPlayer) GetExp

func (s *LobbyPlayer) GetExp() OptInt64

GetExp returns the value of Exp.

func (*LobbyPlayer) GetRating

func (s *LobbyPlayer) GetRating() OptInt64

GetRating returns the value of Rating.

func (*LobbyPlayer) GetUID

func (s *LobbyPlayer) GetUID() OptUUID

GetUID returns the value of UID.

func (*LobbyPlayer) MarshalJSON

func (s *LobbyPlayer) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*LobbyPlayer) SetExp

func (s *LobbyPlayer) SetExp(val OptInt64)

SetExp sets the value of Exp.

func (*LobbyPlayer) SetRating

func (s *LobbyPlayer) SetRating(val OptInt64)

SetRating sets the value of Rating.

func (*LobbyPlayer) SetUID

func (s *LobbyPlayer) SetUID(val OptUUID)

SetUID sets the value of UID.

func (*LobbyPlayer) UnmarshalJSON

func (s *LobbyPlayer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type LogoutNoContent

type LogoutNoContent struct{}

LogoutNoContent is response for Logout operation.

type LogoutRequest

type LogoutRequest struct {
	// Optional. The refresh token to revoke for this device.
	RefreshToken OptString `json:"refresh_token"`
}

Ref: #/components/schemas/LogoutRequest

func (*LogoutRequest) Decode

func (s *LogoutRequest) Decode(d *jx.Decoder) error

Decode decodes LogoutRequest from json.

func (*LogoutRequest) Encode

func (s *LogoutRequest) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*LogoutRequest) GetRefreshToken

func (s *LogoutRequest) GetRefreshToken() OptString

GetRefreshToken returns the value of RefreshToken.

func (*LogoutRequest) MarshalJSON

func (s *LogoutRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*LogoutRequest) SetRefreshToken

func (s *LogoutRequest) SetRefreshToken(val OptString)

SetRefreshToken sets the value of RefreshToken.

func (*LogoutRequest) UnmarshalJSON

func (s *LogoutRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type LogoutRes

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

type MatchmakingJoinConflict

type MatchmakingJoinConflict ErrorResponse

func (*MatchmakingJoinConflict) Decode

func (s *MatchmakingJoinConflict) Decode(d *jx.Decoder) error

Decode decodes MatchmakingJoinConflict from json.

func (*MatchmakingJoinConflict) Encode

func (s *MatchmakingJoinConflict) Encode(e *jx.Encoder)

Encode encodes MatchmakingJoinConflict as json.

func (*MatchmakingJoinConflict) MarshalJSON

func (s *MatchmakingJoinConflict) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*MatchmakingJoinConflict) UnmarshalJSON

func (s *MatchmakingJoinConflict) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type MatchmakingJoinInternalServerError

type MatchmakingJoinInternalServerError ErrorResponse

func (*MatchmakingJoinInternalServerError) Decode

Decode decodes MatchmakingJoinInternalServerError from json.

func (*MatchmakingJoinInternalServerError) Encode

Encode encodes MatchmakingJoinInternalServerError as json.

func (*MatchmakingJoinInternalServerError) MarshalJSON

func (s *MatchmakingJoinInternalServerError) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*MatchmakingJoinInternalServerError) UnmarshalJSON

func (s *MatchmakingJoinInternalServerError) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type MatchmakingJoinRes

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

type MatchmakingJoinResponse

type MatchmakingJoinResponse struct {
	// Queue status after joining.
	Status OptMatchmakingJoinResponseStatus `json:"status"`
}

Ref: #/components/schemas/MatchmakingJoinResponse

func (*MatchmakingJoinResponse) Decode

func (s *MatchmakingJoinResponse) Decode(d *jx.Decoder) error

Decode decodes MatchmakingJoinResponse from json.

func (*MatchmakingJoinResponse) Encode

func (s *MatchmakingJoinResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*MatchmakingJoinResponse) GetStatus

GetStatus returns the value of Status.

func (*MatchmakingJoinResponse) MarshalJSON

func (s *MatchmakingJoinResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*MatchmakingJoinResponse) SetStatus

SetStatus sets the value of Status.

func (*MatchmakingJoinResponse) UnmarshalJSON

func (s *MatchmakingJoinResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*MatchmakingJoinResponse) Validate

func (s *MatchmakingJoinResponse) Validate() error

type MatchmakingJoinResponseStatus

type MatchmakingJoinResponseStatus string

Queue status after joining.

const (
	MatchmakingJoinResponseStatusQueued MatchmakingJoinResponseStatus = "queued"
)

func (MatchmakingJoinResponseStatus) AllValues

AllValues returns all MatchmakingJoinResponseStatus values.

func (*MatchmakingJoinResponseStatus) Decode

Decode decodes MatchmakingJoinResponseStatus from json.

func (MatchmakingJoinResponseStatus) Encode

Encode encodes MatchmakingJoinResponseStatus as json.

func (MatchmakingJoinResponseStatus) MarshalJSON

func (s MatchmakingJoinResponseStatus) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (MatchmakingJoinResponseStatus) MarshalText

func (s MatchmakingJoinResponseStatus) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*MatchmakingJoinResponseStatus) UnmarshalJSON

func (s *MatchmakingJoinResponseStatus) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*MatchmakingJoinResponseStatus) UnmarshalText

func (s *MatchmakingJoinResponseStatus) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (MatchmakingJoinResponseStatus) Validate

func (s MatchmakingJoinResponseStatus) Validate() error

type MatchmakingJoinUnauthorized

type MatchmakingJoinUnauthorized ErrorResponse

func (*MatchmakingJoinUnauthorized) Decode

Decode decodes MatchmakingJoinUnauthorized from json.

func (*MatchmakingJoinUnauthorized) Encode

func (s *MatchmakingJoinUnauthorized) Encode(e *jx.Encoder)

Encode encodes MatchmakingJoinUnauthorized as json.

func (*MatchmakingJoinUnauthorized) MarshalJSON

func (s *MatchmakingJoinUnauthorized) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*MatchmakingJoinUnauthorized) UnmarshalJSON

func (s *MatchmakingJoinUnauthorized) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type MatchmakingLeaveInternalServerError

type MatchmakingLeaveInternalServerError ErrorResponse

func (*MatchmakingLeaveInternalServerError) Decode

Decode decodes MatchmakingLeaveInternalServerError from json.

func (*MatchmakingLeaveInternalServerError) Encode

Encode encodes MatchmakingLeaveInternalServerError as json.

func (*MatchmakingLeaveInternalServerError) MarshalJSON

func (s *MatchmakingLeaveInternalServerError) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*MatchmakingLeaveInternalServerError) UnmarshalJSON

func (s *MatchmakingLeaveInternalServerError) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type MatchmakingLeaveNoContent

type MatchmakingLeaveNoContent struct{}

MatchmakingLeaveNoContent is response for MatchmakingLeave operation.

type MatchmakingLeaveRes

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

type MatchmakingLeaveUnauthorized

type MatchmakingLeaveUnauthorized ErrorResponse

func (*MatchmakingLeaveUnauthorized) Decode

Decode decodes MatchmakingLeaveUnauthorized from json.

func (*MatchmakingLeaveUnauthorized) Encode

func (s *MatchmakingLeaveUnauthorized) Encode(e *jx.Encoder)

Encode encodes MatchmakingLeaveUnauthorized as json.

func (*MatchmakingLeaveUnauthorized) MarshalJSON

func (s *MatchmakingLeaveUnauthorized) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*MatchmakingLeaveUnauthorized) UnmarshalJSON

func (s *MatchmakingLeaveUnauthorized) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type Middleware

type Middleware = middleware.Middleware

Middleware is middleware type.

type MoveGameBadRequest

type MoveGameBadRequest ErrorResponse

func (*MoveGameBadRequest) Decode

func (s *MoveGameBadRequest) Decode(d *jx.Decoder) error

Decode decodes MoveGameBadRequest from json.

func (*MoveGameBadRequest) Encode

func (s *MoveGameBadRequest) Encode(e *jx.Encoder)

Encode encodes MoveGameBadRequest as json.

func (*MoveGameBadRequest) MarshalJSON

func (s *MoveGameBadRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*MoveGameBadRequest) UnmarshalJSON

func (s *MoveGameBadRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type MoveGameConflict

type MoveGameConflict ErrorResponse

func (*MoveGameConflict) Decode

func (s *MoveGameConflict) Decode(d *jx.Decoder) error

Decode decodes MoveGameConflict from json.

func (*MoveGameConflict) Encode

func (s *MoveGameConflict) Encode(e *jx.Encoder)

Encode encodes MoveGameConflict as json.

func (*MoveGameConflict) MarshalJSON

func (s *MoveGameConflict) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*MoveGameConflict) UnmarshalJSON

func (s *MoveGameConflict) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type MoveGameForbidden

type MoveGameForbidden ErrorResponse

func (*MoveGameForbidden) Decode

func (s *MoveGameForbidden) Decode(d *jx.Decoder) error

Decode decodes MoveGameForbidden from json.

func (*MoveGameForbidden) Encode

func (s *MoveGameForbidden) Encode(e *jx.Encoder)

Encode encodes MoveGameForbidden as json.

func (*MoveGameForbidden) MarshalJSON

func (s *MoveGameForbidden) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*MoveGameForbidden) UnmarshalJSON

func (s *MoveGameForbidden) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type MoveGameInternalServerError

type MoveGameInternalServerError ErrorResponse

func (*MoveGameInternalServerError) Decode

Decode decodes MoveGameInternalServerError from json.

func (*MoveGameInternalServerError) Encode

func (s *MoveGameInternalServerError) Encode(e *jx.Encoder)

Encode encodes MoveGameInternalServerError as json.

func (*MoveGameInternalServerError) MarshalJSON

func (s *MoveGameInternalServerError) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*MoveGameInternalServerError) UnmarshalJSON

func (s *MoveGameInternalServerError) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type MoveGameNotFound

type MoveGameNotFound ErrorResponse

func (*MoveGameNotFound) Decode

func (s *MoveGameNotFound) Decode(d *jx.Decoder) error

Decode decodes MoveGameNotFound from json.

func (*MoveGameNotFound) Encode

func (s *MoveGameNotFound) Encode(e *jx.Encoder)

Encode encodes MoveGameNotFound as json.

func (*MoveGameNotFound) MarshalJSON

func (s *MoveGameNotFound) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*MoveGameNotFound) UnmarshalJSON

func (s *MoveGameNotFound) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type MoveGameParams

type MoveGameParams struct {
	// ID of the game.
	ID uuid.UUID
}

MoveGameParams is parameters of moveGame operation.

type MoveGameRes

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

type MoveGameUnauthorized

type MoveGameUnauthorized ErrorResponse

func (*MoveGameUnauthorized) Decode

func (s *MoveGameUnauthorized) Decode(d *jx.Decoder) error

Decode decodes MoveGameUnauthorized from json.

func (*MoveGameUnauthorized) Encode

func (s *MoveGameUnauthorized) Encode(e *jx.Encoder)

Encode encodes MoveGameUnauthorized as json.

func (*MoveGameUnauthorized) MarshalJSON

func (s *MoveGameUnauthorized) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*MoveGameUnauthorized) UnmarshalJSON

func (s *MoveGameUnauthorized) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type MoveRequest

type MoveRequest struct {
	NewLetter MoveRequestNewLetter `json:"new_letter"`
	WordPath  []BoardCell          `json:"word_path"`
}

Ref: #/components/schemas/MoveRequest

func (*MoveRequest) Decode

func (s *MoveRequest) Decode(d *jx.Decoder) error

Decode decodes MoveRequest from json.

func (*MoveRequest) Encode

func (s *MoveRequest) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*MoveRequest) GetNewLetter

func (s *MoveRequest) GetNewLetter() MoveRequestNewLetter

GetNewLetter returns the value of NewLetter.

func (*MoveRequest) GetWordPath

func (s *MoveRequest) GetWordPath() []BoardCell

GetWordPath returns the value of WordPath.

func (*MoveRequest) MarshalJSON

func (s *MoveRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*MoveRequest) SetNewLetter

func (s *MoveRequest) SetNewLetter(val MoveRequestNewLetter)

SetNewLetter sets the value of NewLetter.

func (*MoveRequest) SetWordPath

func (s *MoveRequest) SetWordPath(val []BoardCell)

SetWordPath sets the value of WordPath.

func (*MoveRequest) UnmarshalJSON

func (s *MoveRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*MoveRequest) Validate

func (s *MoveRequest) Validate() error

type MoveRequestNewLetter

type MoveRequestNewLetter struct {
	Row int `json:"row"`
	Col int `json:"col"`
	// Single Cyrillic letter to place.
	Char string `json:"char"`
}

func (*MoveRequestNewLetter) Decode

func (s *MoveRequestNewLetter) Decode(d *jx.Decoder) error

Decode decodes MoveRequestNewLetter from json.

func (*MoveRequestNewLetter) Encode

func (s *MoveRequestNewLetter) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*MoveRequestNewLetter) GetChar

func (s *MoveRequestNewLetter) GetChar() string

GetChar returns the value of Char.

func (*MoveRequestNewLetter) GetCol

func (s *MoveRequestNewLetter) GetCol() int

GetCol returns the value of Col.

func (*MoveRequestNewLetter) GetRow

func (s *MoveRequestNewLetter) GetRow() int

GetRow returns the value of Row.

func (*MoveRequestNewLetter) MarshalJSON

func (s *MoveRequestNewLetter) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*MoveRequestNewLetter) SetChar

func (s *MoveRequestNewLetter) SetChar(val string)

SetChar sets the value of Char.

func (*MoveRequestNewLetter) SetCol

func (s *MoveRequestNewLetter) SetCol(val int)

SetCol sets the value of Col.

func (*MoveRequestNewLetter) SetRow

func (s *MoveRequestNewLetter) SetRow(val int)

SetRow sets the value of Row.

func (*MoveRequestNewLetter) UnmarshalJSON

func (s *MoveRequestNewLetter) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*MoveRequestNewLetter) Validate

func (s *MoveRequestNewLetter) Validate() error

type MoveResponse

type MoveResponse struct {
	// Updated 5x5 board state.
	Board [][]string `json:"board"`
	// ID of the player whose turn it is now.
	CurrentTurnUID OptUUID           `json:"current_turn_uid"`
	Players        []PlayerGameState `json:"players"`
	Status         OptGameStatus     `json:"status"`
	MoveNumber     OptInt            `json:"move_number"`
}

Ref: #/components/schemas/MoveResponse

func (*MoveResponse) Decode

func (s *MoveResponse) Decode(d *jx.Decoder) error

Decode decodes MoveResponse from json.

func (*MoveResponse) Encode

func (s *MoveResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*MoveResponse) GetBoard

func (s *MoveResponse) GetBoard() [][]string

GetBoard returns the value of Board.

func (*MoveResponse) GetCurrentTurnUID

func (s *MoveResponse) GetCurrentTurnUID() OptUUID

GetCurrentTurnUID returns the value of CurrentTurnUID.

func (*MoveResponse) GetMoveNumber

func (s *MoveResponse) GetMoveNumber() OptInt

GetMoveNumber returns the value of MoveNumber.

func (*MoveResponse) GetPlayers

func (s *MoveResponse) GetPlayers() []PlayerGameState

GetPlayers returns the value of Players.

func (*MoveResponse) GetStatus

func (s *MoveResponse) GetStatus() OptGameStatus

GetStatus returns the value of Status.

func (*MoveResponse) MarshalJSON

func (s *MoveResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*MoveResponse) SetBoard

func (s *MoveResponse) SetBoard(val [][]string)

SetBoard sets the value of Board.

func (*MoveResponse) SetCurrentTurnUID

func (s *MoveResponse) SetCurrentTurnUID(val OptUUID)

SetCurrentTurnUID sets the value of CurrentTurnUID.

func (*MoveResponse) SetMoveNumber

func (s *MoveResponse) SetMoveNumber(val OptInt)

SetMoveNumber sets the value of MoveNumber.

func (*MoveResponse) SetPlayers

func (s *MoveResponse) SetPlayers(val []PlayerGameState)

SetPlayers sets the value of Players.

func (*MoveResponse) SetStatus

func (s *MoveResponse) SetStatus(val OptGameStatus)

SetStatus sets the value of Status.

func (*MoveResponse) UnmarshalJSON

func (s *MoveResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*MoveResponse) Validate

func (s *MoveResponse) Validate() error

type OperationName

type OperationName = string

OperationName is the ogen operation name

const (
	AcceptEndGameOperation         OperationName = "AcceptEndGame"
	AuthOperation                  OperationName = "Auth"
	AuthTelegramOperation          OperationName = "AuthTelegram"
	CreateGameOperation            OperationName = "CreateGame"
	CreateGameWithBotOperation     OperationName = "CreateGameWithBot"
	GetConfigOperation             OperationName = "GetConfig"
	GetLeaderboardOperation        OperationName = "GetLeaderboard"
	GetPlayerAchievementsOperation OperationName = "GetPlayerAchievements"
	GetPlayerStateUIDOperation     OperationName = "GetPlayerStateUID"
	GetPlayerStatsOperation        OperationName = "GetPlayerStats"
	JoinGameOperation              OperationName = "JoinGame"
	LeaveGameOperation             OperationName = "LeaveGame"
	ListGamesOperation             OperationName = "ListGames"
	LogoutOperation                OperationName = "Logout"
	MatchmakingJoinOperation       OperationName = "MatchmakingJoin"
	MatchmakingLeaveOperation      OperationName = "MatchmakingLeave"
	MoveGameOperation              OperationName = "MoveGame"
	PingOperation                  OperationName = "Ping"
	ProposeEndGameOperation        OperationName = "ProposeEndGame"
	RefreshTokenOperation          OperationName = "RefreshToken"
	RejectEndGameOperation         OperationName = "RejectEndGame"
	SignupOperation                OperationName = "Signup"
	SkipGameOperation              OperationName = "SkipGame"
)

type OptAchievementID

type OptAchievementID struct {
	Value AchievementID
	Set   bool
}

OptAchievementID is optional AchievementID.

func NewOptAchievementID

func NewOptAchievementID(v AchievementID) OptAchievementID

NewOptAchievementID returns new OptAchievementID with value set to v.

func (*OptAchievementID) Decode

func (o *OptAchievementID) Decode(d *jx.Decoder) error

Decode decodes AchievementID from json.

func (OptAchievementID) Encode

func (o OptAchievementID) Encode(e *jx.Encoder)

Encode encodes AchievementID as json.

func (OptAchievementID) Get

func (o OptAchievementID) Get() (v AchievementID, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptAchievementID) IsSet

func (o OptAchievementID) IsSet() bool

IsSet returns true if OptAchievementID was set.

func (OptAchievementID) MarshalJSON

func (s OptAchievementID) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptAchievementID) Or

Or returns value if set, or given parameter if does not.

func (*OptAchievementID) Reset

func (o *OptAchievementID) Reset()

Reset unsets value.

func (*OptAchievementID) SetTo

func (o *OptAchievementID) SetTo(v AchievementID)

SetTo sets value to v.

func (*OptAchievementID) UnmarshalJSON

func (s *OptAchievementID) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptActiveGame

type OptActiveGame struct {
	Value ActiveGame
	Set   bool
}

OptActiveGame is optional ActiveGame.

func NewOptActiveGame

func NewOptActiveGame(v ActiveGame) OptActiveGame

NewOptActiveGame returns new OptActiveGame with value set to v.

func (*OptActiveGame) Decode

func (o *OptActiveGame) Decode(d *jx.Decoder) error

Decode decodes ActiveGame from json.

func (OptActiveGame) Encode

func (o OptActiveGame) Encode(e *jx.Encoder)

Encode encodes ActiveGame as json.

func (OptActiveGame) Get

func (o OptActiveGame) Get() (v ActiveGame, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptActiveGame) IsSet

func (o OptActiveGame) IsSet() bool

IsSet returns true if OptActiveGame was set.

func (OptActiveGame) MarshalJSON

func (s OptActiveGame) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptActiveGame) Or

Or returns value if set, or given parameter if does not.

func (*OptActiveGame) Reset

func (o *OptActiveGame) Reset()

Reset unsets value.

func (*OptActiveGame) SetTo

func (o *OptActiveGame) SetTo(v ActiveGame)

SetTo sets value to v.

func (*OptActiveGame) UnmarshalJSON

func (s *OptActiveGame) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptBool

type OptBool struct {
	Value bool
	Set   bool
}

OptBool is optional bool.

func NewOptBool

func NewOptBool(v bool) OptBool

NewOptBool returns new OptBool with value set to v.

func (*OptBool) Decode

func (o *OptBool) Decode(d *jx.Decoder) error

Decode decodes bool from json.

func (OptBool) Encode

func (o OptBool) Encode(e *jx.Encoder)

Encode encodes bool as json.

func (OptBool) Get

func (o OptBool) Get() (v bool, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptBool) IsSet

func (o OptBool) IsSet() bool

IsSet returns true if OptBool was set.

func (OptBool) MarshalJSON

func (s OptBool) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptBool) Or

func (o OptBool) Or(d bool) bool

Or returns value if set, or given parameter if does not.

func (*OptBool) Reset

func (o *OptBool) Reset()

Reset unsets value.

func (*OptBool) SetTo

func (o *OptBool) SetTo(v bool)

SetTo sets value to v.

func (*OptBool) UnmarshalJSON

func (s *OptBool) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptFloat64

type OptFloat64 struct {
	Value float64
	Set   bool
}

OptFloat64 is optional float64.

func NewOptFloat64

func NewOptFloat64(v float64) OptFloat64

NewOptFloat64 returns new OptFloat64 with value set to v.

func (*OptFloat64) Decode

func (o *OptFloat64) Decode(d *jx.Decoder) error

Decode decodes float64 from json.

func (OptFloat64) Encode

func (o OptFloat64) Encode(e *jx.Encoder)

Encode encodes float64 as json.

func (OptFloat64) Get

func (o OptFloat64) Get() (v float64, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptFloat64) IsSet

func (o OptFloat64) IsSet() bool

IsSet returns true if OptFloat64 was set.

func (OptFloat64) MarshalJSON

func (s OptFloat64) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptFloat64) Or

func (o OptFloat64) Or(d float64) float64

Or returns value if set, or given parameter if does not.

func (*OptFloat64) Reset

func (o *OptFloat64) Reset()

Reset unsets value.

func (*OptFloat64) SetTo

func (o *OptFloat64) SetTo(v float64)

SetTo sets value to v.

func (*OptFloat64) UnmarshalJSON

func (s *OptFloat64) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptGameStatus

type OptGameStatus struct {
	Value GameStatus
	Set   bool
}

OptGameStatus is optional GameStatus.

func NewOptGameStatus

func NewOptGameStatus(v GameStatus) OptGameStatus

NewOptGameStatus returns new OptGameStatus with value set to v.

func (*OptGameStatus) Decode

func (o *OptGameStatus) Decode(d *jx.Decoder) error

Decode decodes GameStatus from json.

func (OptGameStatus) Encode

func (o OptGameStatus) Encode(e *jx.Encoder)

Encode encodes GameStatus as json.

func (OptGameStatus) Get

func (o OptGameStatus) Get() (v GameStatus, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptGameStatus) IsSet

func (o OptGameStatus) IsSet() bool

IsSet returns true if OptGameStatus was set.

func (OptGameStatus) MarshalJSON

func (s OptGameStatus) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptGameStatus) Or

Or returns value if set, or given parameter if does not.

func (*OptGameStatus) Reset

func (o *OptGameStatus) Reset()

Reset unsets value.

func (*OptGameStatus) SetTo

func (o *OptGameStatus) SetTo(v GameStatus)

SetTo sets value to v.

func (*OptGameStatus) UnmarshalJSON

func (s *OptGameStatus) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptGameSummary

type OptGameSummary struct {
	Value GameSummary
	Set   bool
}

OptGameSummary is optional GameSummary.

func NewOptGameSummary

func NewOptGameSummary(v GameSummary) OptGameSummary

NewOptGameSummary returns new OptGameSummary with value set to v.

func (*OptGameSummary) Decode

func (o *OptGameSummary) Decode(d *jx.Decoder) error

Decode decodes GameSummary from json.

func (OptGameSummary) Encode

func (o OptGameSummary) Encode(e *jx.Encoder)

Encode encodes GameSummary as json.

func (OptGameSummary) Get

func (o OptGameSummary) Get() (v GameSummary, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptGameSummary) IsSet

func (o OptGameSummary) IsSet() bool

IsSet returns true if OptGameSummary was set.

func (OptGameSummary) MarshalJSON

func (s OptGameSummary) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptGameSummary) Or

Or returns value if set, or given parameter if does not.

func (*OptGameSummary) Reset

func (o *OptGameSummary) Reset()

Reset unsets value.

func (*OptGameSummary) SetTo

func (o *OptGameSummary) SetTo(v GameSummary)

SetTo sets value to v.

func (*OptGameSummary) UnmarshalJSON

func (s *OptGameSummary) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptGetLeaderboardSort

type OptGetLeaderboardSort struct {
	Value GetLeaderboardSort
	Set   bool
}

OptGetLeaderboardSort is optional GetLeaderboardSort.

func NewOptGetLeaderboardSort

func NewOptGetLeaderboardSort(v GetLeaderboardSort) OptGetLeaderboardSort

NewOptGetLeaderboardSort returns new OptGetLeaderboardSort with value set to v.

func (OptGetLeaderboardSort) Get

Get returns value and boolean that denotes whether value was set.

func (OptGetLeaderboardSort) IsSet

func (o OptGetLeaderboardSort) IsSet() bool

IsSet returns true if OptGetLeaderboardSort was set.

func (OptGetLeaderboardSort) Or

Or returns value if set, or given parameter if does not.

func (*OptGetLeaderboardSort) Reset

func (o *OptGetLeaderboardSort) Reset()

Reset unsets value.

func (*OptGetLeaderboardSort) SetTo

SetTo sets value to v.

type OptInt

type OptInt struct {
	Value int
	Set   bool
}

OptInt is optional int.

func NewOptInt

func NewOptInt(v int) OptInt

NewOptInt returns new OptInt with value set to v.

func (*OptInt) Decode

func (o *OptInt) Decode(d *jx.Decoder) error

Decode decodes int from json.

func (OptInt) Encode

func (o OptInt) Encode(e *jx.Encoder)

Encode encodes int as json.

func (OptInt) Get

func (o OptInt) Get() (v int, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptInt) IsSet

func (o OptInt) IsSet() bool

IsSet returns true if OptInt was set.

func (OptInt) MarshalJSON

func (s OptInt) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptInt) Or

func (o OptInt) Or(d int) int

Or returns value if set, or given parameter if does not.

func (*OptInt) Reset

func (o *OptInt) Reset()

Reset unsets value.

func (*OptInt) SetTo

func (o *OptInt) SetTo(v int)

SetTo sets value to v.

func (*OptInt) UnmarshalJSON

func (s *OptInt) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptInt64

type OptInt64 struct {
	Value int64
	Set   bool
}

OptInt64 is optional int64.

func NewOptInt64

func NewOptInt64(v int64) OptInt64

NewOptInt64 returns new OptInt64 with value set to v.

func (*OptInt64) Decode

func (o *OptInt64) Decode(d *jx.Decoder) error

Decode decodes int64 from json.

func (OptInt64) Encode

func (o OptInt64) Encode(e *jx.Encoder)

Encode encodes int64 as json.

func (OptInt64) Get

func (o OptInt64) Get() (v int64, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptInt64) IsSet

func (o OptInt64) IsSet() bool

IsSet returns true if OptInt64 was set.

func (OptInt64) MarshalJSON

func (s OptInt64) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptInt64) Or

func (o OptInt64) Or(d int64) int64

Or returns value if set, or given parameter if does not.

func (*OptInt64) Reset

func (o *OptInt64) Reset()

Reset unsets value.

func (*OptInt64) SetTo

func (o *OptInt64) SetTo(v int64)

SetTo sets value to v.

func (*OptInt64) UnmarshalJSON

func (s *OptInt64) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptLeaderboardResponsePeriod

type OptLeaderboardResponsePeriod struct {
	Value LeaderboardResponsePeriod
	Set   bool
}

OptLeaderboardResponsePeriod is optional LeaderboardResponsePeriod.

func NewOptLeaderboardResponsePeriod

func NewOptLeaderboardResponsePeriod(v LeaderboardResponsePeriod) OptLeaderboardResponsePeriod

NewOptLeaderboardResponsePeriod returns new OptLeaderboardResponsePeriod with value set to v.

func (*OptLeaderboardResponsePeriod) Decode

Decode decodes LeaderboardResponsePeriod from json.

func (OptLeaderboardResponsePeriod) Encode

Encode encodes LeaderboardResponsePeriod as json.

func (OptLeaderboardResponsePeriod) Get

Get returns value and boolean that denotes whether value was set.

func (OptLeaderboardResponsePeriod) IsSet

IsSet returns true if OptLeaderboardResponsePeriod was set.

func (OptLeaderboardResponsePeriod) MarshalJSON

func (s OptLeaderboardResponsePeriod) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptLeaderboardResponsePeriod) Or

Or returns value if set, or given parameter if does not.

func (*OptLeaderboardResponsePeriod) Reset

func (o *OptLeaderboardResponsePeriod) Reset()

Reset unsets value.

func (*OptLeaderboardResponsePeriod) SetTo

SetTo sets value to v.

func (*OptLeaderboardResponsePeriod) UnmarshalJSON

func (s *OptLeaderboardResponsePeriod) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptLeaderboardResponseSort

type OptLeaderboardResponseSort struct {
	Value LeaderboardResponseSort
	Set   bool
}

OptLeaderboardResponseSort is optional LeaderboardResponseSort.

func NewOptLeaderboardResponseSort

func NewOptLeaderboardResponseSort(v LeaderboardResponseSort) OptLeaderboardResponseSort

NewOptLeaderboardResponseSort returns new OptLeaderboardResponseSort with value set to v.

func (*OptLeaderboardResponseSort) Decode

Decode decodes LeaderboardResponseSort from json.

func (OptLeaderboardResponseSort) Encode

func (o OptLeaderboardResponseSort) Encode(e *jx.Encoder)

Encode encodes LeaderboardResponseSort as json.

func (OptLeaderboardResponseSort) Get

Get returns value and boolean that denotes whether value was set.

func (OptLeaderboardResponseSort) IsSet

func (o OptLeaderboardResponseSort) IsSet() bool

IsSet returns true if OptLeaderboardResponseSort was set.

func (OptLeaderboardResponseSort) MarshalJSON

func (s OptLeaderboardResponseSort) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptLeaderboardResponseSort) Or

Or returns value if set, or given parameter if does not.

func (*OptLeaderboardResponseSort) Reset

func (o *OptLeaderboardResponseSort) Reset()

Reset unsets value.

func (*OptLeaderboardResponseSort) SetTo

SetTo sets value to v.

func (*OptLeaderboardResponseSort) UnmarshalJSON

func (s *OptLeaderboardResponseSort) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptLogoutRequest

type OptLogoutRequest struct {
	Value LogoutRequest
	Set   bool
}

OptLogoutRequest is optional LogoutRequest.

func NewOptLogoutRequest

func NewOptLogoutRequest(v LogoutRequest) OptLogoutRequest

NewOptLogoutRequest returns new OptLogoutRequest with value set to v.

func (*OptLogoutRequest) Decode

func (o *OptLogoutRequest) Decode(d *jx.Decoder) error

Decode decodes LogoutRequest from json.

func (OptLogoutRequest) Encode

func (o OptLogoutRequest) Encode(e *jx.Encoder)

Encode encodes LogoutRequest as json.

func (OptLogoutRequest) Get

func (o OptLogoutRequest) Get() (v LogoutRequest, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptLogoutRequest) IsSet

func (o OptLogoutRequest) IsSet() bool

IsSet returns true if OptLogoutRequest was set.

func (OptLogoutRequest) MarshalJSON

func (s OptLogoutRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptLogoutRequest) Or

Or returns value if set, or given parameter if does not.

func (*OptLogoutRequest) Reset

func (o *OptLogoutRequest) Reset()

Reset unsets value.

func (*OptLogoutRequest) SetTo

func (o *OptLogoutRequest) SetTo(v LogoutRequest)

SetTo sets value to v.

func (*OptLogoutRequest) UnmarshalJSON

func (s *OptLogoutRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptMatchmakingJoinResponseStatus

type OptMatchmakingJoinResponseStatus struct {
	Value MatchmakingJoinResponseStatus
	Set   bool
}

OptMatchmakingJoinResponseStatus is optional MatchmakingJoinResponseStatus.

func NewOptMatchmakingJoinResponseStatus

func NewOptMatchmakingJoinResponseStatus(v MatchmakingJoinResponseStatus) OptMatchmakingJoinResponseStatus

NewOptMatchmakingJoinResponseStatus returns new OptMatchmakingJoinResponseStatus with value set to v.

func (*OptMatchmakingJoinResponseStatus) Decode

Decode decodes MatchmakingJoinResponseStatus from json.

func (OptMatchmakingJoinResponseStatus) Encode

Encode encodes MatchmakingJoinResponseStatus as json.

func (OptMatchmakingJoinResponseStatus) Get

Get returns value and boolean that denotes whether value was set.

func (OptMatchmakingJoinResponseStatus) IsSet

IsSet returns true if OptMatchmakingJoinResponseStatus was set.

func (OptMatchmakingJoinResponseStatus) MarshalJSON

func (s OptMatchmakingJoinResponseStatus) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptMatchmakingJoinResponseStatus) Or

Or returns value if set, or given parameter if does not.

func (*OptMatchmakingJoinResponseStatus) Reset

Reset unsets value.

func (*OptMatchmakingJoinResponseStatus) SetTo

SetTo sets value to v.

func (*OptMatchmakingJoinResponseStatus) UnmarshalJSON

func (s *OptMatchmakingJoinResponseStatus) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptPlayer

type OptPlayer struct {
	Value Player
	Set   bool
}

OptPlayer is optional Player.

func NewOptPlayer

func NewOptPlayer(v Player) OptPlayer

NewOptPlayer returns new OptPlayer with value set to v.

func (*OptPlayer) Decode

func (o *OptPlayer) Decode(d *jx.Decoder) error

Decode decodes Player from json.

func (OptPlayer) Encode

func (o OptPlayer) Encode(e *jx.Encoder)

Encode encodes Player as json.

func (OptPlayer) Get

func (o OptPlayer) Get() (v Player, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptPlayer) IsSet

func (o OptPlayer) IsSet() bool

IsSet returns true if OptPlayer was set.

func (OptPlayer) MarshalJSON

func (s OptPlayer) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptPlayer) Or

func (o OptPlayer) Or(d Player) Player

Or returns value if set, or given parameter if does not.

func (*OptPlayer) Reset

func (o *OptPlayer) Reset()

Reset unsets value.

func (*OptPlayer) SetTo

func (o *OptPlayer) SetTo(v Player)

SetTo sets value to v.

func (*OptPlayer) UnmarshalJSON

func (s *OptPlayer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptString

type OptString struct {
	Value string
	Set   bool
}

OptString is optional string.

func NewOptString

func NewOptString(v string) OptString

NewOptString returns new OptString with value set to v.

func (*OptString) Decode

func (o *OptString) Decode(d *jx.Decoder) error

Decode decodes string from json.

func (OptString) Encode

func (o OptString) Encode(e *jx.Encoder)

Encode encodes string as json.

func (OptString) Get

func (o OptString) Get() (v string, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptString) IsSet

func (o OptString) IsSet() bool

IsSet returns true if OptString was set.

func (OptString) MarshalJSON

func (s OptString) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptString) Or

func (o OptString) Or(d string) string

Or returns value if set, or given parameter if does not.

func (*OptString) Reset

func (o *OptString) Reset()

Reset unsets value.

func (*OptString) SetTo

func (o *OptString) SetTo(v string)

SetTo sets value to v.

func (*OptString) UnmarshalJSON

func (s *OptString) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptUUID

type OptUUID struct {
	Value uuid.UUID
	Set   bool
}

OptUUID is optional uuid.UUID.

func NewOptUUID

func NewOptUUID(v uuid.UUID) OptUUID

NewOptUUID returns new OptUUID with value set to v.

func (*OptUUID) Decode

func (o *OptUUID) Decode(d *jx.Decoder) error

Decode decodes uuid.UUID from json.

func (OptUUID) Encode

func (o OptUUID) Encode(e *jx.Encoder)

Encode encodes uuid.UUID as json.

func (OptUUID) Get

func (o OptUUID) Get() (v uuid.UUID, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptUUID) IsSet

func (o OptUUID) IsSet() bool

IsSet returns true if OptUUID was set.

func (OptUUID) MarshalJSON

func (s OptUUID) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptUUID) Or

func (o OptUUID) Or(d uuid.UUID) uuid.UUID

Or returns value if set, or given parameter if does not.

func (*OptUUID) Reset

func (o *OptUUID) Reset()

Reset unsets value.

func (*OptUUID) SetTo

func (o *OptUUID) SetTo(v uuid.UUID)

SetTo sets value to v.

func (*OptUUID) UnmarshalJSON

func (s *OptUUID) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type Option

type Option interface {
	ServerOption
	ClientOption
}

Option is config option.

func WithAttributes

func WithAttributes(attributes ...attribute.KeyValue) Option

WithAttributes specifies default otel attributes.

func WithMeterProvider

func WithMeterProvider(provider metric.MeterProvider) Option

WithMeterProvider specifies a meter provider to use for creating a meter.

If none is specified, the otel.GetMeterProvider() is used.

func WithTracerProvider

func WithTracerProvider(provider trace.TracerProvider) Option

WithTracerProvider specifies a tracer provider to use for creating a tracer.

If none is specified, the global provider is used.

type PingNoContent

type PingNoContent struct {
	XRequestID  OptInt64
	XServerTime OptInt64
}

PingNoContent is response for Ping operation.

func (*PingNoContent) GetXRequestID

func (s *PingNoContent) GetXRequestID() OptInt64

GetXRequestID returns the value of XRequestID.

func (*PingNoContent) GetXServerTime

func (s *PingNoContent) GetXServerTime() OptInt64

GetXServerTime returns the value of XServerTime.

func (*PingNoContent) SetXRequestID

func (s *PingNoContent) SetXRequestID(val OptInt64)

SetXRequestID sets the value of XRequestID.

func (*PingNoContent) SetXServerTime

func (s *PingNoContent) SetXServerTime(val OptInt64)

SetXServerTime sets the value of XServerTime.

func (*PingNoContent) Validate

func (s *PingNoContent) Validate() error

type PingParams

type PingParams struct {
	XRequestID int64
}

PingParams is parameters of ping operation.

type PingRes

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

type Player

type Player struct {
	// Player's ID in the system.
	UID OptUUID `json:"uid"`
	// Player's first name.
	Firstname OptString `json:"firstname"`
	// Player's last name.
	Lastname OptString `json:"lastname"`
	// Player's total EXP.
	Exp OptInt64 `json:"exp"`
	// Player's ELO rating.
	Rating OptInt64 `json:"rating"`
}

Ref: #/components/schemas/Player

func (*Player) Decode

func (s *Player) Decode(d *jx.Decoder) error

Decode decodes Player from json.

func (*Player) Encode

func (s *Player) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Player) GetExp

func (s *Player) GetExp() OptInt64

GetExp returns the value of Exp.

func (*Player) GetFirstname

func (s *Player) GetFirstname() OptString

GetFirstname returns the value of Firstname.

func (*Player) GetLastname

func (s *Player) GetLastname() OptString

GetLastname returns the value of Lastname.

func (*Player) GetRating

func (s *Player) GetRating() OptInt64

GetRating returns the value of Rating.

func (*Player) GetUID

func (s *Player) GetUID() OptUUID

GetUID returns the value of UID.

func (*Player) MarshalJSON

func (s *Player) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Player) SetExp

func (s *Player) SetExp(val OptInt64)

SetExp sets the value of Exp.

func (*Player) SetFirstname

func (s *Player) SetFirstname(val OptString)

SetFirstname sets the value of Firstname.

func (*Player) SetLastname

func (s *Player) SetLastname(val OptString)

SetLastname sets the value of Lastname.

func (*Player) SetRating

func (s *Player) SetRating(val OptInt64)

SetRating sets the value of Rating.

func (*Player) SetUID

func (s *Player) SetUID(val OptUUID)

SetUID sets the value of UID.

func (*Player) UnmarshalJSON

func (s *Player) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type PlayerAchievementsResponse

type PlayerAchievementsResponse struct {
	// Full list of achievements with unlocked status.
	Achievements []Achievement `json:"achievements"`
}

Ref: #/components/schemas/PlayerAchievementsResponse

func (*PlayerAchievementsResponse) Decode

Decode decodes PlayerAchievementsResponse from json.

func (*PlayerAchievementsResponse) Encode

func (s *PlayerAchievementsResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*PlayerAchievementsResponse) GetAchievements

func (s *PlayerAchievementsResponse) GetAchievements() []Achievement

GetAchievements returns the value of Achievements.

func (*PlayerAchievementsResponse) MarshalJSON

func (s *PlayerAchievementsResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*PlayerAchievementsResponse) SetAchievements

func (s *PlayerAchievementsResponse) SetAchievements(val []Achievement)

SetAchievements sets the value of Achievements.

func (*PlayerAchievementsResponse) UnmarshalJSON

func (s *PlayerAchievementsResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*PlayerAchievementsResponse) Validate

func (s *PlayerAchievementsResponse) Validate() error

type PlayerGameState

type PlayerGameState struct {
	// Player's ID.
	UID OptUUID `json:"uid"`
	// Player's total EXP at the time of the event.
	Exp OptInt64 `json:"exp"`
	// Player's ELO rating at the time of the event.
	Rating OptInt64 `json:"rating"`
	// EXP earned in this game (only present in game_over events).
	ExpGained OptInt `json:"exp_gained"`
	// Number of points scored in the current game.
	Score OptInt `json:"score"`
	// Number of words submitted by the player.
	WordsCount OptInt `json:"words_count"`
	// List of words submitted by the player in this game.
	Words []string `json:"words"`
}

Ref: #/components/schemas/PlayerGameState

func (*PlayerGameState) Decode

func (s *PlayerGameState) Decode(d *jx.Decoder) error

Decode decodes PlayerGameState from json.

func (*PlayerGameState) Encode

func (s *PlayerGameState) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*PlayerGameState) GetExp

func (s *PlayerGameState) GetExp() OptInt64

GetExp returns the value of Exp.

func (*PlayerGameState) GetExpGained

func (s *PlayerGameState) GetExpGained() OptInt

GetExpGained returns the value of ExpGained.

func (*PlayerGameState) GetRating

func (s *PlayerGameState) GetRating() OptInt64

GetRating returns the value of Rating.

func (*PlayerGameState) GetScore

func (s *PlayerGameState) GetScore() OptInt

GetScore returns the value of Score.

func (*PlayerGameState) GetUID

func (s *PlayerGameState) GetUID() OptUUID

GetUID returns the value of UID.

func (*PlayerGameState) GetWords

func (s *PlayerGameState) GetWords() []string

GetWords returns the value of Words.

func (*PlayerGameState) GetWordsCount

func (s *PlayerGameState) GetWordsCount() OptInt

GetWordsCount returns the value of WordsCount.

func (*PlayerGameState) MarshalJSON

func (s *PlayerGameState) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*PlayerGameState) SetExp

func (s *PlayerGameState) SetExp(val OptInt64)

SetExp sets the value of Exp.

func (*PlayerGameState) SetExpGained

func (s *PlayerGameState) SetExpGained(val OptInt)

SetExpGained sets the value of ExpGained.

func (*PlayerGameState) SetRating

func (s *PlayerGameState) SetRating(val OptInt64)

SetRating sets the value of Rating.

func (*PlayerGameState) SetScore

func (s *PlayerGameState) SetScore(val OptInt)

SetScore sets the value of Score.

func (*PlayerGameState) SetUID

func (s *PlayerGameState) SetUID(val OptUUID)

SetUID sets the value of UID.

func (*PlayerGameState) SetWords

func (s *PlayerGameState) SetWords(val []string)

SetWords sets the value of Words.

func (*PlayerGameState) SetWordsCount

func (s *PlayerGameState) SetWordsCount(val OptInt)

SetWordsCount sets the value of WordsCount.

func (*PlayerGameState) UnmarshalJSON

func (s *PlayerGameState) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type PlayerState

type PlayerState struct {
	// Player's ID in the system.
	UID OptUUID `json:"uid"`
	// Generated nickname in the system.
	Nickname OptString `json:"nickname"`
	// Player's exp points in the system.
	Exp OptInt64 `json:"exp"`
	// Player's ELO rating in the system.
	Rating OptInt64 `json:"rating"`
	// Player's lives count in the system.
	Lives OptInt64 `json:"lives"`
	// Some Player's flags.
	Flags OptInt64 `json:"flags"`
	// Game's ID (if game_id empty or absent then player in the lobby).
	GameID OptUUID `json:"game_id"`
}

Ref: #/components/schemas/PlayerState

func (*PlayerState) Decode

func (s *PlayerState) Decode(d *jx.Decoder) error

Decode decodes PlayerState from json.

func (*PlayerState) Encode

func (s *PlayerState) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*PlayerState) GetExp

func (s *PlayerState) GetExp() OptInt64

GetExp returns the value of Exp.

func (*PlayerState) GetFlags

func (s *PlayerState) GetFlags() OptInt64

GetFlags returns the value of Flags.

func (*PlayerState) GetGameID

func (s *PlayerState) GetGameID() OptUUID

GetGameID returns the value of GameID.

func (*PlayerState) GetLives

func (s *PlayerState) GetLives() OptInt64

GetLives returns the value of Lives.

func (*PlayerState) GetNickname

func (s *PlayerState) GetNickname() OptString

GetNickname returns the value of Nickname.

func (*PlayerState) GetRating

func (s *PlayerState) GetRating() OptInt64

GetRating returns the value of Rating.

func (*PlayerState) GetUID

func (s *PlayerState) GetUID() OptUUID

GetUID returns the value of UID.

func (*PlayerState) MarshalJSON

func (s *PlayerState) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*PlayerState) SetExp

func (s *PlayerState) SetExp(val OptInt64)

SetExp sets the value of Exp.

func (*PlayerState) SetFlags

func (s *PlayerState) SetFlags(val OptInt64)

SetFlags sets the value of Flags.

func (*PlayerState) SetGameID

func (s *PlayerState) SetGameID(val OptUUID)

SetGameID sets the value of GameID.

func (*PlayerState) SetLives

func (s *PlayerState) SetLives(val OptInt64)

SetLives sets the value of Lives.

func (*PlayerState) SetNickname

func (s *PlayerState) SetNickname(val OptString)

SetNickname sets the value of Nickname.

func (*PlayerState) SetRating

func (s *PlayerState) SetRating(val OptInt64)

SetRating sets the value of Rating.

func (*PlayerState) SetUID

func (s *PlayerState) SetUID(val OptUUID)

SetUID sets the value of UID.

func (*PlayerState) UnmarshalJSON

func (s *PlayerState) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type PlayerStatsResponse

type PlayerStatsResponse struct {
	// Total number of finished games.
	GamesPlayed OptInt64 `json:"games_played"`
	// Number of games won.
	Wins OptInt64 `json:"wins"`
	// Number of games lost.
	Losses OptInt64 `json:"losses"`
	// Number of games ended in a draw.
	Draws OptInt64 `json:"draws"`
	// Win rate as a fraction (0..1).
	WinRate OptFloat64 `json:"win_rate"`
	// Average length of submitted words in letters.
	AvgWordLength OptFloat64 `json:"avg_word_length"`
	// Longest word ever submitted (empty if no games with recorded words).
	BestWord OptString `json:"best_word"`
	// Most frequently used letter across all submitted words (empty if none).
	FavoriteLetter OptString `json:"favorite_letter"`
}

Ref: #/components/schemas/PlayerStatsResponse

func (*PlayerStatsResponse) Decode

func (s *PlayerStatsResponse) Decode(d *jx.Decoder) error

Decode decodes PlayerStatsResponse from json.

func (*PlayerStatsResponse) Encode

func (s *PlayerStatsResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*PlayerStatsResponse) GetAvgWordLength

func (s *PlayerStatsResponse) GetAvgWordLength() OptFloat64

GetAvgWordLength returns the value of AvgWordLength.

func (*PlayerStatsResponse) GetBestWord

func (s *PlayerStatsResponse) GetBestWord() OptString

GetBestWord returns the value of BestWord.

func (*PlayerStatsResponse) GetDraws

func (s *PlayerStatsResponse) GetDraws() OptInt64

GetDraws returns the value of Draws.

func (*PlayerStatsResponse) GetFavoriteLetter

func (s *PlayerStatsResponse) GetFavoriteLetter() OptString

GetFavoriteLetter returns the value of FavoriteLetter.

func (*PlayerStatsResponse) GetGamesPlayed

func (s *PlayerStatsResponse) GetGamesPlayed() OptInt64

GetGamesPlayed returns the value of GamesPlayed.

func (*PlayerStatsResponse) GetLosses

func (s *PlayerStatsResponse) GetLosses() OptInt64

GetLosses returns the value of Losses.

func (*PlayerStatsResponse) GetWinRate

func (s *PlayerStatsResponse) GetWinRate() OptFloat64

GetWinRate returns the value of WinRate.

func (*PlayerStatsResponse) GetWins

func (s *PlayerStatsResponse) GetWins() OptInt64

GetWins returns the value of Wins.

func (*PlayerStatsResponse) MarshalJSON

func (s *PlayerStatsResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*PlayerStatsResponse) SetAvgWordLength

func (s *PlayerStatsResponse) SetAvgWordLength(val OptFloat64)

SetAvgWordLength sets the value of AvgWordLength.

func (*PlayerStatsResponse) SetBestWord

func (s *PlayerStatsResponse) SetBestWord(val OptString)

SetBestWord sets the value of BestWord.

func (*PlayerStatsResponse) SetDraws

func (s *PlayerStatsResponse) SetDraws(val OptInt64)

SetDraws sets the value of Draws.

func (*PlayerStatsResponse) SetFavoriteLetter

func (s *PlayerStatsResponse) SetFavoriteLetter(val OptString)

SetFavoriteLetter sets the value of FavoriteLetter.

func (*PlayerStatsResponse) SetGamesPlayed

func (s *PlayerStatsResponse) SetGamesPlayed(val OptInt64)

SetGamesPlayed sets the value of GamesPlayed.

func (*PlayerStatsResponse) SetLosses

func (s *PlayerStatsResponse) SetLosses(val OptInt64)

SetLosses sets the value of Losses.

func (*PlayerStatsResponse) SetWinRate

func (s *PlayerStatsResponse) SetWinRate(val OptFloat64)

SetWinRate sets the value of WinRate.

func (*PlayerStatsResponse) SetWins

func (s *PlayerStatsResponse) SetWins(val OptInt64)

SetWins sets the value of Wins.

func (*PlayerStatsResponse) UnmarshalJSON

func (s *PlayerStatsResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*PlayerStatsResponse) Validate

func (s *PlayerStatsResponse) Validate() error

type ProposeEndGameConflict

type ProposeEndGameConflict ErrorResponse

func (*ProposeEndGameConflict) Decode

func (s *ProposeEndGameConflict) Decode(d *jx.Decoder) error

Decode decodes ProposeEndGameConflict from json.

func (*ProposeEndGameConflict) Encode

func (s *ProposeEndGameConflict) Encode(e *jx.Encoder)

Encode encodes ProposeEndGameConflict as json.

func (*ProposeEndGameConflict) MarshalJSON

func (s *ProposeEndGameConflict) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*ProposeEndGameConflict) UnmarshalJSON

func (s *ProposeEndGameConflict) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type ProposeEndGameForbidden

type ProposeEndGameForbidden ErrorResponse

func (*ProposeEndGameForbidden) Decode

func (s *ProposeEndGameForbidden) Decode(d *jx.Decoder) error

Decode decodes ProposeEndGameForbidden from json.

func (*ProposeEndGameForbidden) Encode

func (s *ProposeEndGameForbidden) Encode(e *jx.Encoder)

Encode encodes ProposeEndGameForbidden as json.

func (*ProposeEndGameForbidden) MarshalJSON

func (s *ProposeEndGameForbidden) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*ProposeEndGameForbidden) UnmarshalJSON

func (s *ProposeEndGameForbidden) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type ProposeEndGameNoContent

type ProposeEndGameNoContent struct{}

ProposeEndGameNoContent is response for ProposeEndGame operation.

type ProposeEndGameNotFound

type ProposeEndGameNotFound ErrorResponse

func (*ProposeEndGameNotFound) Decode

func (s *ProposeEndGameNotFound) Decode(d *jx.Decoder) error

Decode decodes ProposeEndGameNotFound from json.

func (*ProposeEndGameNotFound) Encode

func (s *ProposeEndGameNotFound) Encode(e *jx.Encoder)

Encode encodes ProposeEndGameNotFound as json.

func (*ProposeEndGameNotFound) MarshalJSON

func (s *ProposeEndGameNotFound) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*ProposeEndGameNotFound) UnmarshalJSON

func (s *ProposeEndGameNotFound) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type ProposeEndGameParams

type ProposeEndGameParams struct {
	// ID of the game.
	ID uuid.UUID
}

ProposeEndGameParams is parameters of proposeEndGame operation.

type ProposeEndGameRes

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

type ProposeEndGameUnauthorized

type ProposeEndGameUnauthorized ErrorResponse

func (*ProposeEndGameUnauthorized) Decode

Decode decodes ProposeEndGameUnauthorized from json.

func (*ProposeEndGameUnauthorized) Encode

func (s *ProposeEndGameUnauthorized) Encode(e *jx.Encoder)

Encode encodes ProposeEndGameUnauthorized as json.

func (*ProposeEndGameUnauthorized) MarshalJSON

func (s *ProposeEndGameUnauthorized) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*ProposeEndGameUnauthorized) UnmarshalJSON

func (s *ProposeEndGameUnauthorized) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type RefreshRequest

type RefreshRequest struct {
	// The opaque refresh token previously issued.
	RefreshToken string `json:"refresh_token"`
}

Ref: #/components/schemas/RefreshRequest

func (*RefreshRequest) Decode

func (s *RefreshRequest) Decode(d *jx.Decoder) error

Decode decodes RefreshRequest from json.

func (*RefreshRequest) Encode

func (s *RefreshRequest) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*RefreshRequest) GetRefreshToken

func (s *RefreshRequest) GetRefreshToken() string

GetRefreshToken returns the value of RefreshToken.

func (*RefreshRequest) MarshalJSON

func (s *RefreshRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*RefreshRequest) SetRefreshToken

func (s *RefreshRequest) SetRefreshToken(val string)

SetRefreshToken sets the value of RefreshToken.

func (*RefreshRequest) UnmarshalJSON

func (s *RefreshRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type RefreshResponse

type RefreshResponse struct {
	// New short-lived JWT access token.
	AccessToken OptString `json:"access_token"`
	// New opaque refresh token (rotated; the old one is now invalid).
	RefreshToken OptString `json:"refresh_token"`
	// Always "Bearer".
	TokenType OptString `json:"token_type"`
	// Access token lifetime in seconds.
	ExpiresIn OptInt `json:"expires_in"`
}

Ref: #/components/schemas/RefreshResponse

func (*RefreshResponse) Decode

func (s *RefreshResponse) Decode(d *jx.Decoder) error

Decode decodes RefreshResponse from json.

func (*RefreshResponse) Encode

func (s *RefreshResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*RefreshResponse) GetAccessToken

func (s *RefreshResponse) GetAccessToken() OptString

GetAccessToken returns the value of AccessToken.

func (*RefreshResponse) GetExpiresIn

func (s *RefreshResponse) GetExpiresIn() OptInt

GetExpiresIn returns the value of ExpiresIn.

func (*RefreshResponse) GetRefreshToken

func (s *RefreshResponse) GetRefreshToken() OptString

GetRefreshToken returns the value of RefreshToken.

func (*RefreshResponse) GetTokenType

func (s *RefreshResponse) GetTokenType() OptString

GetTokenType returns the value of TokenType.

func (*RefreshResponse) MarshalJSON

func (s *RefreshResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*RefreshResponse) SetAccessToken

func (s *RefreshResponse) SetAccessToken(val OptString)

SetAccessToken sets the value of AccessToken.

func (*RefreshResponse) SetExpiresIn

func (s *RefreshResponse) SetExpiresIn(val OptInt)

SetExpiresIn sets the value of ExpiresIn.

func (*RefreshResponse) SetRefreshToken

func (s *RefreshResponse) SetRefreshToken(val OptString)

SetRefreshToken sets the value of RefreshToken.

func (*RefreshResponse) SetTokenType

func (s *RefreshResponse) SetTokenType(val OptString)

SetTokenType sets the value of TokenType.

func (*RefreshResponse) UnmarshalJSON

func (s *RefreshResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type RefreshTokenRes

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

type RejectEndGameConflict

type RejectEndGameConflict ErrorResponse

func (*RejectEndGameConflict) Decode

func (s *RejectEndGameConflict) Decode(d *jx.Decoder) error

Decode decodes RejectEndGameConflict from json.

func (*RejectEndGameConflict) Encode

func (s *RejectEndGameConflict) Encode(e *jx.Encoder)

Encode encodes RejectEndGameConflict as json.

func (*RejectEndGameConflict) MarshalJSON

func (s *RejectEndGameConflict) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*RejectEndGameConflict) UnmarshalJSON

func (s *RejectEndGameConflict) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type RejectEndGameForbidden

type RejectEndGameForbidden ErrorResponse

func (*RejectEndGameForbidden) Decode

func (s *RejectEndGameForbidden) Decode(d *jx.Decoder) error

Decode decodes RejectEndGameForbidden from json.

func (*RejectEndGameForbidden) Encode

func (s *RejectEndGameForbidden) Encode(e *jx.Encoder)

Encode encodes RejectEndGameForbidden as json.

func (*RejectEndGameForbidden) MarshalJSON

func (s *RejectEndGameForbidden) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*RejectEndGameForbidden) UnmarshalJSON

func (s *RejectEndGameForbidden) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type RejectEndGameNoContent

type RejectEndGameNoContent struct{}

RejectEndGameNoContent is response for RejectEndGame operation.

type RejectEndGameNotFound

type RejectEndGameNotFound ErrorResponse

func (*RejectEndGameNotFound) Decode

func (s *RejectEndGameNotFound) Decode(d *jx.Decoder) error

Decode decodes RejectEndGameNotFound from json.

func (*RejectEndGameNotFound) Encode

func (s *RejectEndGameNotFound) Encode(e *jx.Encoder)

Encode encodes RejectEndGameNotFound as json.

func (*RejectEndGameNotFound) MarshalJSON

func (s *RejectEndGameNotFound) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*RejectEndGameNotFound) UnmarshalJSON

func (s *RejectEndGameNotFound) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type RejectEndGameParams

type RejectEndGameParams struct {
	// ID of the game.
	ID uuid.UUID
}

RejectEndGameParams is parameters of rejectEndGame operation.

type RejectEndGameRes

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

type RejectEndGameUnauthorized

type RejectEndGameUnauthorized ErrorResponse

func (*RejectEndGameUnauthorized) Decode

func (s *RejectEndGameUnauthorized) Decode(d *jx.Decoder) error

Decode decodes RejectEndGameUnauthorized from json.

func (*RejectEndGameUnauthorized) Encode

func (s *RejectEndGameUnauthorized) Encode(e *jx.Encoder)

Encode encodes RejectEndGameUnauthorized as json.

func (*RejectEndGameUnauthorized) MarshalJSON

func (s *RejectEndGameUnauthorized) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*RejectEndGameUnauthorized) UnmarshalJSON

func (s *RejectEndGameUnauthorized) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type Route

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

Route is route object.

func (Route) Args

func (r Route) Args() []string

Args returns parsed arguments.

func (Route) Name

func (r Route) Name() string

Name returns ogen operation name.

It is guaranteed to be unique and not empty.

func (Route) OperationGroup

func (r Route) OperationGroup() string

OperationGroup returns the x-ogen-operation-group value.

func (Route) OperationID

func (r Route) OperationID() string

OperationID returns OpenAPI operationId.

func (Route) PathPattern

func (r Route) PathPattern() string

PathPattern returns OpenAPI path.

func (Route) Summary

func (r Route) Summary() string

Summary returns OpenAPI summary.

type SecurityHandler

type SecurityHandler interface {
	// HandleBearerAuth handles BearerAuth security.
	HandleBearerAuth(ctx context.Context, operationName OperationName, t BearerAuth) (context.Context, error)
}

SecurityHandler is handler for security parameters.

type SecuritySource

type SecuritySource interface {
	// BearerAuth provides BearerAuth security value.
	BearerAuth(ctx context.Context, operationName OperationName) (BearerAuth, error)
}

SecuritySource is provider of security values (tokens, passwords, etc.).

type Server

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

Server implements http server based on OpenAPI v3 specification and calls Handler to handle requests.

func NewServer

func NewServer(h Handler, sec SecurityHandler, opts ...ServerOption) (*Server, error)

NewServer creates new Server.

func (*Server) FindPath

func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool)

FindPath finds Route for given method and URL.

func (*Server) FindRoute

func (s *Server) FindRoute(method, path string) (Route, bool)

FindRoute finds Route for given method and path.

Note: this method does not unescape path or handle reserved characters in path properly. Use FindPath instead.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP serves http request as defined by OpenAPI v3 specification, calling handler that matches the path or returning not found error.

type ServerOption

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

ServerOption is server config option.

func WithErrorHandler

func WithErrorHandler(h ErrorHandler) ServerOption

WithErrorHandler specifies error handler to use.

func WithMaxMultipartMemory

func WithMaxMultipartMemory(max int64) ServerOption

WithMaxMultipartMemory specifies limit of memory for storing file parts. File parts which can't be stored in memory will be stored on disk in temporary files.

func WithMethodNotAllowed

func WithMethodNotAllowed(methodNotAllowed func(w http.ResponseWriter, r *http.Request, allowed string)) ServerOption

WithMethodNotAllowed specifies Method Not Allowed handler to use.

func WithMiddleware

func WithMiddleware(m ...Middleware) ServerOption

WithMiddleware specifies middlewares to use.

func WithNotFound

func WithNotFound(notFound http.HandlerFunc) ServerOption

WithNotFound specifies Not Found handler to use.

func WithPathPrefix

func WithPathPrefix(prefix string) ServerOption

WithPathPrefix specifies server path prefix.

type SignupRequest

type SignupRequest struct {
	// User's first name.
	Firstname string `json:"firstname"`
	// User's last name.
	Lastname string `json:"lastname"`
	// User's email.
	Email string `json:"email"`
	// User's password.
	Password string `json:"password"`
}

Ref: #/components/schemas/SignupRequest

func (*SignupRequest) Decode

func (s *SignupRequest) Decode(d *jx.Decoder) error

Decode decodes SignupRequest from json.

func (*SignupRequest) Encode

func (s *SignupRequest) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*SignupRequest) GetEmail

func (s *SignupRequest) GetEmail() string

GetEmail returns the value of Email.

func (*SignupRequest) GetFirstname

func (s *SignupRequest) GetFirstname() string

GetFirstname returns the value of Firstname.

func (*SignupRequest) GetLastname

func (s *SignupRequest) GetLastname() string

GetLastname returns the value of Lastname.

func (*SignupRequest) GetPassword

func (s *SignupRequest) GetPassword() string

GetPassword returns the value of Password.

func (*SignupRequest) MarshalJSON

func (s *SignupRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*SignupRequest) SetEmail

func (s *SignupRequest) SetEmail(val string)

SetEmail sets the value of Email.

func (*SignupRequest) SetFirstname

func (s *SignupRequest) SetFirstname(val string)

SetFirstname sets the value of Firstname.

func (*SignupRequest) SetLastname

func (s *SignupRequest) SetLastname(val string)

SetLastname sets the value of Lastname.

func (*SignupRequest) SetPassword

func (s *SignupRequest) SetPassword(val string)

SetPassword sets the value of Password.

func (*SignupRequest) UnmarshalJSON

func (s *SignupRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*SignupRequest) Validate

func (s *SignupRequest) Validate() error

type SignupRes

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

type SignupResponse

type SignupResponse struct {
	User OptPlayer `json:"user"`
	// Short-lived JWT access token (Authorization: Bearer).
	AccessToken OptString `json:"access_token"`
	// Opaque long-lived token used to obtain a new access token.
	RefreshToken OptString `json:"refresh_token"`
	// Always "Bearer".
	TokenType OptString `json:"token_type"`
	// Access token lifetime in seconds.
	ExpiresIn OptInt `json:"expires_in"`
	// JWT for connecting to the Centrifugo WebSocket.
	CentrifugoToken OptString `json:"centrifugo_token"`
	// Centrifugo subscription JWT for the lobby channel.
	LobbyToken OptString `json:"lobby_token"`
}

Ref: #/components/schemas/SignupResponse

func (*SignupResponse) Decode

func (s *SignupResponse) Decode(d *jx.Decoder) error

Decode decodes SignupResponse from json.

func (*SignupResponse) Encode

func (s *SignupResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*SignupResponse) GetAccessToken

func (s *SignupResponse) GetAccessToken() OptString

GetAccessToken returns the value of AccessToken.

func (*SignupResponse) GetCentrifugoToken

func (s *SignupResponse) GetCentrifugoToken() OptString

GetCentrifugoToken returns the value of CentrifugoToken.

func (*SignupResponse) GetExpiresIn

func (s *SignupResponse) GetExpiresIn() OptInt

GetExpiresIn returns the value of ExpiresIn.

func (*SignupResponse) GetLobbyToken

func (s *SignupResponse) GetLobbyToken() OptString

GetLobbyToken returns the value of LobbyToken.

func (*SignupResponse) GetRefreshToken

func (s *SignupResponse) GetRefreshToken() OptString

GetRefreshToken returns the value of RefreshToken.

func (*SignupResponse) GetTokenType

func (s *SignupResponse) GetTokenType() OptString

GetTokenType returns the value of TokenType.

func (*SignupResponse) GetUser

func (s *SignupResponse) GetUser() OptPlayer

GetUser returns the value of User.

func (*SignupResponse) MarshalJSON

func (s *SignupResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*SignupResponse) SetAccessToken

func (s *SignupResponse) SetAccessToken(val OptString)

SetAccessToken sets the value of AccessToken.

func (*SignupResponse) SetCentrifugoToken

func (s *SignupResponse) SetCentrifugoToken(val OptString)

SetCentrifugoToken sets the value of CentrifugoToken.

func (*SignupResponse) SetExpiresIn

func (s *SignupResponse) SetExpiresIn(val OptInt)

SetExpiresIn sets the value of ExpiresIn.

func (*SignupResponse) SetLobbyToken

func (s *SignupResponse) SetLobbyToken(val OptString)

SetLobbyToken sets the value of LobbyToken.

func (*SignupResponse) SetRefreshToken

func (s *SignupResponse) SetRefreshToken(val OptString)

SetRefreshToken sets the value of RefreshToken.

func (*SignupResponse) SetTokenType

func (s *SignupResponse) SetTokenType(val OptString)

SetTokenType sets the value of TokenType.

func (*SignupResponse) SetUser

func (s *SignupResponse) SetUser(val OptPlayer)

SetUser sets the value of User.

func (*SignupResponse) UnmarshalJSON

func (s *SignupResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type SkipGameConflict

type SkipGameConflict ErrorResponse

func (*SkipGameConflict) Decode

func (s *SkipGameConflict) Decode(d *jx.Decoder) error

Decode decodes SkipGameConflict from json.

func (*SkipGameConflict) Encode

func (s *SkipGameConflict) Encode(e *jx.Encoder)

Encode encodes SkipGameConflict as json.

func (*SkipGameConflict) MarshalJSON

func (s *SkipGameConflict) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*SkipGameConflict) UnmarshalJSON

func (s *SkipGameConflict) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type SkipGameForbidden

type SkipGameForbidden ErrorResponse

func (*SkipGameForbidden) Decode

func (s *SkipGameForbidden) Decode(d *jx.Decoder) error

Decode decodes SkipGameForbidden from json.

func (*SkipGameForbidden) Encode

func (s *SkipGameForbidden) Encode(e *jx.Encoder)

Encode encodes SkipGameForbidden as json.

func (*SkipGameForbidden) MarshalJSON

func (s *SkipGameForbidden) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*SkipGameForbidden) UnmarshalJSON

func (s *SkipGameForbidden) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type SkipGameNoContent

type SkipGameNoContent struct{}

SkipGameNoContent is response for SkipGame operation.

type SkipGameNotFound

type SkipGameNotFound ErrorResponse

func (*SkipGameNotFound) Decode

func (s *SkipGameNotFound) Decode(d *jx.Decoder) error

Decode decodes SkipGameNotFound from json.

func (*SkipGameNotFound) Encode

func (s *SkipGameNotFound) Encode(e *jx.Encoder)

Encode encodes SkipGameNotFound as json.

func (*SkipGameNotFound) MarshalJSON

func (s *SkipGameNotFound) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*SkipGameNotFound) UnmarshalJSON

func (s *SkipGameNotFound) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type SkipGameParams

type SkipGameParams struct {
	// ID of the game.
	ID uuid.UUID
}

SkipGameParams is parameters of skipGame operation.

type SkipGameRes

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

type SkipGameUnauthorized

type SkipGameUnauthorized ErrorResponse

func (*SkipGameUnauthorized) Decode

func (s *SkipGameUnauthorized) Decode(d *jx.Decoder) error

Decode decodes SkipGameUnauthorized from json.

func (*SkipGameUnauthorized) Encode

func (s *SkipGameUnauthorized) Encode(e *jx.Encoder)

Encode encodes SkipGameUnauthorized as json.

func (*SkipGameUnauthorized) MarshalJSON

func (s *SkipGameUnauthorized) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*SkipGameUnauthorized) UnmarshalJSON

func (s *SkipGameUnauthorized) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type TelegramAuthRequest

type TelegramAuthRequest struct {
	// Raw init data string provided by the Telegram WebView (window.Telegram.WebApp.initData).
	InitData string `json:"init_data"`
}

Ref: #/components/schemas/TelegramAuthRequest

func (*TelegramAuthRequest) Decode

func (s *TelegramAuthRequest) Decode(d *jx.Decoder) error

Decode decodes TelegramAuthRequest from json.

func (*TelegramAuthRequest) Encode

func (s *TelegramAuthRequest) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*TelegramAuthRequest) GetInitData

func (s *TelegramAuthRequest) GetInitData() string

GetInitData returns the value of InitData.

func (*TelegramAuthRequest) MarshalJSON

func (s *TelegramAuthRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*TelegramAuthRequest) SetInitData

func (s *TelegramAuthRequest) SetInitData(val string)

SetInitData sets the value of InitData.

func (*TelegramAuthRequest) UnmarshalJSON

func (s *TelegramAuthRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type UnimplementedHandler

type UnimplementedHandler struct{}

UnimplementedHandler is no-op Handler which returns http.ErrNotImplemented.

func (UnimplementedHandler) AcceptEndGame

AcceptEndGame implements acceptEndGame operation.

The opponent accepts the end-game proposal. The game ends immediately with the current scores. Only the non-proposing player may call this.

POST /games/{id}/accept-end

func (UnimplementedHandler) Auth

Auth implements auth operation.

Auth request.

POST /auth

func (UnimplementedHandler) AuthTelegram

AuthTelegram implements authTelegram operation.

Validates the signed init data produced by the Telegram WebView against the bot token, then logs in an existing user or creates a new one linked to their Telegram account.

POST /auth/telegram

func (UnimplementedHandler) CreateGame

func (UnimplementedHandler) CreateGame(ctx context.Context) (r CreateGameRes, _ error)

CreateGame implements createGame operation.

Create a new game.

POST /games

func (UnimplementedHandler) CreateGameWithBot

func (UnimplementedHandler) CreateGameWithBot(ctx context.Context) (r CreateGameWithBotRes, _ error)

CreateGameWithBot implements createGameWithBot operation.

Creates a new game where the authenticated player plays against a server-side bot. The game starts immediately and the first move belongs to the human player.

POST /games/with-bot

func (UnimplementedHandler) GetConfig

func (UnimplementedHandler) GetConfig(ctx context.Context) (r *ConfigResponse, _ error)

GetConfig implements getConfig operation.

Returns feature flags the client needs before authentication, e.g. whether email/password registration is available.

GET /config

func (UnimplementedHandler) GetLeaderboard

GetLeaderboard implements getLeaderboard operation.

Returns the top players by current rating or total EXP who were active during the requested period. Results are cached for 5 minutes.

GET /leaderboard

func (UnimplementedHandler) GetPlayerAchievements

func (UnimplementedHandler) GetPlayerAchievements(ctx context.Context) (r GetPlayerAchievementsRes, _ error)

GetPlayerAchievements implements getPlayerAchievements operation.

Returns the full list of achievements with their unlocked status for the currently authenticated player.

GET /player/achievements

func (UnimplementedHandler) GetPlayerStateUID

GetPlayerStateUID implements getPlayerStateUID operation.

Get user state.

GET /player/state/{uid}

func (UnimplementedHandler) GetPlayerStats

func (UnimplementedHandler) GetPlayerStats(ctx context.Context) (r GetPlayerStatsRes, _ error)

GetPlayerStats implements getPlayerStats operation.

Returns lifetime aggregated statistics for the currently authenticated player: games played, wins/losses/draws, win rate, average word length, best word and favorite letter.

GET /player/stats

func (UnimplementedHandler) JoinGame

func (UnimplementedHandler) JoinGame(ctx context.Context, params JoinGameParams) (r JoinGameRes, _ error)

JoinGame implements joinGame operation.

Adds the authenticated player to the specified waiting game. When the second player joins (quorum of 2 is reached) the game transitions to in_progress and the first move belongs to the player who created the game.

POST /games/{id}/join

func (UnimplementedHandler) LeaveGame

func (UnimplementedHandler) LeaveGame(ctx context.Context, params LeaveGameParams) (r LeaveGameRes, _ error)

LeaveGame implements leaveGame operation.

Removes the player from a game in waiting status. If the game becomes empty, it is deleted. In-progress games cannot be left this way.

POST /games/{id}/leave

func (UnimplementedHandler) ListGames

func (UnimplementedHandler) ListGames(ctx context.Context) (r ListGamesRes, _ error)

ListGames implements listGames operation.

Returns a snapshot of all currently active games.

GET /games

func (UnimplementedHandler) Logout

Logout implements logout operation.

Revoke the current refresh token.

POST /auth/logout

func (UnimplementedHandler) MatchmakingJoin

func (UnimplementedHandler) MatchmakingJoin(ctx context.Context) (r MatchmakingJoinRes, _ error)

MatchmakingJoin implements matchmakingJoin operation.

Enqueues the player for quick matchmaking. When a human opponent with a close rating is found, a match_found event is published to the lobby channel; after a timeout the server starts a bot game.

POST /matchmaking/join

func (UnimplementedHandler) MatchmakingLeave

func (UnimplementedHandler) MatchmakingLeave(ctx context.Context) (r MatchmakingLeaveRes, _ error)

MatchmakingLeave implements matchmakingLeave operation.

Idempotent — leaving without being queued is not an error.

POST /matchmaking/leave

func (UnimplementedHandler) MoveGame

func (UnimplementedHandler) MoveGame(ctx context.Context, req *MoveRequest, params MoveGameParams) (r MoveGameRes, _ error)

MoveGame implements moveGame operation.

Places a new letter on the board and submits a word. If the word is valid, the player's score is updated and the turn passes to the opponent.

POST /games/{id}/move

func (UnimplementedHandler) Ping

func (UnimplementedHandler) Ping(ctx context.Context, params PingParams) (r PingRes, _ error)

Ping implements ping operation.

POST not GET — mutates session TTL. Returns 204 with X-Server-Time header instead of a JSON body to minimize bandwidth on frequent pings (every ping_delay ms).

POST /session/ping

func (UnimplementedHandler) ProposeEndGame

ProposeEndGame implements proposeEndGame operation.

The current player proposes to end the game (e.g. no valid moves are available). The turn timer is paused until the opponent responds. Only the player whose turn it currently is may call this.

POST /games/{id}/propose-end

func (UnimplementedHandler) RefreshToken

RefreshToken implements refreshToken operation.

Exchange a refresh token for a new access/refresh pair.

POST /auth/refresh

func (UnimplementedHandler) RejectEndGame

RejectEndGame implements rejectEndGame operation.

The opponent rejects the end-game proposal. The game resumes with the remaining turn time (minimum 10 seconds). Only the non-proposing player may call this.

POST /games/{id}/reject-end

func (UnimplementedHandler) Signup

Signup implements signup operation.

Sign-up request.

POST /signup

func (UnimplementedHandler) SkipGame

func (UnimplementedHandler) SkipGame(ctx context.Context, params SkipGameParams) (r SkipGameRes, _ error)

SkipGame implements skipGame operation.

Ends the current turn without making a move. The turn passes to the opponent.

POST /games/{id}/skip

Jump to

Keyboard shortcuts

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