models

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2017 License: Apache-2.0 Imports: 4 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           string
	LastName     string
	FirstName    string
	JerseyNumber string
	Position     string
	PicURL       string
	Age          string
	Height       string
	Weight       string
	Rookie       bool
	NflID        string
	TeamID       string
	Team         Team
	Stats        []Stat `json:"stats"`
}

Player is the type that holds all player information

func (*Player) MapExtra

func (p *Player) MapExtra(extraInfo []byte)

MapExtra maps additional info like portrait url. Takes in raw json call.

func (*Player) MapStats

func (p *Player) MapStats(playerData []byte)

MapStats takes in set of objects, maps each to player's Stats property. Flatten stats object from api source.

func (*Player) MapTeam

func (p *Player) MapTeam(playerData []byte)

MapTeam takes in set of objects, maps each to player's Stats property. Flatten stats object from api source.

type Point

type Point struct {
	ID           uint    `json:"id" gorm:"primary_key"`
	PlayerID     string  `json:"pid"`
	Category     string  `json:"category"`
	Abbreviation string  `json:"shortname"`
	Name         string  `json:"name"`
	LeagueName   string  `json:"leaguename"` //The name the league uses on how it counts points (ie, RY10)
	StatID       int     `json:"statid"`     //Matching id
	StatNum      float64 `json:"stat"`
	Value        float64 `json:"points"`
}

Point stores list of fantasy points. Assigned to a player.

type Stat

type Stat struct {
	ID           int    `json:"id" gorm:"primary_key"`
	PlayerID     string `json:"pid"`
	Name         string `json:"statname"`
	Category     string `json:"@category"`
	Abbreviation string `json:"@abbreviation"`
	Value        string `json:"#text"`
}

Stat tracks the all of the passing stats.

type Team

type Team struct {
	ID           string `gorm:"primary_key"`
	Name         string
	City         string
	Abbreviation string
}

Team type per player

Jump to

Keyboard shortcuts

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