Documentation ¶
Index ¶
- func CompleteRanklistTask(ctx context.Context, req *CompleteRanklistTaskRequest) error
- func CompleteSolutionTask(ctx context.Context) error
- func GetDefaultHTTPClient() *resty.Client
- func GetSolutionTaskDetailsUrl(ctx context.Context, urlType string) (string, error)
- func InitFromConfig()
- func LoadRanklistCtx(ctx context.Context) (string, string)
- func LoadSolutionTask(ctx context.Context) (solutionId string, taskId string)
- func PatchSolutionTask(ctx context.Context, req *common.SolutionInfo) error
- func SaveRanklist(ctx context.Context, ranklist map[string]*Ranklist) error
- func SaveSolutionDetails(ctx context.Context, details *common.SolutionDetails) error
- func WithRanklistTask(ctx context.Context, taskId, contestId string) context.Context
- func WithSolutionTask(ctx context.Context, solutionId string, taskId string) context.Context
- type APIError
- type CompleteRanklistTaskRequest
- type GetRanklistParticipantsResponse
- type GetRanklistProblemsResponse
- type GetRanklistSolutionsResponse
- type GetRanklistUploadUrlsResponse
- type PollRanklistRequest
- type PollRanklistResponse
- type PollSolutionRequest
- type PollSolutionResponse
- type Ranklist
- type RanklistDTO
- type RanklistMetadata
- type RanklistParticipant
- type RanklistParticipantColumn
- type RanklistParticipantItem
- type RanklistParticipantItemColumn
- type RanklistSettings
- type RanklistTopstar
- type RanklistTopstarItem
- type RanklistTopstarItemMutation
- type RegisterRequest
- type RegisterResponse
- type UrlResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompleteRanklistTask ¶
func CompleteRanklistTask(ctx context.Context, req *CompleteRanklistTaskRequest) error
func CompleteSolutionTask ¶
func GetDefaultHTTPClient ¶
func GetDefaultHTTPClient() *resty.Client
func InitFromConfig ¶
func InitFromConfig()
func LoadSolutionTask ¶
func PatchSolutionTask ¶
func PatchSolutionTask(ctx context.Context, req *common.SolutionInfo) error
func SaveSolutionDetails ¶
func SaveSolutionDetails(ctx context.Context, details *common.SolutionDetails) error
func WithRanklistTask ¶
Types ¶
type APIError ¶
type CompleteRanklistTaskRequest ¶
type CompleteRanklistTaskRequest struct {
RanklistUpdatedAt int `json:"ranklistUpdatedAt"`
}
type GetRanklistParticipantsResponse ¶
type GetRanklistParticipantsResponse []struct { Id string `json:"_id" bson:"_id"` UserId string `json:"userId" bson:"userId"` ContestId string `json:"contestId" bson:"contestId"` Tags []string `json:"tags" bson:"tags"` Results map[string]struct { SolutionCount int `json:"solutionCount" bson:"solutionCount"` LastSolutionId string `json:"lastSolutionId" bson:"lastSolutionId"` LastSolution struct { Score float64 `json:"score" bson:"score"` Status string `json:"status" bson:"status"` CompletedAt int `json:"completedAt" bson:"completedAt"` } `json:"lastSolution" bson:"lastSolution"` } `json:"results" bson:"results"` UpdatedAt int `json:"updatedAt" bson:"updatedAt"` }
func GetRanklistParticipants ¶
type GetRanklistProblemsResponse ¶
type GetRanklistProblemsResponse []struct { Id string `json:"_id"` Title string `json:"title"` Tags []string `json:"tags"` Settings struct { Score float64 `json:"score"` Slug string `json:"slug"` SolutionCountLimit int `json:"solutionCountLimit"` ShowAfter int `json:"showAfter"` } `json:"settings"` }
func GetRanklistProblems ¶
func GetRanklistProblems(ctx context.Context) (*GetRanklistProblemsResponse, error)
type GetRanklistSolutionsResponse ¶
type GetRanklistSolutionsResponse []struct { Id string `json:"_id"` OrgId string `json:"orgId"` ProblemId string `json:"problemId"` ContestId string `json:"contestId"` UserId string `json:"userId"` ProblemDataHash string `json:"problemDataHash"` State int `json:"state"` SolutionDataHash string `json:"solutionDataHash"` Score float64 `json:"score"` Metrics map[string]float64 `json:"metrics"` Status string `json:"status"` Message string `json:"message"` RunnerId string `json:"runnerId"` CreatedAt int `json:"createdAt"` SubmittedAt int `json:"submittedAt"` CompletedAt int `json:"completedAt"` }
func GetRanklistSolutions ¶
type GetRanklistUploadUrlsResponse ¶
func GetRanklistUploadUrls ¶
func GetRanklistUploadUrls(ctx context.Context) (*GetRanklistUploadUrlsResponse, error)
type PollRanklistRequest ¶
type PollRanklistRequest struct { }
type PollRanklistResponse ¶
type PollRanklistResponse struct { TaskId string `json:"taskId"` ContestId string `json:"contestId"` Ranklists []RanklistDTO `json:"ranklists"` RanklistUpdatedAt int `json:"ranklistUpdatedAt"` }
func PollRanklist ¶
func PollRanklist(ctx context.Context, req *PollRanklistRequest) (*PollRanklistResponse, error)
type PollSolutionRequest ¶
type PollSolutionRequest struct { }
type PollSolutionResponse ¶
type PollSolutionResponse struct { TaskId string `json:"taskId"` SolutionId string `json:"solutionId"` UserId string `json:"userId"` ContestId string `json:"contestId"` ProblemConfig common.ProblemConfig `json:"problemConfig"` ProblemDataUrl string `json:"problemDataUrl"` ProblemDataHash string `json:"problemDataHash"` SolutionDataUrl string `json:"solutionDataUrl"` SolutionDataHash string `json:"solutionDataHash"` ErrMsg string `json:"errMsg"` }
func PollSolution ¶
func PollSolution(ctx context.Context, req *PollSolutionRequest) (*PollSolutionResponse, error)
type Ranklist ¶
type Ranklist struct { Topstar *RanklistTopstar `json:"topstar,omitempty"` Participant *RanklistParticipant `json:"participant"` Metadata *RanklistMetadata `json:"metadata"` }
type RanklistDTO ¶
type RanklistDTO struct { Key string `json:"key"` Name string `json:"name"` Settings RanklistSettings `json:"settings"` }
type RanklistMetadata ¶
type RanklistParticipant ¶
type RanklistParticipant struct { Columns []*RanklistParticipantColumn `json:"columns"` List []*RanklistParticipantItem `json:"list"` }
type RanklistParticipantItem ¶
type RanklistParticipantItem struct { Rank int `json:"rank"` UserId string `json:"userId"` Tags []string `json:"tags"` Columns []*RanklistParticipantItemColumn `json:"columns"` }
type RanklistParticipantItemColumn ¶
type RanklistParticipantItemColumn struct {
Content string `json:"content"`
}
type RanklistSettings ¶
type RanklistTopstar ¶
type RanklistTopstar struct {
List []*RanklistTopstarItem `json:"list"`
}
type RanklistTopstarItem ¶
type RanklistTopstarItem struct { UserId string `json:"userId"` Mutations []*RanklistTopstarItemMutation `json:"mutations"` }
type RegisterRequest ¶
type RegisterResponse ¶
type RegisterResponse struct { RunnerId string `json:"runnerId"` RunnerKey string `json:"runnerKey"` }
func Register ¶
func Register(ctx context.Context, req *RegisterRequest) (*RegisterResponse, error)
type UrlResponse ¶
type UrlResponse struct {
Url string `json:"url"`
}
Click to show internal directories.
Click to hide internal directories.