Documentation ¶
Index ¶
- Variables
- func AddTask(task Task) error
- func SetSourceDir(srcDir string)
- func SetTemplatesDir(tplDir string)
- func SetWorkingDir(workDir string)
- type Codeforces
- type CodeforcesParser
- type Contest
- type DataFormat
- type FromFileGenerator
- type FromMemoryGenerator
- type Generator
- type Judger
- type Parser
- type Task
- type TestCase
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidHTMLFormat is invalid HTML format error ErrInvalidHTMLFormat = errors.New("invalid HTML format") // ErrSiteNotSupport is site not support error ErrSiteNotSupport = errors.New("site not support") )
var ( // ErrInvalidTemplate is invalid template error ErrInvalidTemplate = errors.New("invalid template") )
Functions ¶
Types ¶
type Codeforces ¶
type Codeforces struct { }
Codeforces is the Codeforces judger
func (*Codeforces) WriteTask ¶
func (j *Codeforces) WriteTask(task Task) error
WriteTask write codeforces task
type CodeforcesParser ¶
type CodeforcesParser struct { }
CodeforcesParser parser for Codeforces
func (*CodeforcesParser) ParseContestFromHTML ¶
func (*CodeforcesParser) ParseContestFromHTML(html string) (Contest, error)
ParseContestFromHTML parse Codeforces contest from html
func (*CodeforcesParser) ParseContestFromURL ¶
func (*CodeforcesParser) ParseContestFromURL(url string) (Contest, error)
ParseContestFromURL parse Codeforces contest from url
func (*CodeforcesParser) ParseTaskFromHTML ¶
func (*CodeforcesParser) ParseTaskFromHTML(html string) (*Task, error)
ParseTaskFromHTML parse Codeforces task from html
func (*CodeforcesParser) ParseTaskFromURL ¶
func (*CodeforcesParser) ParseTaskFromURL(url string) (*Task, error)
ParseTaskFromURL parse Codeforces task from url
type DataFormat ¶
DataFormat format of input or output data
type FromFileGenerator ¶
type FromFileGenerator struct {
// contains filtered or unexported fields
}
FromFileGenerator generates code from file templates
func (*FromFileGenerator) WriteTaskToString ¶
func (g *FromFileGenerator) WriteTaskToString(task Task, tmplName string) (string, error)
WriteTaskToString returns generated code in string format
type FromMemoryGenerator ¶
type FromMemoryGenerator struct {
// contains filtered or unexported fields
}
FromMemoryGenerator generates code from parsed template
func (*FromMemoryGenerator) WriteTaskToString ¶
func (g *FromMemoryGenerator) WriteTaskToString(task Task, tmplName string) (string, error)
WriteTaskToString returns generated code in string format
type Generator ¶
type Generator interface { WriteTask(writer io.Writer, task Task, tmplName string) error WriteTaskToString(task Task, tmplName string) (string, error) }
Generator is the code generator interface
func NewFromFileGenerator ¶
NewFromFileGenerator returns new instance of FromFileGenerator
func NewFromMemoryGenerator ¶
NewFromMemoryGenerator returns new instance of Generator
type Parser ¶
type Parser interface { ParseTaskFromHTML(html string) (*Task, error) ParseTaskFromURL(url string) (*Task, error) ParseContestFromHTML(html string) (Contest, error) ParseContestFromURL(url string) (Contest, error) }
Parser is the parser interface