Documentation
¶
Index ¶
- Variables
- func ErrUnableToGetSolution(problemID int32, language string) error
- func FormatContestLevel(level string) string
- func FormatContestRating(rating uint16) string
- func FormatGlobalRanking(rank uint64) string
- func ValidLanguage(language string) bool
- type Contest
- type ContestMetadata
- type LanguageStats
- type Leetcode
- type Problem
- type ProblemService
- type ProblemStats
- type Profile
- type ProfileService
- type SocialURl
- type Solution
- type SolutionService
- type Stats
- type StatsService
- type Submission
- type SubmissionsService
- type Topic
- type UserContestInfo
- type UserContestInfoService
Constants ¶
This section is empty.
Variables ¶
View Source
var (
AvailableLanguage = map[string]string{
"cpp": "C++",
"java": "Java",
"py": "Python",
"ts": "TypeScript",
"sql": "MySQL",
"sh": "Shell",
}
)
View Source
var (
ErrLanguageNotSupported = errors.New("language is not supported")
)
View Source
var (
ErrProblemNotFound = errors.New("problem cannot be found")
)
View Source
var (
ErrUserNotExists = errors.New("user not found")
)
Functions ¶
func ErrUnableToGetSolution ¶
func FormatContestLevel ¶
func FormatContestRating ¶
func FormatGlobalRanking ¶
func ValidLanguage ¶
Types ¶
type Contest ¶
type Contest struct {
ProblemsSolved uint8
FinishTimeInSeconds uint16
Rating uint16
Ranking uint64
Metadata ContestMetadata
}
type ContestMetadata ¶
type LanguageStats ¶
type Leetcode ¶
type Leetcode struct {
Problems interface {
GetByID(int32) (*Problem, error)
GetToday() (*Problem, error)
}
Solutions interface {
GetByID(int32, string) (*Solution, error)
}
Profiles interface {
GetByUsername(string) (*Profile, error)
}
UserContestInfo interface {
GetByUsername(string) (*UserContestInfo, error)
}
Stats interface {
GetByUsername(string) (*Stats, error)
}
Submissions interface {
GetByUsername(string) ([]*Submission, error)
}
}
type ProblemService ¶
type ProblemService struct {
// contains filtered or unexported fields
}
func (*ProblemService) GetByID ¶
func (s *ProblemService) GetByID(problemID int32) (*Problem, error)
func (*ProblemService) GetToday ¶
func (s *ProblemService) GetToday() (*Problem, error)
type ProblemStats ¶
type ProfileService ¶
type ProfileService struct {
// contains filtered or unexported fields
}
func (*ProfileService) GetByUsername ¶
func (s *ProfileService) GetByUsername(username string) (*Profile, error)
type SolutionService ¶
type SolutionService struct {
// contains filtered or unexported fields
}
type Stats ¶
type Stats struct {
Languages []LanguageStats
Problems [3]ProblemStats
}
type StatsService ¶
type StatsService struct {
// contains filtered or unexported fields
}
func (*StatsService) GetByUsername ¶
func (s *StatsService) GetByUsername(username string) (*Stats, error)
type Submission ¶
type SubmissionsService ¶
type SubmissionsService struct {
// contains filtered or unexported fields
}
func (*SubmissionsService) GetByUsername ¶
func (s *SubmissionsService) GetByUsername(username string) ([]*Submission, error)
type UserContestInfo ¶
type UserContestInfoService ¶
type UserContestInfoService struct {
// contains filtered or unexported fields
}
func (*UserContestInfoService) GetByUsername ¶
func (s *UserContestInfoService) GetByUsername(username string) (*UserContestInfo, error)
Click to show internal directories.
Click to hide internal directories.