parsers

package
v0.36.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2025 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LatestParserVersion  = semver.MustParse("1.0.0")
	MinimumParserVersion = semver.MustParse("1.0.0")
)
View Source
var (
	ErrNoParserFound = fmt.Errorf("no parser found for the given URL")
)

Functions

func AddParser

func AddParser(p ...parser.Parser)

func AddPlugin added in v0.36.0

func AddPlugin(ctx context.Context, code string, name string) error

func CanHandle added in v0.30.0

func CanHandle(url string) (bool, parser.Parser)

func LoadPlugins

func LoadPlugins(ctx context.Context, dir string) error

加载指定文件夹下的所有 JS 解析器插件

func ParseWithContext

func ParseWithContext(ctx context.Context, url string) (*parser.Item, error)

Types

type ParserMethod added in v0.30.0

type ParserMethod uint
const (
	ParserMethodCanHandle ParserMethod
	ParserMethodParse
)

type PluginMeta

type PluginMeta struct {
	Name        string `json:"name"`
	Version     string `json:"version"` // [TODO] 分版本解析, 但是我们现在只有 v1 所以先不写
	Description string `json:"description"`
	Author      string `json:"author"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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