Files
logpile/internal/parser/interface.go
Michael Chus 512957545a Add LOGPile BMC diagnostic log analyzer
Features:
- Modular parser architecture for vendor-specific formats
- Inspur/Kaytus parser supporting asset.json, devicefrusdr.log,
  component.log, idl.log, and syslog files
- PCI Vendor/Device ID lookup for hardware identification
- Web interface with tabs: Events, Sensors, Config, Serials, Firmware
- Server specification summary with component grouping
- Export to CSV, JSON, TXT formats
- BMC alarm parsing from IDL logs (memory errors, PSU events, etc.)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 04:11:23 +03:00

31 lines
884 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
// 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
}