lang

package
v0.1.0-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NotSupported   = errors.New("not supported")
	NotImplemented = errors.New("not implemented")
)
View Source
var (

	// TODO scala, typescript, erlang, dart, racket
	SupportedLangs = []Generator{
		golangGen,
		pythonGen,
		cppGen,
		rustGen,
		javaGen,
		jsGen,
		phpGen,
		cGen,
		csharpGen,
		rubyGen,
		swiftGen,
		kotlinGen,
	}
)

Functions

This section is empty.

Types

type FileOutput

type FileOutput struct {
	Path      string
	Content   string
	Overwrite bool
	Generator Generator
}

func Generate

func Generate(q *leetcode.QuestionData) ([]FileOutput, error)

type Generator

type Generator interface {
	Name() string
	ShortName() string
	Slug() string
	// Generate generates code files for the question.
	Generate(q *leetcode.QuestionData) ([]FileOutput, error)
}

func GetGenerator

func GetGenerator(gen string) Generator

type Initializer

type Initializer interface {
	Initialized(dir string) (bool, error)
	Init(dir string) error
}

type LocalTester

type LocalTester interface {
	Initializer
	RunTest(q *leetcode.QuestionData) error
}

type Modifier

type Modifier func(string, *leetcode.QuestionData) string

Jump to

Keyboard shortcuts

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