users

package
v0.0.0-...-fda175b Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterRoutes

func RegisterRoutes(
	r *gin.RouterGroup,
	service *UserAnalyticsService,
	memoryStore *persist.MemoryStore,
)

Types

type AccuracyHist

type AccuracyHist struct {
	Items []AccuracyHistItem `json:"items"`
}

type AccuracyHistItem

type AccuracyHistItem struct {
	Period time.Time `json:"period"`

	Accuracy   float64 `json:"accuracy"`
	HSAccuracy float64 `json:"hs_accuracy"`
}

type GetTeammatesRequest

type GetTeammatesRequest struct {
	UserId int  `json:"user_id" binding:"required"`
	Limit  *int `json:"limit"`
}

type GetTeammatesResponse

type GetTeammatesResponse struct {
	Items []*GetTeammatesResponseItem `json:"items"`
}

type GetTeammatesResponseItem

type GetTeammatesResponseItem struct {
	Id   int    `json:"id"`
	Name string `json:"name"`

	ProfileUrl *string `json:"profile_url"`
	Avatar     *string `json:"avatar"`

	Games int `json:"games"`
	Wins  int `json:"wins"`

	AuthId string          `json:"-"`
	Type   models.AuthType `json:"-"`
}

type PlayTimeHist

type PlayTimeHist struct {
	Items []PlayTimeHistItem `json:"items"`
}

type PlayTimeHistItem

type PlayTimeHistItem struct {
	Period time.Time `json:"period"`

	Count   int `json:"count"`
	Minutes int `json:"minutes"`
}

type UserAnalyticsRequest

type UserAnalyticsRequest struct {
	UserId int `json:"user_id"`

	From *time.Time `json:"date_from"`
	To   *time.Time `json:"date_to"`
}

type UserAnalyticsResponse

type UserAnalyticsResponse struct {
	Games int `json:"games"`
	Wins  int `json:"wins"`

	Minutes int `json:"minutes"`

	Kills  int `json:"kills"`
	Deaths int `json:"deaths"`
}

type UserAnalyticsService

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

func NewUserAnalyticsService

func NewUserAnalyticsService(db *sql.DB) *UserAnalyticsService

func (*UserAnalyticsService) GetPerksAnalytics

func (*UserAnalyticsService) GetUserAnalytics

func (s *UserAnalyticsService) GetUserAnalytics(
	req UserAnalyticsRequest,
) (*UserAnalyticsResponse, error)

func (*UserAnalyticsService) Inject

func (s *UserAnalyticsService) Inject(
	userService *users.UserService,
)

type UserPerkHistRequest

type UserPerkHistRequest struct {
	UserId int  `json:"user_id" binding:"required"`
	Perk   *int `json:"perk"`

	From *time.Time `json:"date_from"`
	To   *time.Time `json:"date_to"`
}

type UserPerksAnalyticsRequest

type UserPerksAnalyticsRequest struct {
	UserId int `json:"user_id"`

	From *time.Time `json:"date_from"`
	To   *time.Time `json:"date_to"`
}

type UserPerksAnalyticsResponse

type UserPerksAnalyticsResponse struct {
	AverageZedtime float64 `json:"avg_zt"`

	Items []UserPerksAnalyticsResponseItem `json:"items"`
}

type UserPerksAnalyticsResponseItem

type UserPerksAnalyticsResponseItem struct {
	Perk int `json:"perk"`

	Games int `json:"games"`
	Wins  int `json:"wins"`

	Kills      int `json:"kills"`
	LargeKills int `json:"large_kills"`

	Waves  int `json:"waves"`
	Deaths int `json:"deaths"`

	Accuracy   float64 `json:"accuracy"`
	HSAccuracy float64 `json:"hs_accuracy"`

	DamageDealt int `json:"damage_dealt"`
	DamageTaken int `json:"damage_taken"`
	HealsGiven  int `json:"heals_given"`

	Minutes int `json:"minutes"`
}

type UsersTopType

type UsersTopType = int
const (
	TotalGames UsersTopType = iota + 1
	TotalDeaths

	Accuracy
	HsAccuracy

	TotalDamage
	MostDamage

	TotalKills
	TotalLargeKills
	TotalHuskRages

	TotalHeals

	AverageZedtime
	TotalPlaytime
)

Jump to

Keyboard shortcuts

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