Documentation
¶
Index ¶
- func GetNonceAndSession(url string, opts ...Option) (string, string, error)
- type Attempt
- type Award
- type CUV
- type Challenge
- type Client
- func (client *Client) DeleteAward(id string, opts ...Option) error
- func (client *Client) DeleteChallenge(id string, opts ...Option) error
- func (client *Client) DeleteComment(id int, opts ...Option) error
- func (client *Client) DeleteConfigsByKey(key string, opts ...Option) error
- func (client *Client) DeleteConfigsField(id string, opts ...Option) error
- func (client *Client) DeleteFile(id string, opts ...Option) error
- func (client *Client) DeleteFlag(id string, opts ...Option) error
- func (client *Client) DeleteHint(id string, opts ...Option) error
- func (client *Client) DeleteNotification(id string, opts ...Option) error
- func (client *Client) DeletePage(id string, opts ...Option) error
- func (client *Client) DeleteSubmission(id string, opts ...Option) error
- func (client *Client) DeleteTag(id string, opts ...Option) error
- func (client *Client) DeleteTeam(id int, opts ...Option) error
- func (client *Client) DeleteTeamMembers(id int, params *DeleteTeamMembersParams, opts ...Option) ([]int, error)
- func (client *Client) DeleteTeamsMe(opts ...Option) error
- func (client *Client) DeleteToken(id string, opts ...Option) error
- func (client *Client) DeleteTopic(id string, opts ...Option) error
- func (client *Client) DeleteUser(id int, opts ...Option) error
- func (client *Client) Do(req *http.Request) (*http.Response, error)
- func (client *Client) GetAward(id string, opts ...Option) (*Award, error)
- func (client *Client) GetAwards(params *GetAwardsParams, opts ...Option) ([]*Award, error)
- func (client *Client) GetChallenge(id string, opts ...Option) (*Challenge, error)
- func (client *Client) GetChallengeFiles(id string, opts ...Option) ([]*File, error)
- func (client *Client) GetChallengeFlags(id string, opts ...Option) ([]*Flag, error)
- func (client *Client) GetChallengeHints(id string, opts ...Option) ([]*Hint, error)
- func (client *Client) GetChallengeRequirements(id string, opts ...Option) (*Requirements, error)
- func (client *Client) GetChallengeSolves(id string, opts ...Option) (*Challenge, error)
- func (client *Client) GetChallengeTags(id string, opts ...Option) ([]*Tag, error)
- func (client *Client) GetChallengeTopics(id string, opts ...Option) ([]*Topic, error)
- func (client *Client) GetChallenges(params *GetChallengesParams, opts ...Option) ([]*Challenge, error)
- func (client *Client) GetChallengesTypes(opts ...Option) (map[string]*Type, error)
- func (client *Client) GetComments(params *GetCommentsParams, opts ...Option) ([]*Comment, error)
- func (client *Client) GetConfigs(params *GetConfigsParams, opts ...Option) ([]*Config, error)
- func (client *Client) GetConfigsByKey(key string, opts ...Option) (any, error)
- func (client *Client) GetConfigsField(id string, opts ...Option) (*ConfigField, error)
- func (client *Client) GetConfigsFields(params *GetConfigsParams, opts ...Option) ([]*ConfigField, error)
- func (client *Client) GetFile(id string, opts ...Option) (*File, error)
- func (client *Client) GetFileContent(file *File, opts ...Option) ([]byte, error)
- func (client *Client) GetFiles(params *GetFilesParams, opts ...Option) ([]*File, error)
- func (client *Client) GetFlag(id string, opts ...Option) (*Flag, error)
- func (client *Client) GetFlags(params *GetFlagsParams, opts ...Option) ([]*Flag, error)
- func (client *Client) GetFlagsType(typename string, opts ...Option) (*Type, error)
- func (client *Client) GetFlagsTypes(opts ...Option) (map[string]*Type, error)
- func (client *Client) GetHint(id string, opts ...Option) (*Hint, error)
- func (client *Client) GetHints(params *GetHintsParams, opts ...Option) ([]*Hint, error)
- func (client *Client) GetNotification(id string, opts ...Option) (*Notification, error)
- func (client *Client) GetNotifications(params *GetNotificationsParams, opts ...Option) ([]*Notification, error)
- func (client *Client) GetPage(id string, opts ...Option) (*Page, error)
- func (client *Client) GetPages(params *GetPagesParams, opts ...Option) ([]*Page, error)
- func (client *Client) GetScoreboard(opts ...Option) ([]*Scoreboard, error)
- func (client *Client) GetScoreboardTop(count int, opts ...Option) ([]*Scoreboard, error)
- func (client *Client) GetStatisticsChallengesColumn(column string, opts ...Option) (map[string]int, error)
- func (client *Client) GetStatisticsChallengesSolves(opts ...Option) ([]*StatChallSubmission, error)
- func (client *Client) GetStatisticsScoresDistribution(opts ...Option) (*Distribution, error)
- func (client *Client) GetStatisticsSubmissionsColumn(column string, opts ...Option) (map[string]int, error)
- func (client *Client) GetStatisticsTeams(opts ...Option) (*StatTeams, error)
- func (client *Client) GetStatisticsUsers(opts ...Option) (*StatUsers, error)
- func (client *Client) GetStatisticsUsersColumn(column string, opts ...Option) (*StatUsers, error)
- func (client *Client) GetSubmission(id string, opts ...Option) (*Submission, error)
- func (client *Client) GetSubmissions(params *GetSubmissionsParams, opts ...Option) ([]*Submission, error)
- func (client *Client) GetTag(id string, opts ...Option) (*Tag, error)
- func (client *Client) GetTags(params *GetTagsParams, opts ...Option) ([]*Tag, error)
- func (client *Client) GetTeam(id int, opts ...Option) (*Team, error)
- func (client *Client) GetTeamAwards(id int, opts ...Option) ([]*Award, error)
- func (client *Client) GetTeamFails(id int, opts ...Option) ([]*Submission, error)
- func (client *Client) GetTeamMembers(id int, opts ...Option) ([]int, error)
- func (client *Client) GetTeamSolves(id int, opts ...Option) ([]*Submission, error)
- func (client *Client) GetTeams(params *GetTeamsParams, opts ...Option) ([]*Team, error)
- func (client *Client) GetTeamsMe(opts ...Option) (*Team, error)
- func (client *Client) GetTeamsMeAwards(opts ...Option) ([]*Award, error)
- func (client *Client) GetTeamsMeFails(opts ...Option) ([]*Submission, error)
- func (client *Client) GetTeamsMeSolves(opts ...Option) ([]*Submission, error)
- func (client *Client) GetToken(id string, opts ...Option) (*Token, error)
- func (client *Client) GetTokens(opts ...Option) ([]*Token, error)
- func (client *Client) GetTopic(id string, opts ...Option) (*Topic, error)
- func (client *Client) GetTopics(params *GetTopicsParams, opts ...Option) ([]*Topic, error)
- func (client *Client) GetUnlocks(params *GetUnlocksParams, opts ...Option) ([]*Unlock, error)
- func (client *Client) GetUser(id int, opts ...Option) (*User, error)
- func (client *Client) GetUserAwards(id int, opts ...Option) ([]*Award, error)
- func (client *Client) GetUserFails(id int, opts ...Option) ([]*Submission, error)
- func (client *Client) GetUserSolves(id int, opts ...Option) ([]*Submission, error)
- func (client *Client) GetUsers(params *GetUsersParams, opts ...Option) ([]*User, error)
- func (client *Client) GetUsersMe(opts ...Option) (*User, error)
- func (client *Client) GetUsersMeAwards(opts ...Option) ([]*Award, error)
- func (client *Client) GetUsersMeFails(opts ...Option) ([]*Submission, error)
- func (client *Client) GetUsersMeSolves(opts ...Option) ([]*Submission, error)
- func (client *Client) HeadNotifications(params *HeadNotificationsParams, opts ...Option) (int, error)
- func (client *Client) Login(params *LoginParams, opts ...Option) error
- func (client *Client) Logout(opts ...Option) error
- func (client *Client) PatchChallenge(id string, params *PatchChallengeParams, opts ...Option) (*Challenge, error)
- func (client *Client) PatchConfigs(params *PatchConfigsParams, opts ...Option) error
- func (client *Client) PatchConfigsByKey(key string, params any, opts ...Option) (any, error)
- func (client *Client) PatchConfigsField(id string, params PatchConfigsFieldParams, opts ...Option) (*ConfigField, error)
- func (client *Client) PatchFlag(id string, params *PatchFlagParams, opts ...Option) (*Flag, error)
- func (client *Client) PatchHint(id string, params *PatchHintsParams, opts ...Option) (*Hint, error)
- func (client *Client) PatchPage(id string, params *PatchPageParams, opts ...Option) (*Page, error)
- func (client *Client) PatchTags(id string, params *PatchTagsParams, opts ...Option) (*Tag, error)
- func (client *Client) PatchTeam(id int, params *PatchTeamsParams, opts ...Option) (*Team, error)
- func (client *Client) PatchTeamsMe(params *PatchTeamsParams, opts ...Option) (*Team, error)
- func (client *Client) PatchUser(id int, params *PatchUsersParams, opts ...Option) (*User, error)
- func (client *Client) PatchUsersMe(params *PatchUsersParams, opts ...Option) (*User, error)
- func (client *Client) PostAwards(params *PostAwardsParams, opts ...Option) (*Award, error)
- func (client *Client) PostChallenges(params *PostChallengesParams, opts ...Option) (*Challenge, error)
- func (client *Client) PostChallengesAttempt(params *PostChallengesAttemptParams, opts ...Option) (*Attempt, error)
- func (client *Client) PostComments(params *PostCommentsParams, opts ...Option) (*Comment, error)
- func (client *Client) PostConfigFields(params *PostConfigFieldsParams, opts ...Option) (*ConfigField, error)
- func (client *Client) PostConfigs(params *PostConfigsParams, opts ...Option) (*Config, error)
- func (client *Client) PostFiles(params *PostFilesParams, opts ...Option) ([]*File, error)
- func (client *Client) PostFlags(params *PostFlagsParams, opts ...Option) (*Flag, error)
- func (client *Client) PostHints(params *PostHintsParams, opts ...Option) (*Hint, error)
- func (client *Client) PostNotifications(params *PostNotificationsParams, opts ...Option) (*Notification, error)
- func (client *Client) PostPages(params *PostPagesParams, opts ...Option) (*Page, error)
- func (client *Client) PostTags(params *PostTagsParams, opts ...Option) (*Tag, error)
- func (client *Client) PostTeamMembers(id int, params *PostTeamsMembers, opts ...Option) (*Team, error)
- func (client *Client) PostTeams(params *PostTeamsParams, opts ...Option) (*Team, error)
- func (client *Client) PostTeamsMeMembers(params *PostTeamsMembers, opts ...Option) (*Team, error)
- func (client *Client) PostTokens(params *PostTokensParams, opts ...Option) (*Token, error)
- func (client *Client) PostTopics(params *PostTopicsParams, opts ...Option) (*Topic, error)
- func (client *Client) PostUnlocks(params *PostUnlocksParams, opts ...Option) (*Unlock, error)
- func (client *Client) PostUserMail(params *PostUserMailParams, id int, opts ...Option) (any, error)
- func (client *Client) PostUsers(params *PostUsersParams, opts ...Option) (*User, error)
- func (client *Client) Register(params *RegisterParams, opts ...Option) error
- func (client *Client) Reset(params *ResetParams, opts ...Option) error
- func (client *Client) SetAPIKey(apiKey string)
- func (client *Client) Setup(params *SetupParams, opts ...Option) error
- type Comment
- type Config
- type ConfigField
- type DeleteTeamMembersParams
- type Distribution
- type Field
- type File
- type Flag
- type GetAwardsParams
- type GetChallengesParams
- type GetCommentsParams
- type GetConfigsFieldsParams
- type GetConfigsParams
- type GetFilesParams
- type GetFlagsParams
- type GetHintsParams
- type GetNotificationsParams
- type GetPagesParams
- type GetSubmissionsParams
- type GetTagsParams
- type GetTeamsParams
- type GetTopicsParams
- type GetUnlocksParams
- type GetUsersParams
- type HeadNotificationsParams
- type Hint
- type InputFile
- type LoginParams
- type Notification
- type Option
- type Page
- type PatchChallengeParams
- type PatchConfigsFieldParams
- type PatchConfigsParams
- type PatchFlagParams
- type PatchHintsParams
- type PatchPageParams
- type PatchTagsParams
- type PatchTeamsParams
- type PatchUsersParams
- type PostAwardsParams
- type PostChallengesAttemptParams
- type PostChallengesParams
- type PostCommentsParams
- type PostConfigFieldsParams
- type PostConfigsParams
- type PostFilesParams
- type PostFlagsParams
- type PostHintsParams
- type PostNotificationsParams
- type PostPagesParams
- type PostTagsParams
- type PostTeamsMembers
- type PostTeamsParams
- type PostTokensParams
- type PostTopicsParams
- type PostUnlocksParams
- type PostUserMailParams
- type PostUsersParams
- type RegisterParams
- type Requirements
- type ResetParams
- type Response
- type Scoreboard
- type SetupParams
- type StatChallSubmission
- type StatTeams
- type StatUsers
- type Submission
- type Tag
- type Team
- type Token
- type Topic
- type Type
- type Unlock
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Award ¶
type Award struct {
ID int `json:"id"`
TeamID int `json:"team_id"`
Category *string `json:"category"`
UserID int `json:"user_id"`
Team int `json:"team"` // XXX may be duplicated with ID ?
Date string `json:"date"`
Description *string `json:"description"`
User int `json:"user"` // XXX may be duplicated with UserID ?
Type string `json:"type"`
Value int `json:"value"`
Requirements *Requirements `json:"requirements"`
Name string `json:"name"`
Icon string `json:"icon"`
}
type Challenge ¶
type Challenge struct {
ID int `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
ConnectionInfo string `json:"connection_info"`
NextID int `json:"next_id"`
MaxAttempts int `json:"max_attempts"`
Value *int `json:"value,omitempty"`
Initial *int `json:"initial,omitempty"`
Decay *int `json:"decay,omitempty"`
Minimum *int `json:"minimum,omitempty"`
Category string `json:"category"`
Type string `json:"type"`
TypeDate *Type `json:"type_data,omitempty"`
State string `json:"state"`
Requirements any `json:"requirements"` // TODO find model, maybe []int with others challs ID ?
Solves int `json:"solves"`
SolvedByMe bool `json:"solved_by_me"`
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is in charge of interacting with a CTFd instance.
func NewClient ¶
NewClient creates a fresh *Client. It automatically handles the session and its updates (login, logout...).
func (*Client) DeleteChallenge ¶
func (*Client) DeleteConfigsByKey ¶
TODO confirm delete does not take parameters and returns anything
func (*Client) DeleteConfigsField ¶
func (*Client) DeleteNotification ¶
func (*Client) DeleteSubmission ¶
func (*Client) DeleteTeamMembers ¶
func (client *Client) DeleteTeamMembers(id int, params *DeleteTeamMembersParams, opts ...Option) ([]int, error)
XXX mixture of DELETE and body for control should be cleaned
func (*Client) DeleteTeamsMe ¶
func (*Client) DeleteTopic ¶
XXX this API endpoint should be aligned with the others.
func (*Client) GetAwards ¶
func (client *Client) GetAwards(params *GetAwardsParams, opts ...Option) ([]*Award, error)
func (*Client) GetChallenge ¶
func (*Client) GetChallengeFiles ¶
func (*Client) GetChallengeFlags ¶
func (*Client) GetChallengeHints ¶
func (*Client) GetChallengeRequirements ¶
func (client *Client) GetChallengeRequirements(id string, opts ...Option) (*Requirements, error)
func (*Client) GetChallengeSolves ¶
TODO find content to determine model
func (*Client) GetChallengeTags ¶
func (*Client) GetChallengeTopics ¶
func (*Client) GetChallenges ¶
func (client *Client) GetChallenges(params *GetChallengesParams, opts ...Option) ([]*Challenge, error)
func (*Client) GetChallengesTypes ¶
func (*Client) GetComments ¶
func (client *Client) GetComments(params *GetCommentsParams, opts ...Option) ([]*Comment, error)
func (*Client) GetConfigs ¶
func (client *Client) GetConfigs(params *GetConfigsParams, opts ...Option) ([]*Config, error)
func (*Client) GetConfigsByKey ¶
TODO find model
func (*Client) GetConfigsField ¶
func (client *Client) GetConfigsField(id string, opts ...Option) (*ConfigField, error)
func (*Client) GetConfigsFields ¶
func (client *Client) GetConfigsFields(params *GetConfigsParams, opts ...Option) ([]*ConfigField, error)
func (*Client) GetFileContent ¶ added in v0.1.4
func (*Client) GetFiles ¶
func (client *Client) GetFiles(params *GetFilesParams, opts ...Option) ([]*File, error)
func (*Client) GetFlags ¶
func (client *Client) GetFlags(params *GetFlagsParams, opts ...Option) ([]*Flag, error)
func (*Client) GetFlagsType ¶
func (*Client) GetFlagsTypes ¶
func (*Client) GetHints ¶
func (client *Client) GetHints(params *GetHintsParams, opts ...Option) ([]*Hint, error)
func (*Client) GetNotification ¶
func (client *Client) GetNotification(id string, opts ...Option) (*Notification, error)
func (*Client) GetNotifications ¶
func (client *Client) GetNotifications(params *GetNotificationsParams, opts ...Option) ([]*Notification, error)
func (*Client) GetPages ¶
func (client *Client) GetPages(params *GetPagesParams, opts ...Option) ([]*Page, error)
func (*Client) GetScoreboard ¶
func (client *Client) GetScoreboard(opts ...Option) ([]*Scoreboard, error)
func (*Client) GetScoreboardTop ¶
func (client *Client) GetScoreboardTop(count int, opts ...Option) ([]*Scoreboard, error)
func (*Client) GetStatisticsChallengesColumn ¶
func (*Client) GetStatisticsChallengesSolves ¶
func (client *Client) GetStatisticsChallengesSolves(opts ...Option) ([]*StatChallSubmission, error)
func (*Client) GetStatisticsScoresDistribution ¶
func (client *Client) GetStatisticsScoresDistribution(opts ...Option) (*Distribution, error)
func (*Client) GetStatisticsSubmissionsColumn ¶
func (*Client) GetStatisticsTeams ¶
func (*Client) GetStatisticsUsers ¶
func (*Client) GetStatisticsUsersColumn ¶
func (*Client) GetSubmission ¶
func (client *Client) GetSubmission(id string, opts ...Option) (*Submission, error)
func (*Client) GetSubmissions ¶
func (client *Client) GetSubmissions(params *GetSubmissionsParams, opts ...Option) ([]*Submission, error)
TODO support pagination ? CTFd does not seem to support parameters for this
func (*Client) GetTags ¶
func (client *Client) GetTags(params *GetTagsParams, opts ...Option) ([]*Tag, error)
func (*Client) GetTeamAwards ¶
func (*Client) GetTeamFails ¶
func (client *Client) GetTeamFails(id int, opts ...Option) ([]*Submission, error)
func (*Client) GetTeamMembers ¶
func (*Client) GetTeamSolves ¶
func (client *Client) GetTeamSolves(id int, opts ...Option) ([]*Submission, error)
func (*Client) GetTeams ¶
func (client *Client) GetTeams(params *GetTeamsParams, opts ...Option) ([]*Team, error)
func (*Client) GetTeamsMeAwards ¶
func (*Client) GetTeamsMeFails ¶
func (client *Client) GetTeamsMeFails(opts ...Option) ([]*Submission, error)
func (*Client) GetTeamsMeSolves ¶
func (client *Client) GetTeamsMeSolves(opts ...Option) ([]*Submission, error)
func (*Client) GetToken ¶
XXX Using this endpoint, you could get back the token value which is not a desired behaviour !
func (*Client) GetTopics ¶
func (client *Client) GetTopics(params *GetTopicsParams, opts ...Option) ([]*Topic, error)
func (*Client) GetUnlocks ¶
func (client *Client) GetUnlocks(params *GetUnlocksParams, opts ...Option) ([]*Unlock, error)
func (*Client) GetUserAwards ¶
func (*Client) GetUserFails ¶
func (client *Client) GetUserFails(id int, opts ...Option) ([]*Submission, error)
func (*Client) GetUserSolves ¶
func (client *Client) GetUserSolves(id int, opts ...Option) ([]*Submission, error)
func (*Client) GetUsers ¶
func (client *Client) GetUsers(params *GetUsersParams, opts ...Option) ([]*User, error)
TODO handle pagination, but don't seem supported by CTFd API
func (*Client) GetUsersMeAwards ¶
func (*Client) GetUsersMeFails ¶
func (client *Client) GetUsersMeFails(opts ...Option) ([]*Submission, error)
func (*Client) GetUsersMeSolves ¶
func (client *Client) GetUsersMeSolves(opts ...Option) ([]*Submission, error)
func (*Client) HeadNotifications ¶
func (client *Client) HeadNotifications(params *HeadNotificationsParams, opts ...Option) (int, error)
XXX does not need to be authenticated
func (*Client) Login ¶
func (client *Client) Login(params *LoginParams, opts ...Option) error
Returns the session value or an error.
WARNING 1: this endpoint is not officially supported. WARNING 2: provided client must have a no-follow-redirect behaviour, or a cookie jar. Else, it won't detect the login worked properly thus won't extract and save the new session id.
func (*Client) PatchChallenge ¶
func (*Client) PatchConfigs ¶
func (client *Client) PatchConfigs(params *PatchConfigsParams, opts ...Option) error
func (*Client) PatchConfigsByKey ¶
TODO find input model
func (*Client) PatchConfigsField ¶
func (client *Client) PatchConfigsField(id string, params PatchConfigsFieldParams, opts ...Option) (*ConfigField, error)
func (*Client) PatchTeamsMe ¶
func (client *Client) PatchTeamsMe(params *PatchTeamsParams, opts ...Option) (*Team, error)
func (*Client) PatchUsersMe ¶
func (client *Client) PatchUsersMe(params *PatchUsersParams, opts ...Option) (*User, error)
func (*Client) PostAwards ¶
func (client *Client) PostAwards(params *PostAwardsParams, opts ...Option) (*Award, error)
func (*Client) PostChallenges ¶
func (client *Client) PostChallenges(params *PostChallengesParams, opts ...Option) (*Challenge, error)
func (*Client) PostChallengesAttempt ¶
func (client *Client) PostChallengesAttempt(params *PostChallengesAttemptParams, opts ...Option) (*Attempt, error)
func (*Client) PostComments ¶
func (client *Client) PostComments(params *PostCommentsParams, opts ...Option) (*Comment, error)
func (*Client) PostConfigFields ¶
func (client *Client) PostConfigFields(params *PostConfigFieldsParams, opts ...Option) (*ConfigField, error)
func (*Client) PostConfigs ¶
func (client *Client) PostConfigs(params *PostConfigsParams, opts ...Option) (*Config, error)
func (*Client) PostFiles ¶
func (client *Client) PostFiles(params *PostFilesParams, opts ...Option) ([]*File, error)
func (*Client) PostFlags ¶
func (client *Client) PostFlags(params *PostFlagsParams, opts ...Option) (*Flag, error)
func (*Client) PostHints ¶
func (client *Client) PostHints(params *PostHintsParams, opts ...Option) (*Hint, error)
func (*Client) PostNotifications ¶
func (client *Client) PostNotifications(params *PostNotificationsParams, opts ...Option) (*Notification, error)
func (*Client) PostPages ¶
func (client *Client) PostPages(params *PostPagesParams, opts ...Option) (*Page, error)
XXX find if could use constraint error on .route to get a shell using the PIN form on sqlalchemy.exc.IntegrityError
func (*Client) PostTags ¶
func (client *Client) PostTags(params *PostTagsParams, opts ...Option) (*Tag, error)
func (*Client) PostTeamMembers ¶
func (*Client) PostTeams ¶
func (client *Client) PostTeams(params *PostTeamsParams, opts ...Option) (*Team, error)
func (*Client) PostTeamsMeMembers ¶
func (client *Client) PostTeamsMeMembers(params *PostTeamsMembers, opts ...Option) (*Team, error)
func (*Client) PostTokens ¶
func (client *Client) PostTokens(params *PostTokensParams, opts ...Option) (*Token, error)
func (*Client) PostTopics ¶
func (client *Client) PostTopics(params *PostTopicsParams, opts ...Option) (*Topic, error)
func (*Client) PostUnlocks ¶
func (client *Client) PostUnlocks(params *PostUnlocksParams, opts ...Option) (*Unlock, error)
func (*Client) PostUserMail ¶
TODO find model when email turned on
func (*Client) PostUsers ¶
func (client *Client) PostUsers(params *PostUsersParams, opts ...Option) (*User, error)
func (*Client) Register ¶
func (client *Client) Register(params *RegisterParams, opts ...Option) error
type ConfigField ¶
type DeleteTeamMembersParams ¶
type DeleteTeamMembersParams struct {
UserID int `json:"user_id"`
}
type Distribution ¶
type GetAwardsParams ¶
type GetAwardsParams struct {
UserID *int `schema:"user_id,omitempty"`
TeamID *int `schema:"team_id,omitempty"`
Type *string `schema:"type,omitempty"`
Value *int `schema:"value,omitempty"`
Category *int `schema:"category,omitempty"`
Icon *int `schema:"icon,omitempty"`
Q *string `schema:"q,omitempty"`
Field *string `schema:"field,omitempty"`
}
type GetChallengesParams ¶
type GetChallengesParams struct {
Name *string `schema:"name,omitempty"`
MaxAttempts *int `schema:"max_attempts,omitempty"`
Value *int `schema:"value,omitempty"`
Category *int `schema:"category,omitempty"`
Type *string `schema:"type,omitempty"`
State *string `schema:"state,omitempty"`
Q *string `schema:"q,omitempty"`
}
type GetCommentsParams ¶
type GetConfigsFieldsParams ¶
type GetConfigsParams ¶
type GetFilesParams ¶
type GetFlagsParams ¶
type GetHintsParams ¶
type GetNotificationsParams ¶
type GetNotificationsParams struct {
Title *string `schema:"title,omitempty"`
Content *string `schema:"content,omitempty"`
UserID *int `schema:"user_id,omitempty"`
TeamID *int `schema:"team_id,omitempty"`
Q *string `schema:"q,omitempty"`
Field *string `schema:"field,omitempty"`
SinceID *int `schema:"since_id,omitempty"`
}
type GetPagesParams ¶
type GetPagesParams struct {
ID *int `schema:"id,omitempty"`
Title *string `schema:"title,omitempty"`
Route *string `schema:"route,omitempty"`
Draft *bool `schema:"draft,omitempty"`
Hidden *bool `schema:"hidden,omitempty"`
AuthRequired *bool `schema:"auth_required,omitempty"`
Q *string `schema:"q,omitempty"`
Field *string `schema:"field,omitempty"`
}
type GetSubmissionsParams ¶
type GetSubmissionsParams struct {
ChallengeID *string `schema:"challenge_id,omitempty"`
UserID *int `schema:"user_id,omitempty"`
TeamID *int `schema:"team_id,omitempty"`
IP *string `schema:"ip,omitempty"`
Provided *string `schema:"provided,omitempty"`
Type *string `schema:"type,omitempty"`
Q *string `schema:"q,omitempty"`
Field *string `schema:"field,omitempty"`
}
type GetTagsParams ¶
type GetTeamsParams ¶
type GetTopicsParams ¶
type GetUnlocksParams ¶
type GetUsersParams ¶
type HeadNotificationsParams ¶
type HeadNotificationsParams struct {
Title *string `schema:"title,omitempty"`
Content *string `schema:"content,omitempty"`
UserID *int `schema:"user_id,omitempty"`
TeamID *int `schema:"team_id,omitempty"`
Q *string `schema:"q,omitempty"`
Field *string `schema:"field,omitempty"`
SinceID *int `schema:"since_id,omitempty"`
}
type Hint ¶
type Hint struct {
ID int `json:"id"`
HTML *string `json:"html,omitempty"`
Content *string `json:"content,omitempty"`
Cost int `json:"cost"`
Type string `json:"type"`
ChallengeID int `json:"challenge_id"`
Challenge int `json:"challenge"` // XXX may be duplicated with ChallengeID ?
Requirements *Requirements `json:"requirements,omitempty"`
}
type LoginParams ¶
type Notification ¶
type Notification struct {
ID int `json:"id"`
TeamID *int `json:"team_id"` // XXX may be duplicated with Team ?
HTML string `json:"html"`
UserID *int `json:"user_id"` // XXX may be duplicated with User ?
Team *int `json:"team"`
Content string `json:"content"`
Date string `json:"date"`
Title string `json:"title"`
User *int `json:"user"`
Type *string `json:"type,omitempty"`
Sound *bool `json:"sound,omitempty"`
}
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func WithContext ¶
type Page ¶
type Page struct {
Files []any `json:"files"` // XXX find model
ID int `json:"id"`
Draft bool `json:"draft"`
Route string `json:"route"`
Title string `json:"title"`
Hidden bool `json:"hidden"`
Format string `json:"format"`
AuthRequired bool `json:"auth_required"`
Content *string `json:"content,omitempty"`
}
type PatchChallengeParams ¶
type PatchChallengeParams struct {
Name *string `json:"name,omitempty"`
Category *string `json:"category,omitempty"`
Description *string `json:"description,omitempty"`
ConnectionInfo *string `json:"connection_info,omitempty"`
MaxAttempts *int `json:"max_attempts,omitempty"`
Value *int `json:"value,omitempty"`
Initial *int `json:"initial,omitempty"`
Decay *int `json:"decay,omitempty"`
Minimum *int `json:"minimum,omitempty"`
State *string `json:"state,omitempty"`
Requirements *Requirements `json:"requirements,omitempty"`
NextID *string `json:"next_id,omitempty"`
}
type PatchConfigsFieldParams ¶
type PatchConfigsFieldParams struct {
ID int `json:"id"` // XXX duplicated with the ID in URL
Name string `json:"name"`
Description string `json:"description"`
FieldType string `json:"field_type"`
Type string `json:"type"`
Editable bool `json:"editable"`
Public bool `json:"public"`
Required bool `json:"required"`
}
type PatchConfigsParams ¶
type PatchConfigsParams struct {
CTFDescription *string `json:"ctf_description,omitempty"`
CTFName *string `json:"ctf_name,omitempty"`
// TODO add logo & small icon
CTFTheme *string `json:"ctf_theme,omitempty"`
ThemeHeader *string `json:"theme_header,omitempty"`
ThemeSettings *string `json:"theme_settings,omitempty"`
DomainWhitelist *string `json:"domain_whitelist,omitempty"`
IncorrectSubmissionsPerMin *string `json:"incorrect_submissions_per_min,omitempty"`
NameChanges *bool `json:"name_changes,omitempty"`
NumTeams *string `json:"num_teams,omitempty"`
TeamCreation *bool `json:"team_creation,omitempty"`
TeamDisbanding *string `json:"team_disbanding,omitempty"`
TeamSize *string `json:"team_size,omitempty"`
VerifyEmails *bool `json:"verify_emails,omitempty"`
RobotsTxt *string `json:"robots_txt,omitempty"`
OauthClientID *string `json:"oauth_client_id,omitempty"`
OauthClientSecret *string `json:"oauth_client_secret,omitempty"`
AccountVisibility *string `json:"account_visibility,omitempty"`
ChallengeVisibility *string `json:"challenge_visibility,omitempty"`
Paused *bool `json:"paused,omitempty"`
RegistrationVisibility *string `json:"registration_visibility,omitempty"`
ScoreVisibility *string `json:"score_visibility,omitempty"`
RegistrationCode *string `json:"registration_code,omitempty"`
MailPassword *string `json:"mail_password,omitempty"`
MailPort *string `json:"mail_port,omitempty"`
MailServer *string `json:"mail_server,omitempty"`
MailSSL *bool `json:"mail_ssl,omitempty"`
MailTLS *bool `json:"mail_tls,omitempty"`
MailUseAuth *bool `json:"mail_useauth,omitempty"`
MailUsername *string `json:"mail_username,omitempty"`
MailFromAddr *string `json:"mailfrom_addr,omitempty"`
MailGunAPIKey *string `json:"mailgun_api_key,omitempty"`
MailGunBaseURL *string `json:"mailgun_base_url,omitempty"`
PasswordChangelertBody *string `json:"password_change_alert_body,omitempty"`
PasswordChangeAlertSubject *string `json:"password_change_alert_subject,omitempty"`
PasswordResetBody *string `json:"password_reset_body,omitempty"`
PasswordResetSubject *string `json:"password_reset_subject,omitempty"`
SuccessfulRegistrationEmailBody *string `json:"successful_registration_email_body,omitempty"`
SuccessfulRegistrationEmailSubject *string `json:"successful_registration_email_subject,omitempty"`
UserCreationEmailBody *string `json:"user_creation_email_body,omitempty"`
UserCreationEmailSubject *string `json:"user_creation_email_subject,omitempty"`
VerificationEmailBody *string `json:"verification_email_body,omitempty"`
VerificationEmailSubject *string `json:"verification_email_subject,omitempty"`
End *string `json:"end,omitempty"`
Freeze *string `json:"freeze,omitempty"`
Start *string `json:"start,omitempty"`
ViewAfterCTF *bool `json:"view_after_ctf,omitempty"`
PrivacyText *string `json:"privacy_text,omitempty"`
PrivacyURL *string `json:"privacy_url,omitempty"`
TOSText *string `json:"tos_text,omitempty"`
TOSURL *string `json:"tos_url,omitempty"`
UserMode *string `json:"user_mode,omitempty"`
}
type PatchFlagParams ¶
type PatchHintsParams ¶
type PatchHintsParams struct {
ChallengeID string `json:"challenge_id"`
Content string `json:"content"`
Cost int `json:"cost"`
Requirements Requirements `json:"requirements"`
}
type PatchPageParams ¶
type PatchPageParams struct {
Title string `json:"title"`
Content string `json:"content"`
Format string `json:"format"`
Route string `json:"route"`
Nonce string `json:"nonce"` // XXX API should not use the nonce as you need to parse HTML content to get it, going against the API workflow
AuthRequired bool `json:"auth_required"`
Draft bool `json:"draft"`
Hidden bool `json:"hidden"`
}
type PatchTagsParams ¶
type PatchTagsParams struct {
Value string `json:"value"`
}
type PatchTeamsParams ¶
type PatchUsersParams ¶
type PostAwardsParams ¶
type PostChallengesParams ¶
type PostChallengesParams struct {
Name string `json:"name"`
Category string `json:"category"`
Description string `json:"description"`
ConnectionInfo *string `json:"connection_info,omitempty"`
MaxAttempts *int `json:"max_attempts,omitempty"`
Value *int `json:"value,omitempty"`
Initial *int `json:"initial,omitempty"`
Decay *int `json:"decay,omitempty"`
Minimum *int `json:"minimum,omitempty"`
State string `json:"state"`
Type string `json:"type"`
Requirements *Requirements `json:"requirements,omitempty"`
NextID *string `json:"next_id,omitempty"`
}
type PostCommentsParams ¶
type PostConfigFieldsParams ¶
type PostConfigsParams ¶
type PostFilesParams ¶
type PostFlagsParams ¶
type PostHintsParams ¶
type PostHintsParams struct {
ChallengeID string `json:"challenge_id"`
Content string `json:"content"`
Cost int `json:"cost"`
Requirements Requirements `json:"requirements"`
}
type PostNotificationsParams ¶
type PostPagesParams ¶
type PostPagesParams struct {
AuthRequired bool `json:"auth_required"`
Content string `json:"content"`
Draft bool `json:"draft"`
Format string `json:"format"`
Hidden bool `json:"hidden"`
Nonce string `json:"nonce"` // XXX API should not use the nonce as you need to parse HTML content to get it, going against the API workflow
Route string `json:"route"`
Title string `json:"title"`
}
type PostTagsParams ¶
type PostTeamsMembers ¶
type PostTeamsMembers struct {
UserID int `json:"user_id"`
}
type PostTeamsParams ¶
type PostTokensParams ¶
type PostTokensParams struct {
Expiration string `json:"expiration"`
}
type PostTopicsParams ¶
type PostUnlocksParams ¶
type PostUserMailParams ¶
type PostUserMailParams struct {
Text string `json:"text"`
}
type PostUsersParams ¶
type RegisterParams ¶
type Requirements ¶
type ResetParams ¶
type Scoreboard ¶
type Scoreboard struct {
Pos int `json:"pos"`
AccountId int `json:"account_id"`
AccountURL string `json:"account_url"`
AccountType string `json:"account_type"`
OauthID any `json:"oauth_id"`
Name string `json:"name"`
Score int `json:"score"`
Members []struct {
ID int `json:"id"`
OauthID any `json:"oauth_id"`
Name string `json:"name"`
Score int `json:"score"`
} `json:"members"`
}
type SetupParams ¶
type StatChallSubmission ¶
type Submission ¶
type Submission struct {
ID int `json:"id"`
TeamID int `json:"team_id"` // XXX may be duplicated with team.id ?
IP string `json:"ip"`
ChallengeID int `json:"challenge_id"`
UserID int `json:"user_id"` // XXX may be duplicated with user.id ?
Team struct {
ID int `json:"id"`
Name string `json:"name"`
} `json:"team"`
Date string `json:"date"`
User struct {
ID int `json:"id"`
Name string `json:"name"`
} `json:"user"`
Type string `json:"type"`
Challenge struct {
Value int `json:"value"`
ID int `json:"id"`
Name string `json:"name"`
Category string `json:"category"`
} `json:"challenge"`
Provided string `json:"provided"`
}
type Team ¶
type Team struct {
Bracket *string `json:"bracket"`
Members []int `json:"members,omitempty"`
ID int `json:"id"`
Created string `json:"created"`
Country *string `json:"country"`
Email *string `json:"email"`
Affiliation *string `json:"affiliation"`
CaptainID *int `json:"captain_id"`
Fields []Field `json:"fields"`
Banned bool `json:"banned"`
Website *string `json:"website"`
Hidden bool `json:"hidden"`
Secret *bool `json:"secret"`
Name string `json:"name"`
OauthID *string `json:"oauth_id"`
Place *string `json:"place,omitempty"`
Score *int `json:"score,omitempty"`
}
type Topic ¶
type Topic struct {
ID int `json:"id"`
ChallengeID *int `json:"challenge_id,omitempty"`
Challenge *int `json:"challenge,omitempty"` // XXX may be duplicated with ChallengeID ?
TopicID *int `json:"topic_id,omitempty"` // XXX may be duplicated with ID ?
Topic *int `json:"topic,omitempty"` // XXX may be duplicated with ID ?
Value string `json:"value"`
}
type User ¶
type User struct {
Bracket *string `json:"bracket"`
ID int `json:"id"`
TeamID *int `json:"team_id"`
Country *string `json:"country"`
Affiliation *string `json:"affiliation"`
Fields []Field `json:"fields"`
Website *string `json:"website"`
Name string `json:"name"`
Email *string `json:"email,omitempty"`
OauthID *string `json:"oauth_id"`
Verified *bool `json:"verified,omitempty"`
Banned *bool `json:"banned,omitempty"`
Hidden *bool `json:"hidden,omitempty"`
Type *string `json:"type,omitempty"`
Created *string `json:"created,omitempty"`
Secret *string `json:"secret,omitempty"`
}