dao

package
v0.0.0-...-bd0fe52 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2021 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAlreadyAnalyzed = errors.New("demo already analyzed")

ErrAlreadyAnalyzed demo already analyzed

View Source
var ErrNotEnoughData = errors.New("not enough data for the query")

ErrNotEnoughData not enough data for the query

Functions

This section is empty.

Types

type DemoDAO

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

DemoDAO the doa of the demos

func NewDemoDAO

func NewDemoDAO(dataSource *gorm.DB, logger *custlogger.Logger) DemoDAO

NewDemoDAO constructor for the demo DAO

func (DemoDAO) Create

func (dao DemoDAO) Create(demo *model.Demo, log *logger.Interface) error

Create add the demo in the DB

func (DemoDAO) Delete

func (dao DemoDAO) Delete(demo model.Demo) error

Delete delete the demo from the DB

func (DemoDAO) DeleteAnalyzes

func (dao DemoDAO) DeleteAnalyzes(demo *model.Demo) error

DeleteAnalyzes delete all analyses

func (DemoDAO) Exists

func (dao DemoDAO) Exists(demo model.Demo) (bool, error)

Exists return true if the demo already exists

func (DemoDAO) Get

func (dao DemoDAO) Get(demo *model.Demo) error

Get get the demo from the DB

func (DemoDAO) GetAll2BeAnalyzed

func (dao DemoDAO) GetAll2BeAnalyzed(
	analyzedVersion int64,
	gameMode model.DemoGameMode,
) (demos []model.Demo, err error)

GetAll2BeAnalyzed get all the demos from the DB not analyzed or with an analyzer outdated

func (DemoDAO) GetAllAnalizedWithStats

func (dao DemoDAO) GetAllAnalizedWithStats(
	steamID string,
	sources *[]model.DemoSource,
	analyzerVersion int64,
) (demos []model.Demo, err error)

GetAllAnalizedWithStats get all demos from the DB for 1 user analyzed

func (DemoDAO) GetAllFromUser

func (dao DemoDAO) GetAllFromUser(
	steamID string,
	sources *[]model.DemoSource,
	maps *[]string,
	from, to *int64,
) (demos []model.Demo, err error)

GetAllFromUser get all the demo from the DB for 1 user

func (DemoDAO) GetAllFromUserWithMarks

func (dao DemoDAO) GetAllFromUserWithMarks(
	steamID string,
	sources *[]model.DemoSource,
	maps *[]string,
	limit, offset int,
	from, to *int64,
) (demos []model.Demo, err error)

GetAllFromUserWithMarks get all the demo from the DB for 1 user with the marks

func (DemoDAO) GetAllHeatMapFromUserFromMap

func (dao DemoDAO) GetAllHeatMapFromUserFromMap(
	steamID, mapName string,
	sources *[]model.DemoSource,
) (demos []model.Demo, err error)

GetAllHeatMapFromUserFromMap return all heatmaps of a player

func (DemoDAO) GetAllNotClassified

func (dao DemoDAO) GetAllNotClassified() (demos []model.Demo, err error)

GetAllNotClassified get all the demos from the DB not classifier

func (DemoDAO) GetAllNotDownloaded

func (dao DemoDAO) GetAllNotDownloaded(sources *[]model.DemoSource) (demos []model.Demo, err error)

GetAllNotDownloaded get all the demos from the DB not downloaded

func (DemoDAO) GetAllPatternsFromUser

func (dao DemoDAO) GetAllPatternsFromUser(
	steamID string,
	sources *[]model.DemoSource,
) (playerStats []model.PlayerStats, err error)

GetAllPatternsFromUser get patterns from user

func (DemoDAO) GetFromShareCode

func (dao DemoDAO) GetFromShareCode(sharecode string) (*model.Demo, error)

GetFromShareCode get the demo linked to the sharecode

func (DemoDAO) GetLastAnalyzed

func (dao DemoDAO) GetLastAnalyzed(versionAnalyzer int64) (demos []model.Demo, err error)

GetLastAnalyzed all the last demos analyzed

func (DemoDAO) GetMarks

func (dao DemoDAO) GetMarks(demo *model.Demo, steamID string) error

GetMarks get the demo's marks from the DB with the stats

func (DemoDAO) GetNbr2BeAnalyzedFromPlayer

func (dao DemoDAO) GetNbr2BeAnalyzedFromPlayer(steamID string, analyzedVersion int64) (nbrDemos int64, err error)

GetNbr2BeAnalyzedFromPlayer get the number of the demos from the DB not analyzed or with an analyzer outdated

func (DemoDAO) GetResumeFromFilters

func (dao DemoDAO) GetResumeFromFilters(
	steamID string,
	sources *[]model.DemoSource,
	limit, offset int,
	maps *[]string,
	from, to *int64,
	versionAnalyzer int64,
) (demos []model.Demo, err error)

GetResumeFromFilters get all the demos by filters

func (DemoDAO) GetWithScore

func (dao DemoDAO) GetWithScore(demo *model.Demo, steamID string) error

GetWithScore get the demo from the DB with the score of the teams

func (DemoDAO) GetWithStats

func (dao DemoDAO) GetWithStats(demo *model.Demo) error

GetWithStats get the demo from the DB with the stats

func (DemoDAO) HashExists

func (dao DemoDAO) HashExists(demo model.Demo) (bool, *model.Demo, error)

HashExists return true if the hash already exists

func (DemoDAO) IsAnalyzed

func (dao DemoDAO) IsAnalyzed(demoID int64) (bool, error)

IsAnalyzed return true if the demo is analyzed

func (DemoDAO) SaveAnalyze

func (dao DemoDAO) SaveAnalyze(demo model.Demo) error

SaveAnalyze saves the analyze of the demo

func (DemoDAO) SetDownloaded

func (dao DemoDAO) SetDownloaded(demoID int64) error

SetDownloaded set the demo as downloaded

func (DemoDAO) SetGameMode

func (dao DemoDAO) SetGameMode(demoID int64, mode model.DemoGameMode) error

SetGameMode set the gamemode of the demo

func (DemoDAO) SetHash

func (dao DemoDAO) SetHash(demoID int64, hash []byte) error

SetHash set the hash of the demo

func (DemoDAO) SetLastVersionAnalyzer

func (dao DemoDAO) SetLastVersionAnalyzer(demoID int64, analyzerVersion int64) error

SetLastVersionAnalyzer set the version analyzer of the demo with the last version

func (DemoDAO) SetReplayURL

func (dao DemoDAO) SetReplayURL(demoID int64, replayURL *string) error

SetReplayURL set the replayURL of the demo

func (DemoDAO) SetShareCode

func (dao DemoDAO) SetShareCode(demoID int64, sharecode *string) error

SetShareCode set the sharecode of the demo

func (DemoDAO) SetSource

func (dao DemoDAO) SetSource(demoID int64, source model.DemoSource) error

SetSource set the source of the demo

func (DemoDAO) SwapCompetitiveToDMDemo

func (dao DemoDAO) SwapCompetitiveToDMDemo(demo model.Demo, newPath string) error

SwapCompetitiveToDMDemo swap a competitive demo to a deathmatch demo

type DemoDeathMatchDAO

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

DemoDeathMatchDAO the doa of the demos deathmatch

func NewDemoDeathMatchDAO

func NewDemoDeathMatchDAO(dataSource *gorm.DB) DemoDeathMatchDAO

NewDemoDeathMatchDAO constructor for the demo DAO

func (DemoDeathMatchDAO) Create

func (dao DemoDeathMatchDAO) Create(demo *model.DeathMatchDemo) error

Create add the demo in the DB

func (DemoDeathMatchDAO) Exists

func (dao DemoDeathMatchDAO) Exists(demo model.DeathMatchDemo) (bool, error)

Exists return true if the demo already exists

func (DemoDeathMatchDAO) Get

Get get the demo from the DB

func (DemoDeathMatchDAO) GetAll2BeAnalyzed

func (dao DemoDeathMatchDAO) GetAll2BeAnalyzed(analyzedVersion int64) (demos []model.DeathMatchDemo, err error)

GetAll2BeAnalyzed get all the demos from the DB not analyzed or with an analyzer outdated

func (DemoDeathMatchDAO) GetDeathMatchFromUser

func (dao DemoDeathMatchDAO) GetDeathMatchFromUser(user model.User) (demos []model.DeathMatchDemo, err error)

GetDeathMatchFromUser returns death match stats from player

func (DemoDeathMatchDAO) SaveAnalyze

func (dao DemoDeathMatchDAO) SaveAnalyze(demo model.DeathMatchDemo) error

SaveAnalyze saves the analyze of the demo

type TokenUploadDemoDAO

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

TokenUploadDemoDAO the doa of the demos deathmatch

func NewTokenUploadDemoDAO

func NewTokenUploadDemoDAO(dataSource *gorm.DB) TokenUploadDemoDAO

NewTokenUploadDemoDAO constructor for the demo DAO

func (TokenUploadDemoDAO) Create

func (dao TokenUploadDemoDAO) Create(token *model.TokenUploadDemo) error

Create add the token in the DB

func (TokenUploadDemoDAO) Exists

func (dao TokenUploadDemoDAO) Exists(token model.TokenUploadDemo) (bool, error)

Exists return true if the token exists

func (TokenUploadDemoDAO) Get

Get get the token from the DB

func (TokenUploadDemoDAO) GetAllFromUser

func (dao TokenUploadDemoDAO) GetAllFromUser(userID uint) ([]model.TokenUploadDemo, error)

GetAllFromUser get the tokens from the DB from an user

func (TokenUploadDemoDAO) UpdateUse

func (dao TokenUploadDemoDAO) UpdateUse(token *model.TokenUploadDemo) error

UpdateUse update the fields lastUsed

type UserDAO

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

UserDAO the doa of the user

func NewUserDAO

func NewUserDAO(dataSource *gorm.DB) UserDAO

NewUserDAO constructor for the user DAO

func (UserDAO) Create

func (dao UserDAO) Create(user *model.User) error

Create crée un nouvel utilisateur

func (UserDAO) Exists

func (dao UserDAO) Exists(user model.User) (bool, error)

Exists return true if the user already exists

func (*UserDAO) Get

func (dao *UserDAO) Get(user *model.User) error

Get Retourne l'utilisateur trouvé par son ID

func (UserDAO) GetAll

func (dao UserDAO) GetAll(users *[]*model.User) error

GetAll return all users

func (UserDAO) GetUserByMail

func (dao UserDAO) GetUserByMail(user *model.User) error

GetUserByMail return the user from its mail

func (UserDAO) GetUserFromContext

func (dao UserDAO) GetUserFromContext(ctx *gin.Context) (*model.User, error)

GetUserFromContext return the user of the user's token from the DB

func (UserDAO) GetUsersWhoEnabledDownloadInfo

func (dao UserDAO) GetUsersWhoEnabledDownloadInfo(users *[]*model.User) error

GetUsersWhoEnabledDownloadInfo return users who gave permissions to download info

func (UserDAO) SetAPIValveWorking

func (dao UserDAO) SetAPIValveWorking(user model.User, state bool) error

SetAPIValveWorking set if the data for the api is ok or not for the user

func (*UserDAO) UpdateAccessTokenHistory

func (dao *UserDAO) UpdateAccessTokenHistory(user *model.User) error

UpdateAccessTokenHistory update l'access token de l'utilisateur

func (*UserDAO) UpdateShareCode

func (dao *UserDAO) UpdateShareCode(user *model.User) error

UpdateShareCode update le sharecode de l'utilisateur

func (*UserDAO) UpdateSteamID

func (dao *UserDAO) UpdateSteamID(user *model.User) error

UpdateSteamID update le steamID de l'utilisateur

Jump to

Keyboard shortcuts

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