Documentation ¶
Index ¶
- type AuthReturn
- type ConfigTokenGet
- type ConfigTokenReturn
- type Controller
- func (c Controller) CheckAuth(ctx *gin.Context)
- func (c Controller) CheckTokens(ctx *gin.Context)
- func (c Controller) CreateToken(ctx *gin.Context)
- func (c Controller) GetCurrent(ctx *gin.Context)
- func (c Controller) GetDateCalendar(ctx *gin.Context)
- func (c Controller) GetGeneralStats(ctx *gin.Context)
- func (c Controller) GetProgression(ctx *gin.Context)
- func (c Controller) GetTokens(ctx *gin.Context)
- func (c Controller) Login(ctx *gin.Context)
- func (c Controller) Logout(ctx *gin.Context)
- func (c *Controller) Register(ctx *gin.Context)
- func (c Controller) SetAccessTokenHistory(ctx *gin.Context)
- func (c Controller) SetShareCode(ctx *gin.Context)
- func (c Controller) SetSteamID(ctx *gin.Context)
- type CredentialsQuery
- type DataCalendarReturn
- type DatasetsReturn
- type GeneralStats
- type GetCurrentUserReturn
- type GetGeneralStatsReturn
- type LoginQuery
- type PointReturn
- type UserAccessTokenHistoryQuery
- type UserShareCodeQuery
- type UserSteamIDQuery
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthReturn ¶
AuthReturn struct returned when auth
type ConfigTokenGet ¶
type ConfigTokenGet struct {
IP string `json:"ip" binding:"required"`
}
ConfigTokenGet type token got from user
type ConfigTokenReturn ¶
type ConfigTokenReturn struct { IP string `json:"ip"` Token string `json:"token"` LastUsed *time.Time `json:"lastUsed"` }
ConfigTokenReturn type token returned to user
type Controller ¶
type Controller struct { LoggerBack *custlogger.Logger // contains filtered or unexported fields }
Controller controller of the users
func NewController ¶
func NewController( log *custlogger.Logger, di *downloaderinfo.DownloaderInfo, analyzerVersion int64, ) Controller
NewController Retourne une instance du controller
func (Controller) CheckAuth ¶
func (c Controller) CheckAuth(ctx *gin.Context)
CheckAuth check if the user's token is known
func (Controller) CheckTokens ¶
func (c Controller) CheckTokens(ctx *gin.Context)
CheckTokens check if the tokens provided for downloading demo are ok or not
func (Controller) CreateToken ¶
func (c Controller) CreateToken(ctx *gin.Context)
CreateToken create a token
func (Controller) GetCurrent ¶
func (c Controller) GetCurrent(ctx *gin.Context)
GetCurrent retourne les informations de l'utilisateur actuellement connecté
func (Controller) GetDateCalendar ¶
func (c Controller) GetDateCalendar(ctx *gin.Context)
GetDateCalendar return all the date the player played
func (Controller) GetGeneralStats ¶
func (c Controller) GetGeneralStats(ctx *gin.Context)
GetGeneralStats return the general stats of the player
func (Controller) GetProgression ¶
func (c Controller) GetProgression(ctx *gin.Context)
GetProgression return the progression of the current user
func (Controller) GetTokens ¶
func (c Controller) GetTokens(ctx *gin.Context)
GetTokens returns the tokens of the user
func (Controller) Login ¶
func (c Controller) Login(ctx *gin.Context)
Login Login the user for futurs requests
func (*Controller) Register ¶
func (c *Controller) Register(ctx *gin.Context)
Register check the credentials, if the mail isn't already took, and add it to the DB
func (Controller) SetAccessTokenHistory ¶
func (c Controller) SetAccessTokenHistory(ctx *gin.Context)
SetAccessTokenHistory modifie lesharecode de l'utilisateur
func (Controller) SetShareCode ¶
func (c Controller) SetShareCode(ctx *gin.Context)
SetShareCode modifie lesharecode de l'utilisateur
func (Controller) SetSteamID ¶
func (c Controller) SetSteamID(ctx *gin.Context)
SetSteamID modifie le steamID de l'utilisateur
type CredentialsQuery ¶
type CredentialsQuery struct { Mail *string `json:"mail" binding:"required"` Password *string `json:"password" binding:"required"` Confirm *string `json:"confirm" binding:"required"` }
CredentialsQuery struct read for register
type DataCalendarReturn ¶
DataCalendarReturn global struct for data calendar returned
type DatasetsReturn ¶
type DatasetsReturn struct {
Data []PointReturn `json:"data"`
}
DatasetsReturn main type returned containing all the datasets
type GeneralStats ¶
type GeneralStats struct { Date time.Time `json:"date"` MapName string `json:"mapName"` EndState model.EndState `json:"endState"` Kills int `json:"kills"` Deaths int `json:"deaths"` }
GeneralStats stats
type GetCurrentUserReturn ¶
type GetCurrentUserReturn struct { ID *uint `json:"id"` SteamID *string `json:"steamID"` Mail *string `json:"mail"` }
GetCurrentUserReturn type returned for GetCurrentUser
type GetGeneralStatsReturn ¶
type GetGeneralStatsReturn struct { Date time.Time `json:"date"` WeekStats []GeneralStats `json:"weekStats"` }
GetGeneralStatsReturn type returned for GetGeneralStats
type LoginQuery ¶
type LoginQuery struct { Mail *string `json:"mail" binding:"required"` Password *string `json:"password" binding:"required"` }
LoginQuery struct for login
type PointReturn ¶
PointReturn one point for a dataset
type UserAccessTokenHistoryQuery ¶
type UserAccessTokenHistoryQuery struct {
Token string `json:"token" binding:"required"`
}
UserAccessTokenHistoryQuery struct to update token access history
type UserShareCodeQuery ¶
type UserShareCodeQuery struct {
}UserShareCodeQuery struct to update sharecode
type UserSteamIDQuery ¶
type UserSteamIDQuery struct {
UserSteamID string `json:"steamid" binding:"required"`
}
UserSteamIDQuery struct to update steamID