usercontroller

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: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthReturn

type AuthReturn struct {
	APIWorking *bool   `json:"apiWorking"`
	SteamID    *string `json:"steamID"`
}

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) Logout

func (c Controller) Logout(ctx *gin.Context)

Logout disconnect the user

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

type DataCalendarReturn struct {
	Day   *string `json:"date"`
	Value *int    `json:"count"`
}

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

type PointReturn struct {
	X int64   `json:"x"`
	Y float64 `json:"y"`
}

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 {
	ShareCode string `json:"shareCode" binding:"required"`
}

UserShareCodeQuery struct to update sharecode

type UserSteamIDQuery

type UserSteamIDQuery struct {
	UserSteamID string `json:"steamid" binding:"required"`
}

UserSteamIDQuery struct to update steamID

Jump to

Keyboard shortcuts

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