Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var LoginTokenLifeSpan = 7 * 24 * time.Hour // default is 1week
Functions ¶
Types ¶
type App ¶
type App interface { TeamApp ChallengeApp CTFApp SubmissionApp ScoreFeed(chals []*model.Challenge, teams []*model.Team, submissions []*model.Submission) ([]*Challenge, []*ScoreFeedEntry, error) TaskSolves() (map[*model.Challenge]int64, error) }
type Attachment ¶
type Challenge ¶
type Challenge struct { ID uint32 `json:"id"` Name string `json:"name"` Flag string `json:"flag"` Category string `json:"category"` Description string `json:"description"` Author string `json:"author"` Score uint32 `json:"score"` Tags []string `json:"tags"` Attachments []Attachment `json:"attachments"` SolvedBy []SolvedBy `json:"solved_by"` Host *string `json:"host"` Port *int `json:"port"` IsOpen bool `json:"is_open"` IsRunning bool `json:"is_running"` IsSurvey bool `json:"is_survey"` }
type ChallengeApp ¶
type ChallengeApp interface { GetChallengeByID(challengeID uint32) (*Challenge, error) ListChallengeByIDs(ids []uint32) ([]*Challenge, error) GetChallengeByName(name string) (*Challenge, error) GetRawChallengeByID(challengeID uint32) (*model.Challenge, error) GetRawChallengeByName(name string) (*model.Challenge, error) ListOpenedRawChallenges() ([]*model.Challenge, error) ListAllRawChallenges() ([]*model.Challenge, error) AddChallenge(c *Challenge) error OpenChallenge(challengeID uint32) error CloseChallenge(challengeID uint32) error UpdateChallenge(challengeID uint32, c *Challenge) error SubmitFlag(team *model.Team, ipaddress string, flag string, ctfRunning bool, submitted_at int64) (*model.Challenge, bool, bool, error) }
type ErrorMessage ¶
type ErrorMessage struct {
// contains filtered or unexported fields
}
func NewErrorMessage ¶
func NewErrorMessage(msg string) ErrorMessage
func (ErrorMessage) Error ¶
func (msg ErrorMessage) Error() string
type MessageApp ¶
type MessageApp interface { }
type ScoreFeedEntry ¶
type ScoreFeedEntry struct { Pos int `json:"pos"` Teamname string `json:"team"` Country string `json:"country"` Score int `json:"score"` TaskStats map[string]*TaskStat `json:"taskStats"` TeamID uint32 `json:"team_id"` LastSubmission int64 `json:"last_submission"` }
/ jsonの名前めちゃくちゃに見えるけどctftimeに沿ってるはず
type SubmissionApp ¶
type SubmissionApp interface { ListSubmissions(offset, limit int64) ([]*model.Submission, error) ListSubmissionByIDs(ids []uint32) ([]*model.Submission, error) ListValidSubmissions() ([]*model.Submission, error) ListTeamSubmissions(teamID uint32) ([]*model.Submission, error) CountSubmissions() (int64, error) CountValidSubmissions() (int64, error) GetWrongCount(teamID uint32, duration time.Duration) (int64, error) LockSubmission(teamID uint32, duration time.Duration) error CheckSubmittable(teamID uint32) (bool, error) }
type TeamApp ¶
type TeamApp interface { Login(teamname, password, ipaddress string) (*model.LoginToken, error) RegisterTeam(teamname, password, email, countryCode string) (*model.Team, error) ListTeams() ([]*model.Team, error) ListAllTeams() ([]*model.Team, error) CountTeams() (int64, error) GetAdminTeam() (*model.Team, error) MakeTeamAdmin(t *model.Team) error GetTeamByID(teamID uint32) (*model.Team, error) GetTeamByName(teamName string) (*model.Team, error) GetLoginTeam(token string) (*model.Team, error) PasswordResetRequest(email string) error PasswordReset(token, newpassword string) error PasswordUpdate(team *model.Team, newpassword string) error UpdateTeamname(team *model.Team, newTeamname string) error UpdateEmail(team *model.Team, newEmail string) error UpdateCountry(team *model.Team, newCountryCode string) error }
Click to show internal directories.
Click to hide internal directories.