database

package
v0.0.0-...-feac726 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APICacheChanges

func APICacheChanges(db *sqlx.DB) error

func AddAccolades

func AddAccolades(db *sqlx.DB) error

func AddClanInfo

func AddClanInfo(db *sqlx.DB) error

func AddClanInvites

func AddClanInvites(db *sqlx.DB) error

func AddColumn

func AddColumn(table string, name string, props string, defaultVal string, db *sqlx.DB) error

func AddFlagCaptures

func AddFlagCaptures(db *sqlx.DB) error

func AddFollowing

func AddFollowing(db *sqlx.DB) error

func AddLastEventToPlayers

func AddLastEventToPlayers(db *sqlx.DB) error

func AddLastIP

func AddLastIP(db *sqlx.DB) error

func AddLeaderboardBan

func AddLeaderboardBan(db *sqlx.DB) error

func AddMapStats

func AddMapStats(db *sqlx.DB) error

func AddMapVotes

func AddMapVotes(db *sqlx.DB) error

func AddMonthlyLeaderboardBan

func AddMonthlyLeaderboardBan(db *sqlx.DB) error

func AddNotes

func AddNotes(db *sqlx.DB) error

func AddPermissions

func AddPermissions(db *sqlx.DB) error

func AddPolls

func AddPolls(db *sqlx.DB) error

func AddServerStatus

func AddServerStatus(db *sqlx.DB) error

func AddStatsBan

func AddStatsBan(db *sqlx.DB) error

func BumpNameLimit

func BumpNameLimit(db *sqlx.DB) error

func ChangeLastIPToHash

func ChangeLastIPToHash(db *sqlx.DB) error

func DelColumn

func DelColumn(table string, name string, db *sqlx.DB) error

func DelFK

func DelFK(table string, name string, db *sqlx.DB) error

func ModifyFkOnDelete

func ModifyFkOnDelete(constraint string, table string, key string, reference string, db *sqlx.DB) error

func OnDeleteCascade

func OnDeleteCascade(db *sqlx.DB) error

func RefreshPlayerInfo

func RefreshPlayerInfo(db *sqlx.DB) error

func RemoveAltAccounts

func RemoveAltAccounts(db *sqlx.DB) error

func RemoveEvents

func RemoveEvents(db *sqlx.DB) error

func RemoveWeekOldAccounts

func RemoveWeekOldAccounts(db *sqlx.DB) error

func RunMigration

func RunMigration(version int64, migrations func(db *sqlx.DB) error, db *sqlx.DB) error

func SawKillBuilderOnly

func SawKillBuilderOnly(db *sqlx.DB) error

func TeamKillChanges

func TeamKillChanges(db *sqlx.DB) error

Types

type Database

type Database interface {
	InitDB() error
	UpdatePlayerInfo(player *models.Player) error
	UpdateServerInfo(server *models.Server) error
	UpdateServerStatus(server models.Server, status bool) error
	Commit(kills []models.Kill) error
	CommitFlagCapture(capture models.FlagCapture) error
	CommitMapStats(stats models.MapStats) error
	CommitMapVotes(votes models.MapVotes) error
	CommitPlayer(player *models.Player) error
}

type SQLDatabase

type SQLDatabase struct {
	// contains filtered or unexported fields
}

func NewSQLDatabase

func NewSQLDatabase(db *sqlx.DB) *SQLDatabase

func (*SQLDatabase) Commit

func (d *SQLDatabase) Commit(kills []models.Kill) error

func (*SQLDatabase) CommitFlagCapture

func (d *SQLDatabase) CommitFlagCapture(capture models.FlagCapture) error

func (*SQLDatabase) CommitMapStats

func (d *SQLDatabase) CommitMapStats(stats models.MapStats) error

func (*SQLDatabase) CommitMapVotes

func (d *SQLDatabase) CommitMapVotes(votes models.MapVotes) error

func (*SQLDatabase) CommitPlayer

func (d *SQLDatabase) CommitPlayer(player *models.Player) error

func (*SQLDatabase) InitDB

func (d *SQLDatabase) InitDB() error

func (*SQLDatabase) RunMigrations

func (d *SQLDatabase) RunMigrations() error

add database migrations here

func (*SQLDatabase) UpdatePlayerInfo

func (d *SQLDatabase) UpdatePlayerInfo(player *models.Player) error

func (*SQLDatabase) UpdateServerInfo

func (d *SQLDatabase) UpdateServerInfo(server *models.Server) error

func (*SQLDatabase) UpdateServerStatus

func (d *SQLDatabase) UpdateServerStatus(server models.Server, status bool) error

Jump to

Keyboard shortcuts

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