JOJ3/internal/parser/plugin/meta.go
张泊明518370910136 1e75ab1c6e
All checks were successful
submodules sync / sync (push) Successful in 46s
build / build (push) Successful in 1m48s
build / trigger-build-image (push) Successful in 8s
feat(parser/plugin): new parser that can load from a plugin (#81)
2025-02-17 09:10:19 -05:00

22 lines
501 B
Go

// Package plugin provides functionality to load and run parser plugins
// dynamically. It is used for custom parsers.
// The plugin needs to be located at `ModPath` and export a symbol with name
// `SymName` that implements the stage.Parser interface.
package plugin
import "github.com/joint-online-judge/JOJ3/internal/stage"
var name = "plugin"
type Conf struct {
ModPath string
SymName string `default:"Parser"`
}
type Plugin struct{}
func init() {
stage.RegisterParser(name, &Plugin{})
}