server

package
v0.0.0-...-381d51a Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClientSeriesMaxTeams = 20
)
View Source
const (
	GRAPHQL_COMPLEXITY_LIMIT = 200
)

Variables

View Source
var (
	AdminUnauthorizedMessage            = "You are not admin"
	AlreadyAuthorizedMessage            = "You are already logged in"
	BucketNullMessage                   = "Bucket information is not registered to the server"
	CTFAlreadyStartedMessage            = "CTF has already started"
	CTFClosedMessage                    = "Competition is closed now"
	CTFNotRunningMessage                = "CTF is not running now"
	CTFNotStartedMessage                = "CTF has not started yet"
	ChallengeAddTemplate                = "Add challenge: `%s`"
	ChallengeAlreadyClosedTemplate      = "`%s` is already closed"
	ChallengeAlreadyOpenedTemplate      = "`%s` is already opened"
	ChallengeCloseTemplate              = "`%s` is closed"
	ChallengeClosedAdminMessage         = "Challenge `%s` closed"
	ChallengeOpenAdminMessage           = "Challenge `%s` opened!"
	ChallengeOpenSystemMessage          = "Challenge `%s` opened!"
	ChallengeOpenTemplate               = "`%s` is opened"
	ChallengeUpdateTemplate             = "Updated the challenge: `%s`"
	ConfigUpdateMessage                 = "Config is updated"
	CorrectSubmissionAdminMessage       = "`%s` solved `%s`: `%s`"
	CorrectSubmissionMessage            = "Correct! You solved `%s`"
	InvalidRequestMessage               = "Invalid request"
	LoginMessage                        = "Logged in"
	LogoutMessage                       = "Logged out"
	NotImplementedMessage               = "Not Implemented"
	PasswordResetEmailSentMessage       = "We've sent you the password reset token"
	PasswordUpdateMessage               = "Password is successfully reset"
	PresignedURLKeyRequiredMessage      = "Key is required"
	ProfileUpdateMessage                = "Team profile is successfully updated"
	RegisteredMessage                   = "Registered!"
	RegistrationClosedMessage           = "Registration is closed now"
	ScoreEmulateMaxCountTooSmallMessage = "maxCount should be larger than 0"
	SolvabilityCheckedSolveMessage      = ":heavy_check_mark: `%s`"
	SolvabilityFailedSystemMessage      = ":warning: `%s`"
	SubmissionLockedMessage             = "Your submission is currently locked. Please wait for minutes."
	UnauthorizedMessage                 = "Login is required"
	ValidSubmissionAdminMessage         = "`%s` solved `%s` :100:, `%s`"
	ValidSubmissionMessage              = "Correct! You solved `%s`"
	ValidSubmissionSystemMessage        = "`%s` solved `%s` :100:"
	WrongSubmissionAdminMessage         = "`%s` submits a wrong flag: `%s`"
	WrongSubmissionMessage              = "Wrong flag..."
	NoSuchTeamMessage                   = "No such team"
)

Functions

func New

func New(app service.App, db *gorm.DB, redis *redis.Client, frontendURL, token string) *server

Types

type Server

type Server interface {
	Start(addr string) error
}

type TeamScoreSeries

type TeamScoreSeries []*TeamScoreSeriesEntry

type TeamScoreSeriesEntry

type TeamScoreSeriesEntry struct {
	Teamname string `json:"teamname"`
	Score    int    `json:"score"`
	Pos      int    `json:"pos"`
	Time     int64  `json:"time"`
}

Jump to

Keyboard shortcuts

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