Documentation ¶
Overview ¶
Package openapi provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.15.0 DO NOT EDIT.
Package openapi provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.15.0 DO NOT EDIT.
Package openapi provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.15.0 DO NOT EDIT.
Index ¶
- func GetSwagger() (swagger *openapi3.T, err error)
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- func RegisterHandlers(router EchoRouter, si ServerInterface)
- func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)
- type BadRequest
- type BoardSide
- type CreateGameJSONBody
- type CreateGameJSONRequestBody
- type CreatePlayJSONBody
- type CreatePlayJSONRequestBody
- type EchoRouter
- type Error
- type Game
- type GameID
- type InternalServerError
- type NewGameBody
- type NewPlayBody
- type NotFound
- type PlayCreated
- type Player
- type Result
- type ServerInterface
- type ServerInterfaceWrapper
- type Turn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSwagger ¶
GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.
func PathToRawSpec ¶
Constructs a synthetic filesystem for resolving external references when loading openapi specifications.
func RegisterHandlers ¶
func RegisterHandlers(router EchoRouter, si ServerInterface)
RegisterHandlers adds each server route to the EchoRouter.
func RegisterHandlersWithBaseURL ¶
func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)
Registers handlers, and prepends BaseURL to the paths, so that the paths can be served under a prefix.
Types ¶
type BoardSide ¶
type BoardSide struct { // Pits The pits of the board side Pits []int64 `json:"pits"` Player Player `json:"player"` // Store The store (big pit) of the board side Store int64 `json:"store"` }
BoardSide A side of the board
type CreateGameJSONBody ¶
CreateGameJSONBody defines parameters for CreateGame.
type CreateGameJSONRequestBody ¶
type CreateGameJSONRequestBody CreateGameJSONBody
CreateGameJSONRequestBody defines body for CreateGame for application/json ContentType.
type CreatePlayJSONBody ¶
type CreatePlayJSONBody struct {
PitIndex int64 `json:"pit_index"`
}
CreatePlayJSONBody defines parameters for CreatePlay.
type CreatePlayJSONRequestBody ¶
type CreatePlayJSONRequestBody CreatePlayJSONBody
CreatePlayJSONRequestBody defines body for CreatePlay for application/json ContentType.
type EchoRouter ¶
type EchoRouter interface { CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route }
This is a simple interface which specifies echo.Route addition functions which are present on both echo.Echo and echo.Group, since we want to allow using either of them for path registration
type Game ¶
type Game struct { // BoardSide1 A side of the board BoardSide1 BoardSide `json:"board_side1"` // BoardSide2 A side of the board BoardSide2 BoardSide `json:"board_side2"` // Id The id of the game Id string `json:"id"` // Result The result of the game. 0 => Undefined 1 => Player1Wins 2 => Player2Wins 3 => Tie Result Result `json:"result"` // Turn The turn that needs to play next. 0 => Player1 1 => Player2 Turn Turn `json:"turn"` }
Game defines model for Game.
type InternalServerError ¶
type InternalServerError = Error
InternalServerError defines model for InternalServerError.
type NewGameBody ¶
NewGameBody defines model for NewGameBody.
type NewPlayBody ¶
type NewPlayBody struct {
PitIndex int64 `json:"pit_index"`
}
NewPlayBody defines model for NewPlayBody.
type PlayCreated ¶
PlayCreated defines model for PlayCreated.
type Player ¶
type Player struct { // Name The name of the player Name string `json:"name"` // Score The score of the player Score int64 `json:"score"` }
Player defines model for Player.
type Result ¶
type Result int
Result The result of the game. 0 => Undefined 1 => Player1Wins 2 => Player2Wins 3 => Tie
type ServerInterface ¶
type ServerInterface interface { // Create game // (POST /games) CreateGame(ctx echo.Context) error // Show game // (GET /games/{id}) ShowGame(ctx echo.Context, id GameID) error // Perform next play // (POST /games/{id}/plays) CreatePlay(ctx echo.Context, id GameID) error }
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
}
ServerInterfaceWrapper converts echo contexts to parameters.
func (*ServerInterfaceWrapper) CreateGame ¶
func (w *ServerInterfaceWrapper) CreateGame(ctx echo.Context) error
CreateGame converts echo context to params.
func (*ServerInterfaceWrapper) CreatePlay ¶
func (w *ServerInterfaceWrapper) CreatePlay(ctx echo.Context) error
CreatePlay converts echo context to params.
func (*ServerInterfaceWrapper) ShowGame ¶
func (w *ServerInterfaceWrapper) ShowGame(ctx echo.Context) error
ShowGame converts echo context to params.