Documentation
¶
Overview ¶
Code generated by ogen, DO NOT EDIT.
Index ¶
- func GetRolesForAPIKeyHeader(operation string) []string
- func GetRolesForAPIKeyQueryParam(operation string) []string
- func WithServerURL(ctx context.Context, u *url.URL) context.Context
- type APIKeyHeader
- type APIKeyQueryParam
- type AuthRequest
- func (s *AuthRequest) Decode(d *jx.Decoder) error
- func (s *AuthRequest) Encode(e *jx.Encoder)
- func (s *AuthRequest) GetEmail() string
- func (s *AuthRequest) GetPassword() string
- func (s *AuthRequest) MarshalJSON() ([]byte, error)
- func (s *AuthRequest) SetEmail(val string)
- func (s *AuthRequest) SetPassword(val string)
- func (s *AuthRequest) UnmarshalJSON(data []byte) error
- type AuthRes
- type AuthResponse
- func (s *AuthResponse) Decode(d *jx.Decoder) error
- func (s *AuthResponse) Encode(e *jx.Encoder)
- func (s *AuthResponse) GetCentrifugoToken() OptString
- func (s *AuthResponse) GetLobbyToken() OptString
- func (s *AuthResponse) GetPlayer() OptPlayer
- func (s *AuthResponse) MarshalJSON() ([]byte, error)
- func (s *AuthResponse) SetCentrifugoToken(val OptString)
- func (s *AuthResponse) SetLobbyToken(val OptString)
- func (s *AuthResponse) SetPlayer(val OptPlayer)
- func (s *AuthResponse) UnmarshalJSON(data []byte) error
- type BoardCell
- func (s *BoardCell) Decode(d *jx.Decoder) error
- func (s *BoardCell) Encode(e *jx.Encoder)
- func (s *BoardCell) GetCol() int
- func (s *BoardCell) GetRow() int
- func (s *BoardCell) MarshalJSON() ([]byte, error)
- func (s *BoardCell) SetCol(val int)
- func (s *BoardCell) SetRow(val int)
- func (s *BoardCell) UnmarshalJSON(data []byte) error
- func (s *BoardCell) Validate() error
- type Client
- func (c *Client) Auth(ctx context.Context, request *AuthRequest) (AuthRes, error)
- func (c *Client) CreateGame(ctx context.Context, params CreateGameParams) (CreateGameRes, error)
- func (c *Client) GetPlayerStateUID(ctx context.Context, params GetPlayerStateUIDParams) (GetPlayerStateUIDRes, error)
- func (c *Client) JoinGame(ctx context.Context, params JoinGameParams) (JoinGameRes, error)
- func (c *Client) ListGames(ctx context.Context, params ListGamesParams) (ListGamesRes, error)
- func (c *Client) MoveGame(ctx context.Context, request *MoveRequest, params MoveGameParams) (MoveGameRes, error)
- func (c *Client) Ping(ctx context.Context, params PingParams) (PingRes, error)
- func (c *Client) Signup(ctx context.Context, request *SignupRequest) (SignupRes, error)
- func (c *Client) SkipGame(ctx context.Context, params SkipGameParams) (SkipGameRes, error)
- type ClientOption
- type CreateGameParams
- type CreateGameRes
- type CreateGameResponse
- func (s *CreateGameResponse) Decode(d *jx.Decoder) error
- func (s *CreateGameResponse) Encode(e *jx.Encoder)
- func (s *CreateGameResponse) GetGame() OptGameSummary
- func (s *CreateGameResponse) GetGameToken() OptString
- func (s *CreateGameResponse) MarshalJSON() ([]byte, error)
- func (s *CreateGameResponse) SetGame(val OptGameSummary)
- func (s *CreateGameResponse) SetGameToken(val OptString)
- func (s *CreateGameResponse) UnmarshalJSON(data []byte) error
- func (s *CreateGameResponse) Validate() error
- type ErrorHandler
- type ErrorResponse
- func (s *ErrorResponse) Decode(d *jx.Decoder) error
- func (s *ErrorResponse) Encode(e *jx.Encoder)
- func (s *ErrorResponse) GetMessage() OptString
- func (s *ErrorResponse) GetStatus() OptInt
- func (s *ErrorResponse) GetType() OptString
- func (s *ErrorResponse) MarshalJSON() ([]byte, error)
- func (s *ErrorResponse) SetMessage(val OptString)
- func (s *ErrorResponse) SetStatus(val OptInt)
- func (s *ErrorResponse) SetType(val OptString)
- func (s *ErrorResponse) UnmarshalJSON(data []byte) error
- type GameStatus
- func (GameStatus) AllValues() []GameStatus
- func (s *GameStatus) Decode(d *jx.Decoder) error
- func (s GameStatus) Encode(e *jx.Encoder)
- func (s GameStatus) MarshalJSON() ([]byte, error)
- func (s GameStatus) MarshalText() ([]byte, error)
- func (s *GameStatus) UnmarshalJSON(data []byte) error
- func (s *GameStatus) UnmarshalText(data []byte) error
- func (s GameStatus) Validate() error
- type GameSummary
- func (s *GameSummary) Decode(d *jx.Decoder) error
- func (s *GameSummary) Encode(e *jx.Encoder)
- func (s *GameSummary) GetID() OptUUID
- func (s *GameSummary) GetPlayerIds() []uuid.UUID
- func (s *GameSummary) GetStartedAt() OptInt64
- func (s *GameSummary) GetStatus() OptGameStatus
- func (s *GameSummary) MarshalJSON() ([]byte, error)
- func (s *GameSummary) SetID(val OptUUID)
- func (s *GameSummary) SetPlayerIds(val []uuid.UUID)
- func (s *GameSummary) SetStartedAt(val OptInt64)
- func (s *GameSummary) SetStatus(val OptGameStatus)
- func (s *GameSummary) UnmarshalJSON(data []byte) error
- func (s *GameSummary) Validate() error
- type GetPlayerStateUIDParams
- type GetPlayerStateUIDRes
- type Handler
- type Invoker
- type JoinGameConflict
- type JoinGameNotFound
- type JoinGameParams
- type JoinGameRes
- type JoinGameResponse
- func (s *JoinGameResponse) Decode(d *jx.Decoder) error
- func (s *JoinGameResponse) Encode(e *jx.Encoder)
- func (s *JoinGameResponse) GetBoard() [][]string
- func (s *JoinGameResponse) GetCurrentTurnUID() OptString
- func (s *JoinGameResponse) GetGame() OptGameSummary
- func (s *JoinGameResponse) GetGameToken() OptString
- func (s *JoinGameResponse) MarshalJSON() ([]byte, error)
- func (s *JoinGameResponse) SetBoard(val [][]string)
- func (s *JoinGameResponse) SetCurrentTurnUID(val OptString)
- func (s *JoinGameResponse) SetGame(val OptGameSummary)
- func (s *JoinGameResponse) SetGameToken(val OptString)
- func (s *JoinGameResponse) UnmarshalJSON(data []byte) error
- func (s *JoinGameResponse) Validate() error
- type JoinGameUnauthorized
- type Labeler
- type ListGamesParams
- type ListGamesRes
- type ListGamesResponse
- func (s *ListGamesResponse) Decode(d *jx.Decoder) error
- func (s *ListGamesResponse) Encode(e *jx.Encoder)
- func (s *ListGamesResponse) GetGames() []GameSummary
- func (s *ListGamesResponse) MarshalJSON() ([]byte, error)
- func (s *ListGamesResponse) SetGames(val []GameSummary)
- func (s *ListGamesResponse) UnmarshalJSON(data []byte) error
- func (s *ListGamesResponse) Validate() error
- type Middleware
- type MoveGameBadRequest
- type MoveGameConflict
- type MoveGameNotFound
- type MoveGameParams
- type MoveGameRes
- type MoveGameUnauthorized
- type MoveRequest
- func (s *MoveRequest) Decode(d *jx.Decoder) error
- func (s *MoveRequest) Encode(e *jx.Encoder)
- func (s *MoveRequest) GetNewLetter() MoveRequestNewLetter
- func (s *MoveRequest) GetWordPath() []BoardCell
- func (s *MoveRequest) MarshalJSON() ([]byte, error)
- func (s *MoveRequest) SetNewLetter(val MoveRequestNewLetter)
- func (s *MoveRequest) SetWordPath(val []BoardCell)
- func (s *MoveRequest) UnmarshalJSON(data []byte) error
- func (s *MoveRequest) Validate() error
- type MoveRequestNewLetter
- func (s *MoveRequestNewLetter) Decode(d *jx.Decoder) error
- func (s *MoveRequestNewLetter) Encode(e *jx.Encoder)
- func (s *MoveRequestNewLetter) GetChar() string
- func (s *MoveRequestNewLetter) GetCol() int
- func (s *MoveRequestNewLetter) GetRow() int
- func (s *MoveRequestNewLetter) MarshalJSON() ([]byte, error)
- func (s *MoveRequestNewLetter) SetChar(val string)
- func (s *MoveRequestNewLetter) SetCol(val int)
- func (s *MoveRequestNewLetter) SetRow(val int)
- func (s *MoveRequestNewLetter) UnmarshalJSON(data []byte) error
- func (s *MoveRequestNewLetter) Validate() error
- type MoveResponse
- func (s *MoveResponse) Decode(d *jx.Decoder) error
- func (s *MoveResponse) Encode(e *jx.Encoder)
- func (s *MoveResponse) GetBoard() [][]string
- func (s *MoveResponse) GetCurrentTurnUID() OptUUID
- func (s *MoveResponse) GetMoveNumber() OptInt
- func (s *MoveResponse) GetPlayers() []PlayerGameState
- func (s *MoveResponse) GetStatus() OptGameStatus
- func (s *MoveResponse) MarshalJSON() ([]byte, error)
- func (s *MoveResponse) SetBoard(val [][]string)
- func (s *MoveResponse) SetCurrentTurnUID(val OptUUID)
- func (s *MoveResponse) SetMoveNumber(val OptInt)
- func (s *MoveResponse) SetPlayers(val []PlayerGameState)
- func (s *MoveResponse) SetStatus(val OptGameStatus)
- func (s *MoveResponse) UnmarshalJSON(data []byte) error
- func (s *MoveResponse) Validate() error
- type OperationName
- type OptGameStatus
- func (o *OptGameStatus) Decode(d *jx.Decoder) error
- func (o OptGameStatus) Encode(e *jx.Encoder)
- func (o OptGameStatus) Get() (v GameStatus, ok bool)
- func (o OptGameStatus) IsSet() bool
- func (s OptGameStatus) MarshalJSON() ([]byte, error)
- func (o OptGameStatus) Or(d GameStatus) GameStatus
- func (o *OptGameStatus) Reset()
- func (o *OptGameStatus) SetTo(v GameStatus)
- func (s *OptGameStatus) UnmarshalJSON(data []byte) error
- type OptGameSummary
- func (o *OptGameSummary) Decode(d *jx.Decoder) error
- func (o OptGameSummary) Encode(e *jx.Encoder)
- func (o OptGameSummary) Get() (v GameSummary, ok bool)
- func (o OptGameSummary) IsSet() bool
- func (s OptGameSummary) MarshalJSON() ([]byte, error)
- func (o OptGameSummary) Or(d GameSummary) GameSummary
- func (o *OptGameSummary) Reset()
- func (o *OptGameSummary) SetTo(v GameSummary)
- func (s *OptGameSummary) UnmarshalJSON(data []byte) error
- type OptInt
- func (o *OptInt) Decode(d *jx.Decoder) error
- func (o OptInt) Encode(e *jx.Encoder)
- func (o OptInt) Get() (v int, ok bool)
- func (o OptInt) IsSet() bool
- func (s OptInt) MarshalJSON() ([]byte, error)
- func (o OptInt) Or(d int) int
- func (o *OptInt) Reset()
- func (o *OptInt) SetTo(v int)
- func (s *OptInt) UnmarshalJSON(data []byte) error
- type OptInt64
- func (o *OptInt64) Decode(d *jx.Decoder) error
- func (o OptInt64) Encode(e *jx.Encoder)
- func (o OptInt64) Get() (v int64, ok bool)
- func (o OptInt64) IsSet() bool
- func (s OptInt64) MarshalJSON() ([]byte, error)
- func (o OptInt64) Or(d int64) int64
- func (o *OptInt64) Reset()
- func (o *OptInt64) SetTo(v int64)
- func (s *OptInt64) UnmarshalJSON(data []byte) error
- type OptPlayer
- func (o *OptPlayer) Decode(d *jx.Decoder) error
- func (o OptPlayer) Encode(e *jx.Encoder)
- func (o OptPlayer) Get() (v Player, ok bool)
- func (o OptPlayer) IsSet() bool
- func (s OptPlayer) MarshalJSON() ([]byte, error)
- func (o OptPlayer) Or(d Player) Player
- func (o *OptPlayer) Reset()
- func (o *OptPlayer) SetTo(v Player)
- func (s *OptPlayer) UnmarshalJSON(data []byte) error
- type OptString
- func (o *OptString) Decode(d *jx.Decoder) error
- func (o OptString) Encode(e *jx.Encoder)
- func (o OptString) Get() (v string, ok bool)
- func (o OptString) IsSet() bool
- func (s OptString) MarshalJSON() ([]byte, error)
- func (o OptString) Or(d string) string
- func (o *OptString) Reset()
- func (o *OptString) SetTo(v string)
- func (s *OptString) UnmarshalJSON(data []byte) error
- type OptUUID
- func (o *OptUUID) Decode(d *jx.Decoder) error
- func (o OptUUID) Encode(e *jx.Encoder)
- func (o OptUUID) Get() (v uuid.UUID, ok bool)
- func (o OptUUID) IsSet() bool
- func (s OptUUID) MarshalJSON() ([]byte, error)
- func (o OptUUID) Or(d uuid.UUID) uuid.UUID
- func (o *OptUUID) Reset()
- func (o *OptUUID) SetTo(v uuid.UUID)
- func (s *OptUUID) UnmarshalJSON(data []byte) error
- type Option
- type PingNoContent
- type PingParams
- type PingRes
- type Player
- func (s *Player) Decode(d *jx.Decoder) error
- func (s *Player) Encode(e *jx.Encoder)
- func (s *Player) GetFirstname() OptString
- func (s *Player) GetKey() OptString
- func (s *Player) GetLastname() OptString
- func (s *Player) GetSid() OptString
- func (s *Player) GetUID() OptUUID
- func (s *Player) MarshalJSON() ([]byte, error)
- func (s *Player) SetFirstname(val OptString)
- func (s *Player) SetKey(val OptString)
- func (s *Player) SetLastname(val OptString)
- func (s *Player) SetSid(val OptString)
- func (s *Player) SetUID(val OptUUID)
- func (s *Player) UnmarshalJSON(data []byte) error
- type PlayerGameState
- func (s *PlayerGameState) Decode(d *jx.Decoder) error
- func (s *PlayerGameState) Encode(e *jx.Encoder)
- func (s *PlayerGameState) GetScore() OptInt
- func (s *PlayerGameState) GetUID() OptUUID
- func (s *PlayerGameState) GetWords() []string
- func (s *PlayerGameState) GetWordsCount() OptInt
- func (s *PlayerGameState) MarshalJSON() ([]byte, error)
- func (s *PlayerGameState) SetScore(val OptInt)
- func (s *PlayerGameState) SetUID(val OptUUID)
- func (s *PlayerGameState) SetWords(val []string)
- func (s *PlayerGameState) SetWordsCount(val OptInt)
- func (s *PlayerGameState) UnmarshalJSON(data []byte) error
- type PlayerState
- func (s *PlayerState) Decode(d *jx.Decoder) error
- func (s *PlayerState) Encode(e *jx.Encoder)
- func (s *PlayerState) GetExp() OptInt64
- func (s *PlayerState) GetFlags() OptInt64
- func (s *PlayerState) GetGameID() OptUUID
- func (s *PlayerState) GetLives() OptInt64
- func (s *PlayerState) GetNickname() OptString
- func (s *PlayerState) GetUID() OptUUID
- func (s *PlayerState) MarshalJSON() ([]byte, error)
- func (s *PlayerState) SetExp(val OptInt64)
- func (s *PlayerState) SetFlags(val OptInt64)
- func (s *PlayerState) SetGameID(val OptUUID)
- func (s *PlayerState) SetLives(val OptInt64)
- func (s *PlayerState) SetNickname(val OptString)
- func (s *PlayerState) SetUID(val OptUUID)
- func (s *PlayerState) UnmarshalJSON(data []byte) error
- type Route
- type SecurityHandler
- type SecuritySource
- type Server
- type ServerOption
- func WithErrorHandler(h ErrorHandler) ServerOption
- func WithMaxMultipartMemory(max int64) ServerOption
- func WithMethodNotAllowed(methodNotAllowed func(w http.ResponseWriter, r *http.Request, allowed string)) ServerOption
- func WithMiddleware(m ...Middleware) ServerOption
- func WithNotFound(notFound http.HandlerFunc) ServerOption
- func WithPathPrefix(prefix string) ServerOption
- type SignupRequest
- func (s *SignupRequest) Decode(d *jx.Decoder) error
- func (s *SignupRequest) Encode(e *jx.Encoder)
- func (s *SignupRequest) GetEmail() string
- func (s *SignupRequest) GetFirstname() string
- func (s *SignupRequest) GetLastname() string
- func (s *SignupRequest) GetPassword() string
- func (s *SignupRequest) MarshalJSON() ([]byte, error)
- func (s *SignupRequest) SetEmail(val string)
- func (s *SignupRequest) SetFirstname(val string)
- func (s *SignupRequest) SetLastname(val string)
- func (s *SignupRequest) SetPassword(val string)
- func (s *SignupRequest) UnmarshalJSON(data []byte) error
- func (s *SignupRequest) Validate() error
- type SignupRes
- type SignupResponse
- func (s *SignupResponse) Decode(d *jx.Decoder) error
- func (s *SignupResponse) Encode(e *jx.Encoder)
- func (s *SignupResponse) GetCentrifugoToken() OptString
- func (s *SignupResponse) GetLobbyToken() OptString
- func (s *SignupResponse) GetUser() OptPlayer
- func (s *SignupResponse) MarshalJSON() ([]byte, error)
- func (s *SignupResponse) SetCentrifugoToken(val OptString)
- func (s *SignupResponse) SetLobbyToken(val OptString)
- func (s *SignupResponse) SetUser(val OptPlayer)
- func (s *SignupResponse) UnmarshalJSON(data []byte) error
- type SkipGameConflict
- type SkipGameNoContent
- type SkipGameNotFound
- type SkipGameParams
- type SkipGameRes
- type SkipGameUnauthorized
- type UnimplementedHandler
- func (UnimplementedHandler) Auth(ctx context.Context, req *AuthRequest) (r AuthRes, _ error)
- func (UnimplementedHandler) CreateGame(ctx context.Context, params CreateGameParams) (r CreateGameRes, _ error)
- func (UnimplementedHandler) GetPlayerStateUID(ctx context.Context, params GetPlayerStateUIDParams) (r GetPlayerStateUIDRes, _ error)
- func (UnimplementedHandler) JoinGame(ctx context.Context, params JoinGameParams) (r JoinGameRes, _ error)
- func (UnimplementedHandler) ListGames(ctx context.Context, params ListGamesParams) (r ListGamesRes, _ error)
- func (UnimplementedHandler) MoveGame(ctx context.Context, req *MoveRequest, params MoveGameParams) (r MoveGameRes, _ error)
- func (UnimplementedHandler) Ping(ctx context.Context, params PingParams) (r PingRes, _ error)
- func (UnimplementedHandler) Signup(ctx context.Context, req *SignupRequest) (r SignupRes, _ error)
- func (UnimplementedHandler) SkipGame(ctx context.Context, params SkipGameParams) (r SkipGameRes, _ error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetRolesForAPIKeyHeader ¶
GetRolesForAPIKeyHeader 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 := GetRolesForAPIKeyHeader(AddPetOperation)
Returns nil if the operation has no role requirements or if the operation is unknown.
func GetRolesForAPIKeyQueryParam ¶
GetRolesForAPIKeyQueryParam 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 := GetRolesForAPIKeyQueryParam(AddPetOperation)
Returns nil if the operation has no role requirements or if the operation is unknown.
Types ¶
type APIKeyHeader ¶
func (*APIKeyHeader) GetAPIKey ¶
func (s *APIKeyHeader) GetAPIKey() string
GetAPIKey returns the value of APIKey.
func (*APIKeyHeader) GetRoles ¶
func (s *APIKeyHeader) GetRoles() []string
GetRoles returns the value of Roles.
func (*APIKeyHeader) SetAPIKey ¶
func (s *APIKeyHeader) SetAPIKey(val string)
SetAPIKey sets the value of APIKey.
func (*APIKeyHeader) SetRoles ¶
func (s *APIKeyHeader) SetRoles(val []string)
SetRoles sets the value of Roles.
type APIKeyQueryParam ¶
func (*APIKeyQueryParam) GetAPIKey ¶
func (s *APIKeyQueryParam) GetAPIKey() string
GetAPIKey returns the value of APIKey.
func (*APIKeyQueryParam) GetRoles ¶
func (s *APIKeyQueryParam) GetRoles() []string
GetRoles returns the value of Roles.
func (*APIKeyQueryParam) SetAPIKey ¶
func (s *APIKeyQueryParam) SetAPIKey(val string)
SetAPIKey sets the value of APIKey.
func (*APIKeyQueryParam) SetRoles ¶
func (s *APIKeyQueryParam) SetRoles(val []string)
SetRoles sets the value of Roles.
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 AuthResponse ¶
type AuthResponse struct {
Player OptPlayer `json:"player"`
// 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/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) GetCentrifugoToken ¶
func (s *AuthResponse) GetCentrifugoToken() OptString
GetCentrifugoToken returns the value of CentrifugoToken.
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) MarshalJSON ¶
func (s *AuthResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*AuthResponse) SetCentrifugoToken ¶
func (s *AuthResponse) SetCentrifugoToken(val OptString)
SetCentrifugoToken sets the value of CentrifugoToken.
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) UnmarshalJSON ¶
func (s *AuthResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type BoardCell ¶
Ref: #/components/schemas/BoardCell
func (*BoardCell) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*BoardCell) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
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) CreateGame ¶
func (c *Client) CreateGame(ctx context.Context, params CreateGameParams) (CreateGameRes, error)
CreateGame invokes createGame operation.
Create a new game.
POST /games
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) 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) ListGames ¶
func (c *Client) ListGames(ctx context.Context, params ListGamesParams) (ListGamesRes, error)
ListGames invokes listGames operation.
Returns a snapshot of all currently active games.
GET /games
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 ¶
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) 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 CreateGameParams ¶
type CreateGameParams struct {
XAPISession string
}
CreateGameParams is parameters of createGame operation.
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 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"`
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) GetPlayerIds ¶
func (s *GameSummary) GetPlayerIds() []uuid.UUID
GetPlayerIds returns the value of PlayerIds.
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) SetPlayerIds ¶
func (s *GameSummary) SetPlayerIds(val []uuid.UUID)
SetPlayerIds sets the value of PlayerIds.
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 GetPlayerStateUIDParams ¶
GetPlayerStateUIDParams is parameters of getPlayerStateUID operation.
type GetPlayerStateUIDRes ¶
type GetPlayerStateUIDRes interface {
// contains filtered or unexported methods
}
type Handler ¶
type Handler interface {
// Auth implements auth operation.
//
// Auth request.
//
// POST /auth
Auth(ctx context.Context, req *AuthRequest) (AuthRes, error)
// CreateGame implements createGame operation.
//
// Create a new game.
//
// POST /games
CreateGame(ctx context.Context, params CreateGameParams) (CreateGameRes, error)
// GetPlayerStateUID implements getPlayerStateUID operation.
//
// Get user state.
//
// GET /player/state/{uid}
GetPlayerStateUID(ctx context.Context, params GetPlayerStateUIDParams) (GetPlayerStateUIDRes, 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)
// ListGames implements listGames operation.
//
// Returns a snapshot of all currently active games.
//
// GET /games
ListGames(ctx context.Context, params ListGamesParams) (ListGamesRes, 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)
// 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 {
// Auth invokes auth operation.
//
// Auth request.
//
// POST /auth
Auth(ctx context.Context, request *AuthRequest) (AuthRes, error)
// CreateGame invokes createGame operation.
//
// Create a new game.
//
// POST /games
CreateGame(ctx context.Context, params CreateGameParams) (CreateGameRes, error)
// GetPlayerStateUID invokes getPlayerStateUID operation.
//
// Get user state.
//
// GET /player/state/{uid}
GetPlayerStateUID(ctx context.Context, params GetPlayerStateUIDParams) (GetPlayerStateUIDRes, 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)
// ListGames invokes listGames operation.
//
// Returns a snapshot of all currently active games.
//
// GET /games
ListGames(ctx context.Context, params ListGamesParams) (ListGamesRes, 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)
// 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 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 ¶
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 ¶
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) AttributeSet ¶
AttributeSet returns the attributes added to the Labeler as an attribute.Set.
type ListGamesParams ¶
type ListGamesParams struct {
XAPISession string
}
ListGamesParams is parameters of listGames operation.
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 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 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 ¶
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 ( AuthOperation OperationName = "Auth" CreateGameOperation OperationName = "CreateGame" GetPlayerStateUIDOperation OperationName = "GetPlayerStateUID" JoinGameOperation OperationName = "JoinGame" ListGamesOperation OperationName = "ListGames" MoveGameOperation OperationName = "MoveGame" PingOperation OperationName = "Ping" SignupOperation OperationName = "Signup" SkipGameOperation OperationName = "SkipGame" )
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 ¶
func (o OptGameStatus) Or(d GameStatus) GameStatus
Or returns value if set, or given parameter if does not.
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 ¶
func (o OptGameSummary) Or(d GameSummary) GameSummary
Or returns value if set, or given parameter if does not.
func (*OptGameSummary) UnmarshalJSON ¶
func (s *OptGameSummary) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type OptInt ¶
OptInt is optional int.
func (OptInt) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*OptInt) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type OptInt64 ¶
OptInt64 is optional int64.
func NewOptInt64 ¶
NewOptInt64 returns new OptInt64 with value set to v.
func (OptInt64) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*OptInt64) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type OptPlayer ¶
OptPlayer is optional Player.
func NewOptPlayer ¶
NewOptPlayer returns new OptPlayer with value set to v.
func (OptPlayer) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*OptPlayer) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type OptString ¶
OptString is optional string.
func NewOptString ¶
NewOptString returns new OptString with value set to v.
func (OptString) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*OptString) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type OptUUID ¶
OptUUID is optional uuid.UUID.
func NewOptUUID ¶
NewOptUUID returns new OptUUID with value set to v.
func (OptUUID) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*OptUUID) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type Option ¶
type Option interface {
ServerOption
ClientOption
}
Option is config option.
func WithAttributes ¶
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 ¶
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 ¶
PingParams is parameters of ping operation.
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 session ID.
Sid OptString `json:"sid"`
// Player's API Key that the client needs to provide when making API calls.
Key OptString `json:"key"`
}
Ref: #/components/schemas/Player
func (*Player) GetFirstname ¶
GetFirstname returns the value of Firstname.
func (*Player) GetLastname ¶
GetLastname returns the value of Lastname.
func (*Player) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Player) SetFirstname ¶
SetFirstname sets the value of Firstname.
func (*Player) SetLastname ¶
SetLastname sets the value of Lastname.
func (*Player) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type PlayerGameState ¶
type PlayerGameState struct {
// Player's ID.
UID OptUUID `json:"uid"`
// 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) 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) 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 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) 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) 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 Route ¶
type Route struct {
// contains filtered or unexported fields
}
Route is route object.
func (Route) OperationGroup ¶
OperationGroup returns the x-ogen-operation-group value.
func (Route) OperationID ¶
OperationID returns OpenAPI operationId.
type SecurityHandler ¶
type SecurityHandler interface {
// HandleAPIKeyHeader handles APIKeyHeader security.
HandleAPIKeyHeader(ctx context.Context, operationName OperationName, t APIKeyHeader) (context.Context, error)
// HandleAPIKeyQueryParam handles APIKeyQueryParam security.
HandleAPIKeyQueryParam(ctx context.Context, operationName OperationName, t APIKeyQueryParam) (context.Context, error)
}
SecurityHandler is handler for security parameters.
type SecuritySource ¶
type SecuritySource interface {
// APIKeyHeader provides APIKeyHeader security value.
APIKeyHeader(ctx context.Context, operationName OperationName) (APIKeyHeader, error)
// APIKeyQueryParam provides APIKeyQueryParam security value.
APIKeyQueryParam(ctx context.Context, operationName OperationName) (APIKeyQueryParam, 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.
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 SignupResponse ¶
type SignupResponse struct {
User OptPlayer `json:"user"`
// 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) GetCentrifugoToken ¶
func (s *SignupResponse) GetCentrifugoToken() OptString
GetCentrifugoToken returns the value of CentrifugoToken.
func (*SignupResponse) GetLobbyToken ¶
func (s *SignupResponse) GetLobbyToken() OptString
GetLobbyToken returns the value of LobbyToken.
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) SetCentrifugoToken ¶
func (s *SignupResponse) SetCentrifugoToken(val OptString)
SetCentrifugoToken sets the value of CentrifugoToken.
func (*SignupResponse) SetLobbyToken ¶
func (s *SignupResponse) SetLobbyToken(val OptString)
SetLobbyToken sets the value of LobbyToken.
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 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 ¶
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 UnimplementedHandler ¶
type UnimplementedHandler struct{}
UnimplementedHandler is no-op Handler which returns http.ErrNotImplemented.
func (UnimplementedHandler) Auth ¶
func (UnimplementedHandler) Auth(ctx context.Context, req *AuthRequest) (r AuthRes, _ error)
Auth implements auth operation.
Auth request.
POST /auth
func (UnimplementedHandler) CreateGame ¶
func (UnimplementedHandler) CreateGame(ctx context.Context, params CreateGameParams) (r CreateGameRes, _ error)
CreateGame implements createGame operation.
Create a new game.
POST /games
func (UnimplementedHandler) GetPlayerStateUID ¶
func (UnimplementedHandler) GetPlayerStateUID(ctx context.Context, params GetPlayerStateUIDParams) (r GetPlayerStateUIDRes, _ error)
GetPlayerStateUID implements getPlayerStateUID operation.
Get user state.
GET /player/state/{uid}
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) ListGames ¶
func (UnimplementedHandler) ListGames(ctx context.Context, params ListGamesParams) (r ListGamesRes, _ error)
ListGames implements listGames operation.
Returns a snapshot of all currently active games.
GET /games
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) Signup ¶
func (UnimplementedHandler) Signup(ctx context.Context, req *SignupRequest) (r SignupRes, _ error)
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
Source Files
¶
- generate.go
- oas_cfg_gen.go
- oas_client_gen.go
- oas_handlers_gen.go
- oas_interfaces_gen.go
- oas_json_gen.go
- oas_labeler_gen.go
- oas_middleware_gen.go
- oas_operations_gen.go
- oas_parameters_gen.go
- oas_request_decoders_gen.go
- oas_request_encoders_gen.go
- oas_response_decoders_gen.go
- oas_response_encoders_gen.go
- oas_router_gen.go
- oas_schemas_gen.go
- oas_security_gen.go
- oas_server_gen.go
- oas_unimplemented_gen.go
- oas_validators_gen.go