player

package
v0.0.0-...-5c7a00c Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddPlayer

func AddPlayer(db *sql.DB) http.HandlerFunc

AddPlayer will add a player

func DeletePlayer

func DeletePlayer(db *sql.DB) http.HandlerFunc

DeletePlayer will delete player

func GetAllPlayer

func GetAllPlayer(db *sql.DB) http.HandlerFunc

GetAllPlayer will return all player

func GetSpecificPlayer

func GetSpecificPlayer(db *sql.DB) http.HandlerFunc

GetSpecificPlayer will return a specific player by id

func HandlePlayerImage

func HandlePlayerImage(db *sql.DB) http.HandlerFunc

HandlePlayerImage will handle the upload of an player Image

func UpdatePlayer

func UpdatePlayer(db *sql.DB) http.HandlerFunc

UpdatePlayer will update player details

Types

type Image

type Image struct {
	B64 string `json:"b64"`
}

Image holds the b64 string from a uploaded avatar

type Player

type Player struct {
	UID             string
	Name            string
	Nickname        string
	Image           string
	ThrowRounds     []throw.Round
	TotalThrowCount int
	Score           score.BaseScore
	LastThrows      []throw.Throw
	ThrowSum        int
	Average         float64
}

Player holds all the players information

func GetPlayer

func GetPlayer(db *sql.DB, id string) Player

GetPlayer will return a player as struct, not as json

func GetPlayerList

func GetPlayerList(db *sql.DB, ids []int) []Player

GetPlayerList will return a list of player using the id

Jump to

Keyboard shortcuts

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