Move logpile to git.mchus.pro/reanimator/parser/v38 v38.0.0 (ADL-085). Add scripts/bump-parser.sh, which bumps the parser, tests, commits, tags the release as v<counter>.<parser major>, pushes and builds (ADL-086). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
43 lines
1004 B
Go
43 lines
1004 B
Go
package collector
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
|
|
"git.mchus.pro/reanimator/parser/v38/models"
|
|
)
|
|
|
|
type IPMIMockConnector struct{}
|
|
|
|
func NewIPMIMockConnector() *IPMIMockConnector {
|
|
return &IPMIMockConnector{}
|
|
}
|
|
|
|
func (c *IPMIMockConnector) Protocol() string {
|
|
return "ipmi"
|
|
}
|
|
|
|
func (c *IPMIMockConnector) Collect(ctx context.Context, req Request, emit ProgressFn) (*models.AnalysisResult, error) {
|
|
steps := []Progress{
|
|
{Status: "running", Progress: 20, Message: "IPMI: connecting to BMC..."},
|
|
{Status: "running", Progress: 55, Message: "IPMI: reading inventory..."},
|
|
{Status: "running", Progress: 85, Message: "IPMI: normalizing data..."},
|
|
}
|
|
|
|
for _, step := range steps {
|
|
if !sleepWithContext(ctx, 150*time.Millisecond) {
|
|
return nil, ctx.Err()
|
|
}
|
|
if emit != nil {
|
|
emit(step)
|
|
}
|
|
}
|
|
|
|
return &models.AnalysisResult{
|
|
Events: make([]models.Event, 0),
|
|
FRU: make([]models.FRUInfo, 0),
|
|
Sensors: make([]models.SensorReading, 0),
|
|
Hardware: &models.HardwareConfig{},
|
|
}, nil
|
|
}
|