Documentation ¶
Index ¶
- func Contains(uints []uint, i uint) bool
- func GetErrorFromHtml(res http.Response) (*string, error)
- type ApiResponse
- type AuthStruct
- type Client
- func (client *Client) CheckSetup() error
- func (client *Client) CreateCtfdSetup(setup CtfdSetup) error
- func (client *Client) CreateTeam(team NewTeam) (*Team, error)
- func (client *Client) CreateToken() (newToken *Token, err error)
- func (client *Client) CreateUser(user NewUser) (*User, error)
- func (client *Client) CreateUserTeamMembership(teamId uint, userId uint) (*UserTeamMembership, error)
- func (client *Client) DeleteCtfdSetup() error
- func (client *Client) DeleteTeam(id uint) error
- func (client *Client) DeleteUser(id uint) error
- func (client *Client) DeleteUserTeamMembership(teamId uint, userId uint) error
- func (client *Client) DoApiRequest(req *http.Request) (*json.RawMessage, error)
- func (client *Client) DoRequest(req *http.Request) (io.ReadCloser, error)
- func (client *Client) GetChallenges() (interface{}, error)
- func (client *Client) GetCtfdSetup() (*CtfdSetup, error)
- func (client *Client) GetOrCreateToken() (*Token, error)
- func (client *Client) GetTeam(id uint) (*Team, error)
- func (client *Client) GetTeamMemberships(id uint) (*[]uint, error)
- func (client *Client) GetTeams() (interface{}, error)
- func (client *Client) GetTokens() (*[]Token, error)
- func (client *Client) GetUser(id uint) (*User, error)
- func (client *Client) GetUsers() (interface{}, error)
- func (client *Client) SignIn() error
- func (client *Client) SignOut() error
- func (client *Client) UpdateTeam(id uint, team NewTeam) (*Team, error)
- func (client *Client) UpdateUser(id uint, user NewUser) (*User, error)
- type CtfdSetup
- type EmailConfig
- type Meta
- type NewTeam
- type NewUser
- type Pagination
- type Team
- type Token
- type User
- type UserTeamMembership
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ApiResponse ¶
type ApiResponse struct { Meta *Meta `json:"meta"` Success bool `json:"success"` Message string `json:"message"` Data *json.RawMessage `json:"data"` }
ApiResponse -
type AuthStruct ¶
type AuthStruct struct { Username string `json:"username"` Password string `json:"password"` Nonce string `json:"nonce"` Token string `json:"token"` }
AuthStruct -
type Client ¶
type Client struct { HostUrl string HttpClient *http.Client Auth AuthStruct UserAgent string }
Client -
func (*Client) CheckSetup ¶
CheckSetup - verify that a CTFd instance has been setup
func (*Client) CreateCtfdSetup ¶
CreateCtfdSetup - setup a new CTFd instance
func (*Client) CreateTeam ¶
CreateTeam - create a new team
func (*Client) CreateToken ¶
CreateToken - create a token object
func (*Client) CreateUser ¶
CreateUser - create a new user
func (*Client) CreateUserTeamMembership ¶
func (client *Client) CreateUserTeamMembership(teamId uint, userId uint) (*UserTeamMembership, error)
CreateUserTeamMembership - create a new userTeamMembership
func (*Client) DeleteCtfdSetup ¶
DeleteCtfdSetup - remove CTFd setup
func (*Client) DeleteTeam ¶
DeleteTeam - remove an existing team
func (*Client) DeleteUser ¶
DeleteUser - remove an existing user
func (*Client) DeleteUserTeamMembership ¶
DeleteUserTeamMembership - remove an existing userTeamMembership
func (*Client) DoApiRequest ¶
func (*Client) GetChallenges ¶
GetChallenges - Returns list of challenges
func (*Client) GetCtfdSetup ¶
GetCtfdSetup - Retrieve details of the CTFd setup
func (*Client) GetOrCreateToken ¶
GetOrCreateToken - re-use or create a token object
func (*Client) GetTeamMemberships ¶
GetTeamMemberships - Returns memberships of a team
func (*Client) UpdateTeam ¶
UpdateTeam - updated an existing team
type CtfdSetup ¶
type CtfdSetup struct { Name string `json:"name"` Description string `json:"description"` AdminEmail string `json:"admin_email"` ConfigurationPath string `json:"configuration_path"` Email *EmailConfig `json:"email"` }
CtfdSetup - `ctfd_setup` resource
type EmailConfig ¶
type EmailConfig struct { Username string `json:"mail_username"` Password string `json:"mail_password"` FromAddress string `json:"mailfrom_addr"` Server string `json:"mail_server"` Port int `json:"mail_port"` UseAuth bool `json:"mail_useauth"` UseTls bool `json:"mail_tls"` UseSsl bool `json:"mail_ssl"` }
type NewUser ¶
type NewUser struct { Name string `json:"name"` Email string `json:"email"` Password string `json:"password"` Website string `json:"website"` Affiliation string `json:"affiliation"` Country string `json:"country"` Hidden bool `json:"hidden"` Banned bool `json:"banned"` Type string `json:"type"` Verified bool `json:"verified"` }
NewUser - fields required when creating a new user
type Pagination ¶
type Pagination struct { Page uint `json:"page"` Next *uint `json:"next"` Prev *uint `json:"prev"` Pages uint `json:"pages"` PerPage uint `json:"per_page"` Total uint `json:"total"` }
Pagination -
type Team ¶
type Team struct { Name string `json:"name"` Email string `json:"email"` Password string `json:"password"` Website string `json:"website"` Affiliation string `json:"affiliation"` Country string `json:"country"` Hidden bool `json:"hidden"` Banned bool `json:"banned"` CaptainId *uint `json:"captain_id"` Bracket string `json:"bracket"` Id uint `json:"id"` Secret string `json:"secret"` OauthId string `json:"oauth_id"` Members []uint `json:"members"` Created string `json:"created"` Fields []string `json:"fields"` }
type User ¶
type User struct { Id uint `json:"id"` Name string `json:"name"` Email string `json:"email"` Password string `json:"password"` Website string `json:"website"` Affiliation string `json:"affiliation"` Country string `json:"country"` Bracket string `json:"bracket"` Secret string `json:"secret"` OauthId string `json:"oauth_id"` Fields []string `json:"fields"` Type string `json:"type"` TeamId uint `json:"team_id"` Verified bool `json:"verified"` Hidden bool `json:"hidden"` Banned bool `json:"banned"` }
User - fields as returned from the CTFd API
type UserTeamMembership ¶
UserTeamMembership - fields as returned from the CTFd API