Documentation
¶
Index ¶
- type AIAnalysisResult
- type CatalogConfig
- type CatalogItem
- type Config
- type Processor
- func (p *Processor) AnalyzeWithAI(ctx context.Context, html string) (*AIAnalysisResult, error)
- func (p *Processor) Execute(ctx context.Context) (*CatalogConfig, error)
- func (p *Processor) ExecuteInteractive(ctx context.Context, continueSignal <-chan struct{}) (*CatalogConfig, error)
- func (p *Processor) InteractiveScan(ctx context.Context, continueSignal <-chan struct{}, htmlContent *string) error
- type Selectors
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AIAnalysisResult ¶
type AIAnalysisResult struct {
TOCSelector string `json:"toc_selector"`
ContentSelector string `json:"content_selector"`
Confidence float64 `json:"confidence"`
Reasoning string `json:"reasoning"`
}
AIAnalysisResult AI分析结果
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 目录配置
type CatalogItem ¶
type CatalogItem struct {
Title string `json:"title"`
URL string `json:"url"`
Children []*CatalogItem `json:"children,omitempty"`
// contains filtered or unexported fields
}
CatalogItem 目录项
type Config ¶
type Config struct {
URL string // 目标URL
Output string // 输出目录
AIEnabled bool // 是否启用AI辅助
Headless bool // 是否无头模式
Timeout int // 超时时间
ExpandTOC bool // 是否展开目录
Interactive bool // 交互模式
AppConfig *models.AppConfig
}
Config scan命令配置
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
Processor scan处理器
func NewProcessor ¶
NewProcessor 创建scan处理器
func (*Processor) AnalyzeWithAI ¶
AnalyzeWithAI 使用AI分析页面结构(可选)
func (*Processor) Execute ¶
func (p *Processor) Execute(ctx context.Context) (*CatalogConfig, error)
Execute 执行扫描
func (*Processor) ExecuteInteractive ¶
func (p *Processor) ExecuteInteractive(ctx context.Context, continueSignal <-chan struct{}) (*CatalogConfig, error)
ExecuteInteractive 交互模式执行扫描
Click to show internal directories.
Click to hide internal directories.