Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func (*API) GetPlayer ¶
swagger:route GET /player/{ID} player getPlayer
Get a player by ID.
responses:
200: body:GetPlayerResp 400: body:Error 500: body:Error
func (*API) GetPlayers ¶
swagger:route GET /players player getPlayers
Get all players.
responses:
200: body:GetPlayersResp 500: body:Error
func (*API) PostPlayer ¶
swagger:route POST /player player postPlayer
Add a new player.
responses:
200: body:PostPlayerResp 400: body:Error 500: body:Error
type GetPlayerInput ¶
swagger:parameters getPlayer
type GetPlayerResp ¶
type GetPlayerResp struct {
Data Player `json:"data"`
}
swagger:model GetPlayerResp
type GetPlayersResp ¶
type GetPlayersResp struct {
Data []Player `json:"data"`
}
swagger:model GetPlayersResp
type Player ¶
type Player struct { ID string `json:"id"` FirstName string `json:"firstName"` LastName string `json:"lastName"` }
swagger:model Player
type PlayerDB ¶
type PlayerDB interface { AddPlayer(ctx context.Context, newPlayer model.Player) (*model.Player, error) GetPlayer(ctx context.Context, id uuid.UUID) (*model.Player, error) GetAllPlayers(ctx context.Context) ([]model.Player, error) UpdatePlayer(ctx context.Context, id uuid.UUID, Player db.UpdatePlayerInput) (*model.Player, error) }
type PostPlayerInput ¶
type PostPlayerInput struct { // in:body Body struct { // required: true FirstName string `json:"firstName" binding:"required,ascii"` // required: true LastName string `json:"lastName" binding:"required"` } }
swagger:parameters postPlayer
type PostPlayerResp ¶
type PostPlayerResp struct {
Data Player `json:"data"`
}
swagger:model PostPlayerResp
type PutPlayerInput ¶
type PutPlayerInput struct { // in:path ID uuid.UUID // in:body Body struct { // required: true FirstName string `json:"firstName" binding:"required,ascii"` // required: true LastName string `json:"lastName" binding:"required"` } }
swagger:parameters putPlayer
type PutPlayerResp ¶
type PutPlayerResp struct {
Data Player `json:"data"`
}
swagger:model PutPlayerResp
Click to show internal directories.
Click to hide internal directories.