Documentation ¶
Overview ¶
Utility package that allows access to the codeforces API. Some functions require authentication. For more informations on how to get your API key and secret, please refer here: https://codeforces.com/apiHelp
Index ¶
- Constants
- type Author
- type BlogEntry
- type Client
- type Comment
- type Contest
- type ContestHack
- type ContestStandings
- type ContestStatus
- type Defender
- type FailedRequest
- type Hacker
- type JudgeProtocol
- type Member
- type Party
- type Problem
- type ProblemResult
- type ProblemStatistic
- type Problemset
- type RatingChange
- type RecentAction
- type ResultWrapper
- type Row
- type User
Constants ¶
View Source
const (
Version = "v.0.0.2"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlogEntry ¶
type BlogEntry struct { OriginalLocale string `json:"originalLocale"` AllowViewHistory bool `json:"allowViewHistory"` CreationTimeSeconds int `json:"creationTimeSeconds"` Rating int `json:"rating"` AuthorHandle string `json:"authorHandle"` ModificationTimeSeconds int `json:"modificationTimeSeconds"` ID int `json:"id"` Title string `json:"title"` Locale string `json:"locale"` Tags []string `json:"tags"` }
type Client ¶
type Client struct { Blog *blogService User *userService Contest *contestService Problems *problemService Actions *actionsService }
holds a shared httpclient (could change) and the services responsible for communicating with the various parts of the api
func NewCustomClient ¶
type Contest ¶
type Contest struct { ID int `json:"id"` Name string `json:"name"` Type string `json:"type"` Phase string `json:"phase"` // this could be represented with an enum Frozen bool `json:"frozen"` DurationSeconds int `json:"durationSeconds"` StartTimeSeconds int `json:"startTimeSeconds"` RelativeTimeSeconds int `json:"relativeTimeSeconds"` }
type ContestHack ¶
type ContestStandings ¶
type ContestStatus ¶
type ContestStatus struct { ID int `json:"id"` ContestID int `json:"contestId"` CreationTimeSeconds int `json:"creationTimeSeconds"` RelativeTimeSeconds int64 `json:"relativeTimeSeconds"` Problem Problem `json:"problem"` Author Author `json:"author"` ProgrammingLanguage string `json:"programmingLanguage"` Verdict string `json:"verdict"` Testset string `json:"testset"` PassedTestCount int `json:"passedTestCount"` TimeConsumedMillis int `json:"timeConsumedMillis"` MemoryConsumedBytes int `json:"memoryConsumedBytes"` }
type FailedRequest ¶
type JudgeProtocol ¶
type ProblemResult ¶
type ProblemStatistic ¶
type Problemset ¶
type Problemset struct { Problems []Problem `json:"problems"` ProblemStatistics []ProblemStatistic `json:"problemStatistics"` }
type RatingChange ¶
type RecentAction ¶
type ResultWrapper ¶
used to parse away the status, and isolate the result
type User ¶
type User struct { Country string `json:"country"` City string `json:"city"` LastName string `json:"lastName"` LastOnlineTimeSeconds int `json:"lastOnlineTimeSeconds"` Rating int `json:"rating"` FriendOfCount int `json:"friendOfCount"` TitlePhoto string `json:"titlePhoto"` Handle string `json:"handle"` Avatar string `json:"avatar"` FirstName string `json:"firstName"` Contribution int `json:"contribution"` Organization string `json:"organization"` Rank string `json:"rank"` MaxRating int `json:"maxRating"` RegistrationTimeSeconds int `json:"registrationTimeSeconds"` MaxRank string `json:"maxRank"` }
func (*User) CurrentDivision ¶
supposed to be called only on rated users
func (*User) MaxDivision ¶
supposed to be called only on rated users returns the best division the user reached
Directories ¶
Path | Synopsis |
---|---|
examples
|
|
blog
nolint
|
nolint |
contest/hacks
nolint
|
nolint |
contest/status
nolint
|
nolint |
user/friends
nolint
|
nolint |
user/info
nolint
|
nolint |
user/rating
nolint
|
nolint |
Click to show internal directories.
Click to hide internal directories.