db

package
v0.0.0-...-287d283 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TeamsMem   = map[string]*models.Team{}
	SportsMem  = map[string]*models.Sport{}
	PlayersMem = map[string]*models.Player{}
)

Temporary in-memory data store

Functions

func DeleteSport

func DeleteSport(db *gorm.DB, id string) error

func GetSport

func GetSport(db *gorm.DB, id string) (*models.Sport, error)

func InitDB

func InitDB() *gorm.DB

InitDB connects to the Postgres database, and initializes it where required

func InsertSport

func InsertSport(db *gorm.DB, sport *models.Sport) error

func ListSports

func ListSports(db *gorm.DB) (*models.SportList, error)

func UpdateSport

func UpdateSport(db *gorm.DB, sport *models.Sport) (*models.Sport, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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