route

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2022 License: AGPL-3.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TestRouteAdminName     = "cardinal_admin"
	TestRouteAdminPassword = "supersecurepassword"
)

Variables

This section is empty.

Functions

func Init

func Init() *gin.Engine

func NewRouter

func NewRouter() *flamego.Flame

NewRouter returns the router.

func NewTestRoute

func NewTestRoute(t *testing.T) (*flamego.Flame, string, func(tables ...string) error)

NewTestRoute returns the route used for test.

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) ManagerAuthenticator(ctx context.Context, session session.Session) error

func (*AuthHandler) ManagerLogin

func (*AuthHandler) ManagerLogin(ctx context.Context, session session.Session, f form.ManagerLogin) error

func (*AuthHandler) ManagerLogout

func (*AuthHandler) ManagerLogout(ctx context.Context, session session.Session) error

func (*AuthHandler) TeamAuthenticator

func (*AuthHandler) TeamAuthenticator(ctx context.Context, session session.Session) error

func (*AuthHandler) TeamLogin

func (*AuthHandler) TeamLogin(ctx context.Context, session session.Session, f form.TeamLogin) error

func (*AuthHandler) TeamLogout

func (*AuthHandler) TeamLogout(ctx context.Context, session session.Session) error

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) Delete

func (*BulletinHandler) Delete(ctx context.Context, l *i18n.Locale) error

Delete deletes the bulletin with the given id.

func (*BulletinHandler) List

func (*BulletinHandler) List(ctx context.Context) error

List returns all the bulletins.

func (*BulletinHandler) New

New creates a new bulletin with the given options.

func (*BulletinHandler) Update

Update updates the bulletin with the given options.

type ChallengeHandler

type ChallengeHandler struct{}

func NewChallengeHandler

func NewChallengeHandler() *ChallengeHandler

func (*ChallengeHandler) Delete

func (*ChallengeHandler) Delete(ctx context.Context, l *i18n.Locale) error

Delete deletes the challenge with the given ID.

func (*ChallengeHandler) List

List returns all the challenges.

func (*ChallengeHandler) New

New creates a new challenge.

func (*ChallengeHandler) SetVisible

SetVisible sets the challenge's visible.

func (*ChallengeHandler) Update

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

func (*FlagHandler) Get

func (*FlagHandler) Get(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) Delete

func (*GameBoxHandler) Delete(ctx context.Context, l *i18n.Locale) error

Delete removes the game box.

func (*GameBoxHandler) List

func (*GameBoxHandler) List(ctx context.Context) error

List returns all the game boxes.

func (*GameBoxHandler) New

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

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.

func (*GeneralHandler) Hello

func (*GeneralHandler) Hello(c context.Context) error

func (*GeneralHandler) Init

func (*GeneralHandler) NotFound

func (*GeneralHandler) NotFound(c context.Context) error

func (*GeneralHandler) Time

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()

func (*ManagerHandler) Rank

func (*ManagerHandler) Rank(ctx context.Context) error

type TeamHandler

type TeamHandler struct{}

func NewTeamHandler

func NewTeamHandler() *TeamHandler

func (*TeamHandler) Bulletins

func (*TeamHandler) Bulletins(ctx context.Context) error

func (*TeamHandler) Delete

func (*TeamHandler) Delete(ctx context.Context, l *i18n.Locale) error

Delete deletes the team with the given ID.

func (*TeamHandler) GameBoxes

func (*TeamHandler) GameBoxes(ctx context.Context, team *db.Team) error

func (*TeamHandler) Info

func (*TeamHandler) Info(ctx context.Context, team *db.Team) error

func (*TeamHandler) List

func (*TeamHandler) List(ctx context.Context) error

List returns all the teams.

func (*TeamHandler) New

New creates a new team with the given options.

func (*TeamHandler) Rank

func (*TeamHandler) Rank(ctx context.Context) error

func (*TeamHandler) ResetPassword

func (*TeamHandler) ResetPassword(ctx context.Context, l *i18n.Locale) error

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.

Jump to

Keyboard shortcuts

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