models

package
v0.0.0-...-2e42b1c Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Player

type Player struct {
	ID         int    `db:"id" json:"id"`
	Name       string `db:"name" json:"name"`
	Number     string `db:"number" json:"number"`
	Position   string `db:"position" json:"position"`
	Height     string `db:"height" json:"height"`
	Weight     string `db:"weight" json:"weight"`
	Age        string `db:"age" json:"age"`
	Experience int    `db:"experience" json:"experience"`
	College    string `db:"college" json:"college"`
}

Player is a player on the roster

func GetPlayer

func GetPlayer(db *sqlx.DB, id int) (*Player, error)

GetPlayer gets a player by ID

func ListPlayers

func ListPlayers(db *sqlx.DB, position string) ([]Player, error)

ListPlayers lists all the players, optionally restricted to a position

func (*Player) Delete

func (p *Player) Delete(db *sqlx.DB) error

Delete deletes a player

func (*Player) Save

func (p *Player) Save(db *sqlx.DB) (*Player, bool, error)

Save saves a player (insert or update)

func (*Player) String

func (p *Player) String() string

String returns a String version of a player

Jump to

Keyboard shortcuts

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