verify

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CatalogConfig

type CatalogConfig struct {
	Site        string         `json:"site"`
	URL         string         `json:"url"`
	Selectors   Selectors      `json:"selectors"`
	Items       []*CatalogItem `json:"items"`
	AIGenerated bool           `json:"ai_generated"`
	Confidence  float64        `json:"confidence"`
	ScannedAt   string         `json:"scanned_at"`
}

CatalogConfig 目录配置(与fetch模块共享结构)

type CatalogItem

type CatalogItem struct {
	Title    string         `json:"title"`
	URL      string         `json:"url"`
	Level    int            `json:"level"`
	Children []*CatalogItem `json:"children,omitempty"`
}

CatalogItem 目录项

type Config

type Config struct {
	URL       string // 要验证的URL
	Selector  string // 正文选择器
	Type      string // 选择器类型: css/xpath
	Catalog   string // catalog.json路径
	Output    string // 输出目录(用于缓存)
	Save      bool   // 是否保存到catalog
	AppConfig *models.AppConfig
}

Config verify命令配置

type Processor

type Processor struct {
	// contains filtered or unexported fields
}

Processor verify处理器

func NewProcessor

func NewProcessor(config *Config, logger *zap.Logger) (*Processor, error)

NewProcessor 创建verify处理器

func (*Processor) Execute

func (p *Processor) Execute(ctx context.Context) (*Result, error)

Execute 执行验证

type Result

type Result struct {
	URL       string
	Selector  string
	Type      string
	Content   string
	WordCount int
	Success   bool
	Error     error
}

Result 验证结果

type Selectors

type Selectors struct {
	TOC         string `json:"toc"`
	Content     string `json:"content"`
	TOCType     string `json:"toc_type,omitempty"`
	ContentType string `json:"content_type,omitempty"`
}

Selectors 选择器配置

Jump to

Keyboard shortcuts

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