MCPcopy Create free account
hub / github.com/V2RaySSR/RealityChecker / CheckDomains

Method CheckDomains

internal/batch/manager.go:89–113  ·  view source on GitHub ↗

CheckDomains 批量检测域名

(ctx context.Context, domains []string)

Source from the content-addressed store, hash-verified

87
88// CheckDomains 批量检测域名
89func (bm *Manager) CheckDomains(ctx context.Context, domains []string) ([]*types.DetectionResult, error) {
90 if !bm.running {
91 return nil, fmt.Errorf("批量管理器未运行")
92 }
93
94 if len(domains) == 0 {
95 return []*types.DetectionResult{}, nil
96 }
97
98 startTime := time.Now()
99
100 // 使用流式检测显示实时进度
101 results, err := bm.CheckDomainsWithProgress(ctx, domains)
102 if err != nil {
103 return nil, err
104 }
105
106 // 生成批量报告
107 batchReport := bm.generateBatchReport(results, startTime, time.Now())
108
109 // 打印报告
110 fmt.Println(bm.formatBatchReport(batchReport))
111
112 return results, nil
113}
114
115// CheckDomainsWithProgress 带进度显示的并发批量检测
116func (bm *Manager) CheckDomainsWithProgress(ctx context.Context, domains []string) ([]*types.DetectionResult, error) {

Callers

nothing calls this directly

Calls 3

generateBatchReportMethod · 0.95
formatBatchReportMethod · 0.95

Tested by

no test coverage detected