leetcodecn

package
v0.6.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUserNotExist = errors.New("That user does not exist.")
)

Functions

func Get

func Get(rt models.RequestType, name string) (any, error)

func GetSubCal

func GetSubCal(name string) (map[string]int, error)

func GetUserContestRankingInfo

func GetUserContestRankingInfo(name string) (*models.UserContestRankingInfo, error)

func GetUserProfile

func GetUserProfile(name string) (*models.UserProfile, error)

func GetUserQuestionProgress

func GetUserQuestionProgress(name string) (*models.UserQuestionPrecess, error)

func Send

func Send(client *http.Client, uri string, method string, query string, ptr interface{}) error

func SendRaw

func SendRaw(client *http.Client, uri string, method string, query string) ([]byte, error)

Types

type Data

type Data struct {
	Data   json.RawMessage `json:"data"`
	Errors []Errors        `json:"errors"`
}

type Errors

type Errors struct {
	Message   string      `json:"message"`
	Locations []Locations `json:"locations"`
}

type LCNumQuestions

type LCNumQuestions struct {
	Difficulty string `json:"difficulty"`
	Count      int    `json:"count"`
}

type LCProfile

type LCProfile struct {
	UserSlug     string `json:"userSlug"`
	RealName     string `json:"realName"`
	UserAvatar   string `json:"userAvatar"`
	Location     string `json:"location"`
	ContestCount int    `json:"contestCount"`
	ASCIICode    string `json:"asciiCode"`
	Typename     string `json:"__typename"`
}

type LCSubmissionProgress

type LCSubmissionProgress struct {
	TotalSubmissions int    `json:"totalSubmissions"`
	WaSubmissions    int    `json:"waSubmissions"`
	AcSubmissions    int    `json:"acSubmissions"`
	ReSubmissions    int    `json:"reSubmissions"`
	OtherSubmissions int    `json:"otherSubmissions"`
	AcTotal          int    `json:"acTotal"`
	QuestionTotal    int    `json:"questionTotal"`
	Typename         string `json:"__typename"`
}

type LCUserContestRanking

type LCUserContestRanking struct {
	AttendedContestsCount   int     `json:"attendedContestsCount"`
	Rating                  float64 `json:"rating"`
	GlobalRanking           int     `json:"globalRanking"`
	LocalRanking            int     `json:"localRanking"`
	GlobalTotalParticipants int     `json:"globalTotalParticipants"`
	LocalTotalParticipants  int     `json:"localTotalParticipants"`
	TopPercentage           float64 `json:"topPercentage"`
}

type LCUserProfilePublicProfile

type LCUserProfilePublicProfile struct {
	Username           string               `json:"username"`
	HaveFollowed       interface{}          `json:"haveFollowed"`
	SiteRanking        int                  `json:"siteRanking"`
	Profile            LCProfile            `json:"profile"`
	SubmissionProgress LCSubmissionProgress `json:"submissionProgress"`
	Typename           string               `json:"__typename"`
}

type LCUserProfileUserQuestionProgress

type LCUserProfileUserQuestionProgress struct {
	NumAcceptedQuestions  []LCNumQuestions `json:"numAcceptedQuestions"`
	NumFailedQuestions    []LCNumQuestions `json:"numFailedQuestions"`
	NumUntouchedQuestions []LCNumQuestions `json:"numUntouchedQuestions"`
}

type LeetCodeUserContestRankingInfo

type LeetCodeUserContestRankingInfo struct {
	UserContestRanking *LCUserContestRanking `json:"userContestRanking"`
}

type LeetCodeUserProfile

type LeetCodeUserProfile struct {
	UserProfilePublicProfile LCUserProfilePublicProfile `json:"userProfilePublicProfile"`
}

type LeetCodeUserQuestionProgress

type LeetCodeUserQuestionProgress struct {
	UserProfileUserQuestionProgress LCUserProfileUserQuestionProgress `json:"userProfileUserQuestionProgress"`
}

type Locations

type Locations struct {
	Line   int `json:"line"`
	Column int `json:"column"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL