Documentation
¶
Index ¶
- Constants
- func CleanDescription(description string) string
- func IsCTFEventActive(event Event) bool
- type CTFTeam
- type Challenge
- type ChallengeData
- type Challenges
- type Client
- func (c *Client) Authenticate() error
- func (c *Client) Challenge(id int64) (*Challenge, error)
- func (c *Client) Check() error
- func (c *Client) DownloadFiles(id int64, outputPath string) error
- func (c *Client) GetCTFEvent(id int) (Event, error)
- func (c *Client) GetCTFEvents() ([]Event, error)
- func (c *Client) GetCTFTeam(id int) (CTFTeam, error)
- func (c *Client) GetDescription(challenge *Challenge, challengePath string) error
- func (c *Client) GetTopTeams() ([]TopTeam, error)
- func (c *Client) ListChallenges() ([]ChallengeData, error)
- func (c *Client) ScoreboardTop(count int64) (TopTeamData, error)
- type Credentials
- type Event
- type Hint
- type Response
- type Solves
- type Team
- type TopTeam
- type TopTeamData
- type TopTeams
Constants ¶
const ( // Constants for max file sizes (1mb, 5mb, 25mb, 100mb, 0) NoFileSizeLimit = 0 OneMB = 1000000 FiveMB = 5000000 TwentyFiveMB = 25000000 OneHundredMB = 100000000 TwoHhundredFiftyMB = 250000000 )
Variables ¶
This section is empty.
Functions ¶
func CleanDescription ¶ added in v0.0.15
Clean the description of a CTF event, removing \r\n
func IsCTFEventActive ¶ added in v0.0.15
Return if a CTF is currently active
Types ¶
type CTFTeam ¶ added in v0.0.15
type CTFTeam struct {
ID int `json:"id"`
Academic bool `json:"academic"`
PrimaryAlias string `json:"primary_alias"`
Name string `json:"name"`
Logo string `json:"logo"`
Country string `json:"country"`
Aliases []string `json:"aliases"`
Rating map[string]struct {
RatingPlace int `json:"rating_place"`
OrganizerPoints float64 `json:"organizer_points"`
RatingPoints float64 `json:"rating_points"`
CountryPlace int `json:"country_place"`
} `json:"rating"`
}
Struct for API Endpoint ctftime.org/api/v1/teams/
type Challenge ¶
type Challenge struct {
ID int64 `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
ConnectionInfo string `json:"connection_info"`
// NextID int64 `json:"next_id"`
Attempts int64 `json:"attempts"`
MaxAttempts int64 `json:"max_attempts"`
Value int64 `json:"value"`
Category string `json:"category"`
Type string `json:"type"`
TypeData struct {
ID string `json:"id"`
Name string `json:"name"`
Templates struct {
Create string `json:"create"`
Update string `json:"update"`
View string `json:"view"`
} `json:"templates"`
Scripts struct {
Create string `json:"create"`
Update string `json:"update"`
View string `json:"view"`
} `json:"scripts"`
} `json:"type_data"`
State string `json:"state"`
// Requirements []struct {
// ID int64 `json:"id"`
// Name string `json:"name"`
// } `json:"requirements"`
Solves int64 `json:"solves"`
SolvedByMe bool `json:"solved_by_me"`
Files []string `json:"files"`
Hints []Hint `json:"hints"`
Tags []interface{} `json:"tags"`
}
type ChallengeData ¶
type Challenges ¶
type Challenges struct {
Success bool `json:"success"`
Data []ChallengeData `json:"data"`
}
type Client ¶
type Client struct {
Client *http.Client
BaseURL *url.URL
Creds *Credentials
}
func NewClient ¶
func NewClient(transport http.RoundTripper) *Client
NewClient constructs a new Client. If transport is nil, a default transport is used.
func (*Client) Authenticate ¶
Authenticate client to the CTFd instance with the given username, password.
func (*Client) GetCTFEvent ¶ added in v0.0.15
Retrieve information about a specific CTF event on CTFTime
func (*Client) GetCTFEvents ¶ added in v0.0.15
Retrieve all active and upcoming CTF events from ctftime.org/api/v1/events/
func (*Client) GetCTFTeam ¶ added in v0.0.15
Get information about a specific team on CTFTime
func (*Client) GetDescription ¶
GetDescription retrieves a challenge and returns a writeup template of the challenge
func (*Client) GetTopTeams ¶ added in v0.0.15
func (*Client) ListChallenges ¶
func (c *Client) ListChallenges() ([]ChallengeData, error)
USE: func (c *Client) get(urlStr string, a ...interface{}) (*goquery.Document, error) {
func (*Client) ScoreboardTop ¶ added in v0.0.2
func (c *Client) ScoreboardTop(count int64) (TopTeamData, error)
type Credentials ¶ added in v0.0.2
type Event ¶ added in v0.0.15
type Event struct {
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt time.Time
Hidden bool
ID uint64 `json:"id"`
CTFID int `json:"ctf_id"`
Title string `json:"title"`
Description string `json:"description"`
URL string `json:"url"`
URLIsCTFD bool `json:"url_is_ctfd"`
Logo string `json:"logo"`
Weight float64 `json:"weight"`
Onsite bool `json:"onsite"`
Location string `json:"location"`
Restrictions string `json:"restrictions"`
Format string `json:"format"`
FormatID int `json:"format_id"`
Participants int `json:"participants"`
CTFTimeURL string `json:"ctftime_url"`
LiveFeed string `json:"live_feed"`
IsVotableNow bool `json:"is_votable_now"`
PublicVotable bool `json:"public_votable"`
Start time.Time `json:"start"`
Finish time.Time `json:"finish"`
}
Struct for API Endpoint ctftime.org/api/v1/events/
func CleanCTFEvents ¶ added in v0.0.15
Clean CTF Events, return only 'Open' Jeopardy Style CTFs that are either active or upcoming
type Response ¶ added in v0.0.2
type Response struct {
Success bool `json:"success"`
Data TopTeamData `json:"data"`
}