Documentation ¶
Index ¶
- Constants
- 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) GetDescription(challenge *Challenge, challengePath string) error
- func (c *Client) ListChallenges() ([]ChallengeData, error)
- func (c *Client) ScoreboardTop(count int64) (TopTeamData, error)
- type Credentials
- type Hint
- type Response
- type Solves
- type Team
- type TopTeamData
Constants ¶
View Source
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 ¶
This section is empty.
Types ¶
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) GetDescription ¶
GetDescription retrieves a challenge and returns a writeup template of the challenge
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 Response ¶ added in v0.0.2
type Response struct { Success bool `json:"success"` Data TopTeamData `json:"data"` }
Click to show internal directories.
Click to hide internal directories.