internal

package
v0.0.0-...-4a77b84 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatQuestionContent

func FormatQuestionContent(s string) string

FormatQuestionContent ...

func GetCfgFilepath

func GetCfgFilepath() string

GetCfgFilepath ...

func GetCfgPath

func GetCfgPath() string

GetCfgPath ...

func GetQuestionFilepath

func GetQuestionFilepath() string

GetQuestionFilepath ...

func GetQuestionLink(slug string) string

GetQuestionLink ...

func GetQuestionPath

func GetQuestionPath(fid string, qid int64, slug string) string

GetQuestionPath ...

func GetTagLink(tag string) string

GetTagLink ...

Types

type App

type App struct {
	*Config
	*LeetCode
	*Generator
}

App ...

func NewApp

func NewApp() *App

NewApp ...

type Config

type Config struct {
	Path         string `json:"path" yaml:"path" table:"答题目录"`
	Lang         string `json:"lang" yaml:"lang" table:"答题语言"`
	QuestionFile string `json:"question_file" yaml:"questionFile"`
}

Config ...

func (*Config) Render

func (t *Config) Render() string

Render ...

func (*Config) SetLang

func (t *Config) SetLang(s string) error

SetLang ...

func (*Config) SetPath

func (t *Config) SetPath(s string) error

SetPath ...

func (*Config) Update

func (t *Config) Update() error

Update ...

type Generator

type Generator struct{}

Generator ...

func (*Generator) GenerateQuestion

func (t *Generator) GenerateQuestion(
	detail *config.Question,
	projectDir string,
	lang string,
) error

GenerateQuestion ...

func (*Generator) GenerateRecord

func (t *Generator) GenerateRecord(
	list []*config.Question,
	projectDir string,
) error

GenerateRecord ...

func (*Generator) GenerateTag

func (t *Generator) GenerateTag(
	tagList []*config.Tag,
	tagMap map[string][]*config.Question,
	projectDir string,
) error

GenerateTag ...

type LeetCode

type LeetCode struct {
	Ctx context.Context
}

LeetCode ...

func (*LeetCode) GetQuestionDetail

func (t *LeetCode) GetQuestionDetail(slug string) (*config.QuestionDetail, error)

GetQuestionDetail ...

func (*LeetCode) GetQuestionList

func (t *LeetCode) GetQuestionList() ([]*config.Question, error)

GetQuestionList ...

func (*LeetCode) GetTagList

func (t *LeetCode) GetTagList() ([]*config.Tag, error)

GetTagList ...

func (*LeetCode) GetTagQuestionMap

func (t *LeetCode) GetTagQuestionMap(app *App) (map[string][]*config.Question, error)

GetTagQuestionMap ...

Jump to

Keyboard shortcuts

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