database

package
v0.0.0-...-072ee57 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *sql.DB

Functions

func AddTime

func AddTime(c *fiber.Ctx, userid int, level int) (bool, string, int64)

func AddToChallenges

func AddToChallenges(chall models.Challenge) error

func AddToUsers

func AddToUsers(c *fiber.Ctx, email string) (string, error)

func AddToUsersDiscord

func AddToUsersDiscord(c *fiber.Ctx, userid int) (string, error)

func AddToVerify

func AddToVerify(c *fiber.Ctx, user *models.User) error

func CanStartInstance

func CanStartInstance(c *fiber.Ctx, userid int, level int) bool

func Connect

func Connect() error

func CreateTables

func CreateTables() error

func DeleteFlag

func DeleteFlag(c *fiber.Ctx, userid int, level int) error

func DeleteRunning

func DeleteRunning(c *fiber.Ctx, userid int, level int) error

func EmailExists

func EmailExists(email string) bool

func GenerateRandom

func GenerateRandom() string

func GetInstances

func GetInstances(c *fiber.Ctx, userid int) ([]models.Instance, error)

func NewFlag

func NewFlag(c *fiber.Ctx, userid int, level int, password string, flag string, port int32, hostname string, deadline int64) error

func PopulateChalls

func PopulateChalls() error

func ReadChallenges

func ReadChallenges(c *fiber.Ctx) ([]models.Challenge, error)

func ReadScores

func ReadScores(c *fiber.Ctx) ([]models.Score, error)

func UserExists

func UserExists(c *fiber.Ctx, userid int) bool

func UsernameRegistered

func UsernameRegistered(username string, email string) bool

func ValidChallenge

func ValidChallenge(c *fiber.Ctx, level int) bool

func ValidFlagEntry

func ValidFlagEntry(c *fiber.Ctx, level int, userid int) bool

func ValidateCreds

func ValidateCreds(c *fiber.Ctx, creds *models.Creds, user *models.User) error

func VerifyFlag

func VerifyFlag(c *fiber.Ctx, level int, userid int, flag string) (bool, string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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