dbmatchup

package
v0.0.0-...-8bbd0fc Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2020 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const STATUS_ACTIVE = "active"
View Source
const STATUS_FINAL = "final"
View Source
const STATUS_PENDING = "pending"

Variables

This section is empty.

Functions

func Delete

func Delete(m *Matchup) error

Delete deletes a matchup from the database

func Insert

func Insert(m *Matchup) error

Insert will create a new record in the database

func Save

func Save(s *Matchup) error

func Update

func Update(s *Matchup) error

Update will update a record in the database

Types

type Matchup

type Matchup struct {
	MatchupID     int64              `db:"matchup_id"`
	WeekID        database.NullInt64 `db:"week_id"`
	MatchupDate   database.NullTime  `db:"matchup_date"`
	VisitorTeamID database.NullInt64 `db:"visitor_team_id"`
	HomeTeamID    database.NullInt64 `db:"home_team_id"`
	VenueID       database.NullInt64 `db:"venue_id"`
	VisitorScore  database.NullInt64 `db:"visitor_score"`
	HomeScore     database.NullInt64 `db:"home_score"`
	WinningTeamID database.NullInt64 `db:"winning_team_id"`
	NumOvertimes  database.NullInt64 `db:"num_overtimes"`
	Status        string             `db:"status"`
	ExternalId    database.NullInt64 `db:"external_id"`
}

func ReadAll

func ReadAll() ([]Matchup, error)

ReadAll reads all matchups in the database

func ReadByExternalID

func ReadByExternalID(ID int64) (*Matchup, error)

ReadByExternalID reads matchup by external_id column

func ReadByID

func ReadByID(ID int64) (*Matchup, error)

ReadByID reads matchup by id column

func ReadByWeekIDAndVisitorIDAndHomeId

func ReadByWeekIDAndVisitorIDAndHomeId(weekId, visitorId, homeId int64) (*Matchup, error)

ReadByWeekIDAndVisitorIDAndHomeId reads matchup by week_id, visitor_id, and home_id columns

func (*Matchup) SetWinner

func (matchup *Matchup) SetWinner()

Jump to

Keyboard shortcuts

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