players

package
v0.0.0-...-4486d03 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QB  = "QB"
	WR  = "WR"
	RB  = "RB"
	TE  = "TE"
	DST = "DST"
	K   = "K"
)

Variables

This section is empty.

Functions

func OrderedPositions

func OrderedPositions() []string

func Positions

func Positions() map[string]bool

Types

type FilterFn

type FilterFn func(p Player) bool

type Player

type Player struct {
	Ceil     float64 `json:"ceiling"`
	CeilRank float64 `json:"ceiling_rank"`
	CeilVor  float64 `json:"ceiling_vor"`

	Floor     float64 `json:"floor"`
	FloorRank float64 `json:"floor_rank"`
	FloorVor  float64 `json:"floor_vor"`

	ADP          float64 `json:"adp"`
	Age          int     `json:"age"`
	Dropoff      float64 `json:"drop_off"`
	Exp          int     `json:"exp"`
	ID           int     `json:"id"`
	NameFirst    string  `json:"first_name"`
	NameLast     string  `json:"last_name"`
	OverallRank  int     `json:"rank"`
	Position     string  `json:"pos"`
	PositionRank int     `json:"pos_rank"`
	StdDevPoints float64 `json:"sd_pts"`
	Team         string  `json:"team"`
	Tier         int     `json:"tier"`
	Vor          float64 `json:"points_vor"`
	Risk         float64 `json:"risk"`
}

Player of the NFL variety

func LoadFromCSV

func LoadFromCSV(r io.Reader) ([]Player, error)

LoadFromCSV pre-processes a csv manually downloaded from http://apps.fantasyfootballanalytics.net/lineupoptimizer/. Login and use the download button to get the csv. Unfortunately, there lacks an easy way to make a request to get the data IMPORTANT: You want the custom rankings (not the raw). This function take the csv and transforms it into a parseable json file

func (Player) Name

func (p Player) Name() string

func (Player) String

func (p Player) String() string

type Players

type Players []Player

func (Players) Filter

func (ps Players) Filter(f FilterFn) Players

func (Players) GroupPosition

func (ps Players) GroupPosition(sort SortBy, max int) (results Players)

type Repo

type Repo struct {
	Claimed   Players
	Position  int
	Available Players
}

func NewRepo

func NewRepo(players Players) *Repo

func (*Repo) Ceil

func (r *Repo) Ceil() []Player

func (*Repo) CeilByPos

func (r *Repo) CeilByPos(pos string, limit int) []Player

func (*Repo) FindAll

func (r *Repo) FindAll(name string) (all Players)

func (*Repo) FindAvailable

func (r *Repo) FindAvailable(name string) Players

func (*Repo) FindUnavailable

func (r *Repo) FindUnavailable(name string) Players

func (*Repo) Floor

func (r *Repo) Floor() []Player

func (*Repo) FloorByPos

func (r *Repo) FloorByPos(pos string, limit int) []Player

func (*Repo) Keep

func (r *Repo) Keep(p Player) error

func (*Repo) Pick

func (r *Repo) Pick(p Player) error

func (*Repo) Sync

func (r *Repo) Sync(plyrs []TeamPlayer)

func (*Repo) Team

func (r *Repo) Team(name string) []Player

func (*Repo) UnPick

func (r *Repo) UnPick(p Player) error

type SortBy

type SortBy func(p1, p2 Player) bool

func (SortBy) Sort

func (by SortBy) Sort(pls []Player)

type Team

type Team struct {
	Name    string
	Players []TeamPlayer
}

func (*Team) Sync

func (t *Team) Sync(plyrs Players)

type TeamPlayer

type TeamPlayer struct {
	ID int
}

Jump to

Keyboard shortcuts

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