feat: refactor jsParser to use ParserMethod constants and remove redundant locking in ParseWithContext

This commit is contained in:
krau
2025-08-23 16:04:32 +08:00
parent e5d1e143e0
commit c023fd869d
3 changed files with 28 additions and 19 deletions

23
parsers/plugin.go Normal file
View File

@@ -0,0 +1,23 @@
package parsers
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
)