database

package
v0.0.0-...-9de4677 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

Functions

func AddTime

func AddTime(c *fiber.Ctx, chall_id int, teamid int64) (int64, error)

func AddToChallenges

func AddToChallenges(chall models.Challenge) error

func AddToUsers

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

func AddToVerify

func AddToVerify(c *fiber.Ctx, toverify *models.ToVerify) error

func AuthenticateTeam

func AuthenticateTeam(c *fiber.Ctx, team *models.Team) error

func CanStartInstance

func CanStartInstance(c *fiber.Ctx, chall_id int, teamid int64) error

func Connect

func Connect() error

func CreateTables

func CreateTables() error

func CreateTeam

func CreateTeam(c *fiber.Ctx, team *models.Team) error

func DeleteFlag

func DeleteFlag(c *fiber.Ctx, chall_id int, teamid int64) error

func DeleteRunning

func DeleteRunning(c *fiber.Ctx, chall_id int, teamid int64) error

func EmailExists

func EmailExists(email string) bool

func GenerateChallengeEndpoint

func GenerateChallengeEndpoint(method string, subdomain string, domain string, port int, username ...string) string

func GenerateRandom

func GenerateRandom() string

func GetInstances

func GetInstances(c *fiber.Ctx, teamid int64) ([]models.Instance, error)

func IsRunning

func IsRunning(ctx context.Context, chall_id int, teamid int64) (string, error)

func JoinTeam

func JoinTeam(c *fiber.Ctx, teamname string, userid int64) error

func NewFlag

func NewFlag(c *fiber.Ctx, flagObject *models.Flag) error

func PopulateChalls

func PopulateChalls() error

func ReadChallenges

func ReadChallenges(c *fiber.Ctx, teamid int64) (map[string][]models.Challenge, error)

func ReadScores

func ReadScores(c *fiber.Ctx, page int) (models.ScoreBoard, error)

func TeamExists

func TeamExists(c *fiber.Ctx, teamid int64) bool

func TeamNameExists

func TeamNameExists(teamname string) bool

func UpdateUserTeam

func UpdateUserTeam(c *fiber.Ctx, userid int64, teamid int64) error

func UserExists

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

func UserInTeam

func UserInTeam(c *fiber.Ctx, userid int64) bool

func UsernameRegistered

func UsernameRegistered(username string, email string) bool

func ValidFlagEntry

func ValidFlagEntry(ctx context.Context, chall_id int, teamid int64) (models.Challenge, error)

func ValidOnDemandChallenge

func ValidOnDemandChallenge(c *fiber.Ctx, chall_id int, teamid int64, challenge *models.Challenge, image *models.Image) error

func ValidateCreds

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

func VerifyFlag

func VerifyFlag(c *fiber.Ctx, chall_id int, userid int64, teamid int64, 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