Documentation ¶
Index ¶
- Constants
- func Init() *gin.Engine
- func NewRouter() *flamego.Flame
- func NewTestRoute(t *testing.T) (*flamego.Flame, string, func(tables ...string) error)
- type AuthHandler
- func (*AuthHandler) ManagerAuthenticator(ctx context.Context, session session.Session) error
- func (*AuthHandler) ManagerLogin(ctx context.Context, session session.Session, f form.ManagerLogin) error
- func (*AuthHandler) ManagerLogout(ctx context.Context, session session.Session) error
- func (*AuthHandler) TeamAuthenticator(ctx context.Context, session session.Session) error
- func (*AuthHandler) TeamLogin(ctx context.Context, session session.Session, f form.TeamLogin) error
- func (*AuthHandler) TeamLogout(ctx context.Context, session session.Session) error
- func (*AuthHandler) TeamTokenAuthenticator(ctx context.Context) error
- type BulletinHandler
- func (*BulletinHandler) Delete(ctx context.Context, l *i18n.Locale) error
- func (*BulletinHandler) List(ctx context.Context) error
- func (*BulletinHandler) New(ctx context.Context, f form.NewBulletin) error
- func (*BulletinHandler) Update(ctx context.Context, f form.UpdateBulletin, l *i18n.Locale) error
- type ChallengeHandler
- func (*ChallengeHandler) Delete(ctx context.Context, l *i18n.Locale) error
- func (*ChallengeHandler) List(ctx context.Context) error
- func (*ChallengeHandler) New(ctx context.Context, f form.NewChallenge, l *i18n.Locale) error
- func (*ChallengeHandler) SetVisible(ctx context.Context, f form.SetChallengeVisible, l *i18n.Locale) error
- func (*ChallengeHandler) Update(ctx context.Context, f form.UpdateChallenge, l *i18n.Locale) error
- type FlagHandler
- type GameBoxHandler
- func (*GameBoxHandler) Delete(ctx context.Context, l *i18n.Locale) error
- func (*GameBoxHandler) List(ctx context.Context) error
- func (*GameBoxHandler) New(ctx context.Context, f form.NewGameBox, l *i18n.Locale) error
- func (*GameBoxHandler) RefreshFlag(ctx context.Context) error
- func (*GameBoxHandler) ResetAll(ctx context.Context) error
- func (*GameBoxHandler) SSHTest(ctx context.Context) error
- func (*GameBoxHandler) Update(ctx context.Context, f form.UpdateGameBox, l *i18n.Locale) error
- type GeneralHandler
- type ManagerHandler
- type TeamHandler
- func (*TeamHandler) Bulletins(ctx context.Context) error
- func (*TeamHandler) Delete(ctx context.Context, l *i18n.Locale) error
- func (*TeamHandler) GameBoxes(ctx context.Context, team *db.Team) error
- func (*TeamHandler) Info(ctx context.Context, team *db.Team) error
- func (*TeamHandler) List(ctx context.Context) error
- func (*TeamHandler) New(ctx context.Context, f form.NewTeam, l *i18n.Locale) error
- func (*TeamHandler) Rank(ctx context.Context) error
- func (*TeamHandler) ResetPassword(ctx context.Context, l *i18n.Locale) error
- func (*TeamHandler) SubmitFlag(ctx context.Context, team *db.Team, f form.SubmitFlag) error
- func (*TeamHandler) Update(ctx context.Context, f form.UpdateTeam, l *i18n.Locale) error
Constants ¶
const ( TestRouteAdminName = "cardinal_admin" TestRouteAdminPassword = "supersecurepassword" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthHandler ¶
type AuthHandler struct{}
AuthHandler is the authenticate request handler.
func NewAuthHandler ¶
func NewAuthHandler() *AuthHandler
NewAuthHandler creates and returns a new authenticate Handler.
func (*AuthHandler) ManagerAuthenticator ¶
func (*AuthHandler) ManagerLogin ¶
func (*AuthHandler) ManagerLogin(ctx context.Context, session session.Session, f form.ManagerLogin) error
func (*AuthHandler) ManagerLogout ¶
func (*AuthHandler) TeamAuthenticator ¶
func (*AuthHandler) TeamLogout ¶
func (*AuthHandler) TeamTokenAuthenticator ¶
func (*AuthHandler) TeamTokenAuthenticator(ctx context.Context) error
type BulletinHandler ¶
type BulletinHandler struct{}
BulletinHandler is the bulletin request handler.
func NewBulletinHandler ¶
func NewBulletinHandler() *BulletinHandler
NewBulletinHandler creates and returns a new bulletin Handler.
func (*BulletinHandler) List ¶
func (*BulletinHandler) List(ctx context.Context) error
List returns all the bulletins.
func (*BulletinHandler) New ¶
func (*BulletinHandler) New(ctx context.Context, f form.NewBulletin) error
New creates a new bulletin with the given options.
func (*BulletinHandler) Update ¶
func (*BulletinHandler) Update(ctx context.Context, f form.UpdateBulletin, l *i18n.Locale) error
Update updates the bulletin with the given options.
type ChallengeHandler ¶
type ChallengeHandler struct{}
func NewChallengeHandler ¶
func NewChallengeHandler() *ChallengeHandler
func (*ChallengeHandler) List ¶
func (*ChallengeHandler) List(ctx context.Context) error
List returns all the challenges.
func (*ChallengeHandler) New ¶
func (*ChallengeHandler) New(ctx context.Context, f form.NewChallenge, l *i18n.Locale) error
New creates a new challenge.
func (*ChallengeHandler) SetVisible ¶
func (*ChallengeHandler) SetVisible(ctx context.Context, f form.SetChallengeVisible, l *i18n.Locale) error
SetVisible sets the challenge's visible.
func (*ChallengeHandler) Update ¶
func (*ChallengeHandler) Update(ctx context.Context, f form.UpdateChallenge, l *i18n.Locale) error
Update updates the challenge with the given ID.
type FlagHandler ¶
type FlagHandler struct{}
func NewFlagHandler ¶
func NewFlagHandler() *FlagHandler
func (*FlagHandler) BatchCreate ¶
func (*FlagHandler) BatchCreate(ctx context.Context) error
type GameBoxHandler ¶
type GameBoxHandler struct{}
GameBoxHandler is the game box request handler.
func NewGameBoxHandler ¶
func NewGameBoxHandler() *GameBoxHandler
NewGameBoxHandler creates and returns a new game box handler.
func (*GameBoxHandler) List ¶
func (*GameBoxHandler) List(ctx context.Context) error
List returns all the game boxes.
func (*GameBoxHandler) New ¶
func (*GameBoxHandler) New(ctx context.Context, f form.NewGameBox, l *i18n.Locale) error
New creates game boxes with the given options.
func (*GameBoxHandler) RefreshFlag ¶
func (*GameBoxHandler) RefreshFlag(ctx context.Context) error
RefreshFlag refreshes the game box flag if the `RenewFlagCommand` was set in challenge. It will connect to the game box instance and run the command to refresh the flag.
func (*GameBoxHandler) ResetAll ¶
func (*GameBoxHandler) ResetAll(ctx context.Context) error
ResetAll resets all the game boxes. It deletes all the game boxes score record and refresh the ranking list.
func (*GameBoxHandler) SSHTest ¶
func (*GameBoxHandler) SSHTest(ctx context.Context) error
SSHTest tests the game box SSH configuration, which try to connect to the game box instance within SSH.
func (*GameBoxHandler) Update ¶
func (*GameBoxHandler) Update(ctx context.Context, f form.UpdateGameBox, l *i18n.Locale) error
Update updates the game box.
type GeneralHandler ¶
type GeneralHandler struct{}
GeneralHandler is the general request handler.
func NewGeneralHandler ¶
func NewGeneralHandler() *GeneralHandler
NewGeneralHandler creates and returns a new GeneralHandler.
type ManagerHandler ¶
type ManagerHandler struct{}
ManagerHandler is the manager request handler.
func NewManagerHandler ¶
func NewManagerHandler() *ManagerHandler
NewManagerHandler creates and returns a new manager Handler.
func (*ManagerHandler) Logs ¶
func (*ManagerHandler) Logs()
func (*ManagerHandler) Panel ¶
func (*ManagerHandler) Panel()
type TeamHandler ¶
type TeamHandler struct{}
func NewTeamHandler ¶
func NewTeamHandler() *TeamHandler
func (*TeamHandler) List ¶
func (*TeamHandler) List(ctx context.Context) error
List returns all the teams.
func (*TeamHandler) ResetPassword ¶
ResetPassword resets team password with the given id.
func (*TeamHandler) SubmitFlag ¶
func (*TeamHandler) SubmitFlag(ctx context.Context, team *db.Team, f form.SubmitFlag) error
SubmitFlag submits a flag.
func (*TeamHandler) Update ¶
func (*TeamHandler) Update(ctx context.Context, f form.UpdateTeam, l *i18n.Locale) error
Update updates the team with the given options.