Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Contributions ¶
type Contributions = utils.Contributions
type MatchedUser ¶
type MatchedUser = utils.MatchedUser
type QuestionCount ¶
type QuestionCount = utils.QuestionCount
type StreakStats ¶
type StreakStats = utils.StreakStats
func GetStreak ¶
func GetStreak(username string) (StreakStats, error)
GetStreak returns the user's current and longest daily-submission streaks, derived from their public submission calendar.
Example ¶
package main
import (
"fmt"
"github.com/reinanbr/leetinfo"
)
func main() {
result, err := leetinfo.GetStreak("reinanbr")
if err != nil {
fmt.Println("error:", err)
return
}
fmt.Println(result.LongestStreak >= 0)
fmt.Println(result.CurrentStreak >= 0)
}
Output: true true
type Submission ¶
type Submission = utils.Submission
func GetRecentSubmissions ¶
func GetRecentSubmissions(username string) ([]Submission, error)
GetRecentSubmissions returns the user's most recent submissions.
type SubmissionStat ¶
type SubmissionStat = utils.SubmissionStat
type SubmitStats ¶
type SubmitStats = utils.SubmitStats
func GetSubmitStats ¶
func GetSubmitStats(username string) (SubmitStats, error)
GetSubmitStats returns accepted vs. total submission counts grouped by difficulty.
Example ¶
package main
import (
"fmt"
"github.com/reinanbr/leetinfo"
)
func main() {
result, err := leetinfo.GetSubmitStats("reinanbr")
if err != nil {
fmt.Println("error:", err)
return
}
fmt.Println(len(result.AcSubmissionNum) > 0)
}
Output: true
type UserData ¶
func GetUser ¶
GetUser fetches the full LeetCode profile for username: available question counts by difficulty, profile info, submission stats, recent submissions, and a computed submission streak.
Example ¶
package main
import (
"fmt"
"github.com/reinanbr/leetinfo"
)
func main() {
result, err := leetinfo.GetUser("reinanbr")
if err != nil {
fmt.Println("error:", err)
return
}
fmt.Println(result.MatchedUser.Username != "")
fmt.Println(len(result.AllQuestionsCount) > 0)
}
Output: true true
Click to show internal directories.
Click to hide internal directories.