Services

package
v0.0.0-...-526dcec Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Admin

type Admin interface {
	TryBanUser(adminAccess int, ban bans.UserBan) error
	TryUnbanUser(adminAccess int, ban bans.UserUnban) error
	TryBanLevel(adminAccess int, ban bans.LevelBan) error
	TryUnbanLevel(adminAccess int, ban bans.LevelBan) error
	TryChangeAccessLevel(adminAccess int, ban useraccess.ChangeUserAccess) error
	GetUserComplaints(adminId int, adminAccess int) ([]complaints.UserComplaint, error)
	GetLevelComplaints(adminId int, adminAccess int) ([]complaints.LevelComplaint, error)
	ProcessUserComplaint(adminId int, adminAccess int, complaintId int) error
	ProcessLevelComplaint(adminId int, adminAccess int, complaintId int) error
	GetUsers(adminAccess int, searchParams user.UserSearchParams) ([]user.UserInfo, error)
}

type Authorization

type Authorization interface {
	CreateUser(user user.User) (string, string, error)
	GenerateToken(username, password string) (string, string, error)
	GenerateTokenByToken(accessToken, refreshToken string) (string, string, error)
	Parse(accessToken string) (time.Time, int, int, error)
	CreateSeniorAdmin(username string, password string) error
}

type Level

type Level interface {
	CreateLevel(userId int, levelFile, infoFile, previewFile *multipart.FileHeader) (int, error)
	UpdateLevel(userId int, levelFile, infoFile, previewFile *multipart.FileHeader) (int, error)
	DeleteLevel(levelId int) error
	GetLevelById(levelId int) (level.Level, error)
	GetLevelList(fetchStruct level.FetchLevelStruct) ([]level.Level, error)
	CheckLevelExists(levId int) (string, error)
	GetLevelStats(levelId int) (statistics.LevelStats, error)
	GetLevelUserTop(levelId int) ([]statistics.UserLevelCompletionInfo, error)
}

type SinglePlayer

type SinglePlayer interface {
	SendResults(senderID int, lc statistics.LevelComplete) error
}

type Stats

type Stats interface {
	GetUserStats(id int) (statistics.PlayerStats, error)
	GetUsersTop(params statistics.StatSortFilterParams) ([]statistics.PlayerStats, error)
}

type UserActions

type UserActions interface {
	DropRefreshToken(id int) error
	GetUserById(id int) (string, int, time.Time, string, sql.NullString, error)
	CreateUserComplaint(complaint complaints.UserComplaint) error
	CreateLevelComplaint(complaint complaints.LevelComplaint) error
	UpdateAvatar(userId int, avatarFile *multipart.FileHeader) error
}

Jump to

Keyboard shortcuts

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