Documentation ¶
Index ¶
- func CreateFargoHotHandicap(db *gorm.DB, id uint, raceTo int, differenceStart uint, differenceEnd *uint, ...) error
- func CreateFlag(db *gorm.DB, id uint, country string, imagePath string) error
- func CreatePlayer(db *gorm.DB, id uint, name string, flagID uint, fargoID uint, fargoRating uint) error
- func CreateTeam(db *gorm.DB, id uint, name string) error
- func CreateTeamPlayer(db *gorm.DB, id uint, teamID uint, playerID uint) error
- func Run(db *gorm.DB, seeders ...Seeder) error
- type FargoHotHandicapSeed
- type FlagSeed
- type PlayerSeed
- type Seed
- type Seeder
- type TeamPlayerSeed
- type TeamSeed
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateFargoHotHandicap ¶
func CreateFargoHotHandicap(db *gorm.DB, id uint, raceTo int, differenceStart uint, differenceEnd *uint, winsHigher uint, winsLower uint) error
CreateFargoHotHandicap adds a handicap to the database.
func CreateFlag ¶
CreateFlag adds a flag to the database.
func CreatePlayer ¶
func CreatePlayer(db *gorm.DB, id uint, name string, flagID uint, fargoID uint, fargoRating uint) error
CreatePlayer adds a player to the database.
func CreateTeam ¶
CreateTeam adds a team to the database.
func CreateTeamPlayer ¶
CreateTeamPlayer adds a team player to the database.
Types ¶
type FargoHotHandicapSeed ¶
type FargoHotHandicapSeed struct {
Handicaps []models.FargoHotHandicap
}
FargoHotHandicapSeed is used to load all handicap seeds from the json file.
func NewFargoHotHandicapSeed ¶
func NewFargoHotHandicapSeed(jsonPath ...string) *FargoHotHandicapSeed
NewFargoHotHandicapSeed return a new FargoHotHandicapSeed.
func (*FargoHotHandicapSeed) Seeds ¶
func (s *FargoHotHandicapSeed) Seeds() []Seed
Seeds returns all handicaps loaded from the json file as seeds.
type FlagSeed ¶
FlagSeed is used to load all flag seeds from the json file.
func NewFlagSeed ¶
NewFlagSeed return a new FlagSeed.
type PlayerSeed ¶
PlayerSeed is used to load all player seeds from the json file.
func NewPlayerSeed ¶
func NewPlayerSeed(jsonPath ...string) *PlayerSeed
NewPlayerSeed return a new PlayerSeed.
func (*PlayerSeed) Seeds ¶
func (s *PlayerSeed) Seeds() []Seed
Seeds returns all flags loaded from the json file as seeds.
type Seeder ¶
type Seeder interface {
Seeds() []Seed
}
Seeder is used to load a json seed file and return the seed slice.
type TeamPlayerSeed ¶
type TeamPlayerSeed struct {
TeamPlayers []models.TeamPlayer
}
TeamPlayerSeed is used to load all team player seeds from the json file.
func NewTeamPlayerSeed ¶
func NewTeamPlayerSeed(jsonPath ...string) *TeamPlayerSeed
NewTeamPlayerSeed return a new TeamPlayerSeed.
func (*TeamPlayerSeed) Seeds ¶
func (s *TeamPlayerSeed) Seeds() []Seed
Seeds returns all teams loaded from the json file as seeds.
type TeamSeed ¶
TeamSeed is used to load all player seeds from the json file.
func NewTeamSeed ¶
NewTeamSeed return a new TeamSeed.