MCPcopy Index your code
hub / github.com/MengMengCode/GetRealityDomain / WriteResult

Method WriteResult

output.go:58–81  ·  view source on GitHub ↗

WriteResult 写入扫描结果

(result ScanResult)

Source from the content-addressed store, hash-verified

56
57// WriteResult 写入扫描结果
58func (cw *CSVWriter) WriteResult(result ScanResult) error {
59 record := []string{
60 result.IP,
61 result.Origin,
62 strconv.Itoa(result.Port),
63 result.CertDomain,
64 result.CertIssuer,
65 result.TLSVersion,
66 result.ALPN,
67 result.Curve,
68 result.GeoCode,
69 strconv.FormatBool(result.Feasible),
70 strconv.FormatInt(result.ResponseTime, 10),
71 result.Error,
72 time.Now().Format("2006-01-02 15:04:05"),
73 }
74
75 if err := cw.writer.Write(record); err != nil {
76 return fmt.Errorf("写入CSV记录失败: %v", err)
77 }
78
79 cw.writer.Flush()
80 return nil
81}
82
83// Close 关闭CSV写入器
84func (cw *CSVWriter) Close() error {

Callers 1

ProcessResultsMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected