refactor: js plugin api

This commit is contained in:
krau
2025-11-16 21:38:30 +08:00
parent 3f40acff55
commit 131dfeb4cd
14 changed files with 165 additions and 112 deletions

23
parsers/js/plugin.go Normal file
View File

@@ -0,0 +1,23 @@
package js
import "github.com/blang/semver"
var (
LatestParserVersion = semver.MustParse("1.0.0")
MinimumParserVersion = semver.MustParse("1.0.0")
)
type PluginMeta struct {
Name string `json:"name"`
Version string `json:"version"` // [TODO] 分版本解析, 但是我们现在只有 v1 所以先不写
Description string `json:"description"`
Author string `json:"author"`
}
type ParserMethod uint
const (
_ ParserMethod = iota
ParserMethodCanHandle
ParserMethodParse
)