Files
logpile/internal/parser/interface.go
Michael Chus c7422e95aa v1.1.0: Parser versioning, server info, auto-browser, section overviews
- Add parser versioning with Version() method and version display on main screen
- Add server model and serial number to Configuration tab and TXT export
- Add auto-browser opening on startup with --no-browser flag
- Add Restart and Exit buttons with graceful shutdown
- Add section overview stats (CPU, Power, Storage, GPU, Network)
- Change PCIe Link display to "x16 PCIe Gen4" format
- Add Location column to Serials section
- Extract BoardInfo from FRU and PlatformId from ThermalConfig

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 13:49:43 +03:00

35 lines
1007 B
Go

package parser
import (
"git.mchus.pro/mchus/logpile/internal/models"
)
// VendorParser interface for vendor-specific parsers
type VendorParser interface {
// Name returns human-readable parser name
Name() string
// Vendor returns vendor identifier (e.g., "inspur", "supermicro", "dell")
Vendor() string
// Version returns parser version string
// IMPORTANT: Increment version when modifying parser logic!
Version() string
// Detect checks if this parser can handle the given files
// Returns confidence score 0-100 (0 = cannot parse, 100 = definitely this format)
Detect(files []ExtractedFile) int
// Parse parses the extracted files and returns analysis result
Parse(files []ExtractedFile) (*models.AnalysisResult, error)
}
// FileParser interface for parsing specific file types within vendor module
type FileParser interface {
// CanParse checks if this parser can handle the file
CanParse(file ExtractedFile) bool
// Parse parses the file content
Parse(content []byte) error
}