Documentation ¶
Index ¶
- Constants
- Variables
- func GETEndpoint(next http.HandlerFunc) http.HandlerFunc
- func GetWd() string
- func JSONEndpoint(next http.HandlerFunc) http.HandlerFunc
- func POSTEndpoint(next http.HandlerFunc) http.HandlerFunc
- type Amigo
- type AmigoOpt
- type Category
- type Challenge
- type ChallengeCP
- type Client
- type FrontendData
- type Hooks
- type Hosts
- type Message
- type Middleware
- type Notification
- type Recaptcha
- type Scoreboard
- type TeamRow
- type TeamsCompleted
Constants ¶
View Source
const ( ID_KEY = "I" TEAMNAME_KEY = "TN" )
Variables ¶
View Source
var ( ErrReadBodyTooLarge = errors.New("request body is too large") ErrInvalidTokenFormat = errors.New("invalid token format") ErrInvalidFlag = errors.New("invalid flag") ErrIncorrectCredentials = errors.New("Credentials does not match") ErrTeamNameEmpty = errors.New("Team name can NOT be empty") ErrTeamNameToLarge = errors.New("Team name is too long") ErrTeamNameCharacters = errors.New("Team name should NOT contain non-alphanumeric characters") ErrEmailEmpty = errors.New("Email can NOT be empty") ErrEmailToLarge = errors.New("Email is NOT within the defined character limit") ErrEmailCharacters = errors.New("Non alphabetic characters are NOT allowed in email address such as - , { [ _ ") ErrProtectedEvent = errors.New("UNABLE TO SIGNUP: WRONG SECRET KEY FOR PROTECTED EVENT ! \n ASK EVENT ADMINISTRATOR FOR SECRET KEY FOR THIS EVENT ! ") )
Functions ¶
func GETEndpoint ¶
func GETEndpoint(next http.HandlerFunc) http.HandlerFunc
Check if the request method is GET
func JSONEndpoint ¶
func JSONEndpoint(next http.HandlerFunc) http.HandlerFunc
Check if the content-type of the request is in json
func POSTEndpoint ¶
func POSTEndpoint(next http.HandlerFunc) http.HandlerFunc
Check if the request method is POST
Types ¶
type Amigo ¶
type Amigo struct { TeamStore store.Event FrontEndData *FrontendData // contains filtered or unexported fields }
func NewAmigo ¶
func NewAmigo(ts store.Event, chals []store.ChildrenChalConfig, reCaptchaKey string, wgClient wg.WireguardClient, opts ...AmigoOpt) *Amigo
func (*Amigo) GetFrontendData ¶
func (am *Amigo) GetFrontendData() *FrontendData
func (*Amigo) PauseSignup ¶
func (*Amigo) SetNotification ¶
func (am *Amigo) SetNotification(n Notification)
type Category ¶
type Category struct { CategoryName string `json:"category"` Challenges []Challenge `json:"chals"` }
Contains a list of Challenges relative the CategoryName
type Challenge ¶
type Challenge struct { Name string `json:"name"` Tag string `json:"tag"` Points uint `json:"points"` }
Challenge name and the points relative that challenge
type ChallengeCP ¶
type ChallengeCP struct { ChalInfo store.ChildrenChalConfig `json:"challenge"` IsUserCompleted bool `json:"isUserCompleted"` TeamsCompleted []TeamsCompleted `json:"teamsCompleted"` IsDisabledChal bool `json:"isChalDisabled"` }
Challenge for Challenges Page. It contains the challenge information, which team has solved that challenge and if the current user has solve that challenge
type FrontendData ¶
type FrontendData struct {
// contains filtered or unexported fields
}
func NewFrontendData ¶
func NewFrontendData(ts store.TeamStore, chals ...store.ChildrenChalConfig) *FrontendData
func (*FrontendData) RunFrontendData ¶
func (fd *FrontendData) RunFrontendData()
func (*FrontendData) UpdateChallenges ¶
func (fd *FrontendData) UpdateChallenges(chals []store.ChildrenChalConfig)
type Middleware ¶
type Middleware func(http.HandlerFunc) http.HandlerFunc
type Notification ¶
type Recaptcha ¶
type Recaptcha struct {
// contains filtered or unexported fields
}
func NewRecaptcha ¶
type Scoreboard ¶
type TeamRow ¶
type TeamsCompleted ¶
Click to show internal directories.
Click to hide internal directories.