⛳ alerts for any ctfd instance via ntfy
1package types
2
3// ScoreboardResponse represents the top-level response from the CTFd API for scoreboard
4type ScoreboardResponse struct {
5 Success bool `json:"success"`
6 Data []TeamStanding `json:"data"`
7}
8
9// TeamStanding represents a team's standing on the scoreboard
10type TeamStanding struct {
11 Position int `json:"pos"`
12 AccountID int `json:"account_id"`
13 AccountURL string `json:"account_url"`
14 AccountType string `json:"account_type"`
15 OAuthID *string `json:"oauth_id"`
16 Name string `json:"name"`
17 Score int `json:"score"`
18 BracketID *string `json:"bracket_id"`
19 BracketName *string `json:"bracket_name"`
20 Members []Member `json:"members"`
21}
22
23// Member represents a team member
24type Member struct {
25 ID int `json:"id"`
26 OAuthID *string `json:"oauth_id"`
27 Name string `json:"name"`
28 Score int `json:"score"`
29 BracketID *string `json:"bracket_id"`
30 BracketName *string `json:"bracket_name"`
31}
32
33// ChallengeListResponse represents the top-level response from the CTFd API for challenges
34type ChallengeListResponse struct {
35 Success bool `json:"success"`
36 Data []Challenge `json:"data"`
37}
38
39// Challenge represents a CTFd challenge
40type Challenge struct {
41 ID int `json:"id"`
42 Name string `json:"name"`
43 Description string `json:"description"`
44 Attribution string `json:"attribution"`
45 ConnectionInfo string `json:"connection_info"`
46 NextID int `json:"next_id"`
47 MaxAttempts int `json:"max_attempts"`
48 Value int `json:"value"`
49 Category string `json:"category"`
50 Type string `json:"type"`
51 State string `json:"state"`
52 Requirements map[string]any `json:"requirements"`
53 Solves int `json:"solves"`
54 SolvedByMe bool `json:"solved_by_me"`
55}