leetcodegraphql

package module
v0.0.0-...-e408e83 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2018 License: MIT Imports: 7 Imported by: 2

README

leetcode-graphql

Build Status

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseQuestion

type BaseQuestion struct {
	Problems          Problems `json:"-"`
	Referer           string   `json:"-"`
	Codes             Codes    `json:"-"`
	QuestionID        string   `json:"questionId"`
	QuestionTitle     string   `json:"questionTitle"`
	Content           string   `json:"content"`
	Difficulty        string   `json:"difficulty"`
	DiscussURL        string   `json:"discussUrl"`
	CategoryTitle     string   `json:"categoryTitle"`
	SubmitURL         string   `json:"submitUrl"`
	InterpretURL      string   `json:"interpretUrl"`
	CodeDefinition    string   `json:"codeDefinition"`
	MetaData          string   `json:"metaData"`
	EnvInfo           string   `json:"envInfo"`
	Article           string   `json:"article"`
	QuestionDetailURL string   `json:"questionDetailUrl"`
	DiscussCategoryID string   `json:"discussCategoryId"`
}

BaseQuestion the structure of the base question

func (*BaseQuestion) Do

func (q *BaseQuestion) Do(key string) error

Do do requesting and parse the response data

func (BaseQuestion) GetCodeDefinition

func (q BaseQuestion) GetCodeDefinition(lang string) (code string, err error)

GetCodeDefinition returns code definition of question

func (BaseQuestion) GetEnvInfo

func (q BaseQuestion) GetEnvInfo(lang string) (info []string, err error)

GetEnvInfo returns env info

func (BaseQuestion) Valid

func (q BaseQuestion) Valid() bool

Valid returns true if valid question

type Code

type Code struct {
	Text        string `json:"text"`
	Value       string `json:"value"`
	DefaultCode string `json:"defaultCode"`
}

Code the struct of leetcode codes.

type Codes

type Codes []*Code

Codes the slice of Code

func (Codes) Code

func (cs Codes) Code(lang string) *Code

Code returns Code with lang.

type ProblemStat

type ProblemStat struct {
	TotalAcs            int    `json:"total_acs"`
	QuestionTitle       string `json:"question__title"`
	IsNewQuestion       bool   `json:"is_new_question"`
	QuestionArticleSlug string `json:"question__article__slug"`
	TotalSubmitted      int    `json:"total_submitted"`
	FrontendQuestionID  int    `json:"frontend_question_id"`
	QuestionTitleSlug   string `json:"question__title_slug"`
	QuestionArticleLive bool   `json:"question__article__live"`
	QuestionHide        bool   `json:"question__hide"`
	QuestionID          int    `json:"question_id"`
}

ProblemStat the structure of a problem stat

type ProblemStatStatus

type ProblemStatStatus struct {
	Stat       ProblemStat `json:"stat"`
	Difficulty struct {
		Level int `json:"level"`
	} `json:"difficulty"`
}

ProblemStatStatus the structure of a problem status

type Problems

type Problems struct {
	StatStatusPairs []ProblemStatStatus `json:"stat_status_pairs"`
	NumTotal        int                 `json:"num_total"`
}

Problems the structure of all problems

func (*Problems) Do

func (p *Problems) Do() error

Do do requesting and parse the response data

func (Problems) StatStatus

func (p Problems) StatStatus(s string) *ProblemStatStatus

StatStatus returns ProblemStatStatus with id or title string

type Response

type Response struct {
	Data ResponseData `json:"data"`
}

Response the structure of leetcode response

type ResponseData

type ResponseData struct {
	Question interface{} `json:"question"`
}

ResponseData the structure of leetcode response data

Jump to

Keyboard shortcuts

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