Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotImplemented = errors.New("bios operation not implemented")
ErrNotImplemented is returned when a BIOS operation is not yet implemented.
Functions ¶
Types ¶
type BaseManager ¶
type BaseManager struct {
// contains filtered or unexported fields
}
BaseManager provides a generic BIOS Manager implementation backed by a static critical-settings map. Vendors only need to supply their vendor constant and their recommended settings; all Manager interface methods are handled here.
func NewBaseManager ¶
func NewBaseManager(vendor system.Vendor, log *slog.Logger, settings map[string]string) *BaseManager
NewBaseManager creates a BaseManager for the given vendor and settings.
func (*BaseManager) Apply ¶
func (m *BaseManager) Apply(_ context.Context, changes []SettingChange) ([]string, error)
Apply logs each change and returns all names as requiring reboot.
func (*BaseManager) Capture ¶
func (m *BaseManager) Capture(_ context.Context) (*State, error)
Capture returns a State snapshot populated from the critical settings map.
func (*BaseManager) Reset ¶
func (m *BaseManager) Reset(_ context.Context) error
Reset is not implemented for the generic base manager.
func (*BaseManager) Vendor ¶
func (m *BaseManager) Vendor() system.Vendor
Vendor returns the server vendor this manager handles.
type Baseline ¶
type Baseline struct {
Vendor system.Vendor `json:"vendor"`
Model string `json:"model,omitempty"`
Settings map[string]string `json:"settings"`
}
Baseline is a golden BIOS configuration for comparison.
type DiffEntry ¶
type DiffEntry struct {
Name string `json:"name"`
Expected string `json:"expected"`
Actual string `json:"actual"`
}
DiffEntry is a single BIOS setting difference.
type Manager ¶
type Manager interface {
// Vendor returns the server vendor this manager handles.
Vendor() system.Vendor
// Capture reads all BIOS settings and returns a snapshot.
Capture(ctx context.Context) (*State, error)
// Apply sets BIOS attributes. Returns attributes requiring reboot.
Apply(ctx context.Context, changes []SettingChange) (rebootRequired []string, err error)
// Reset restores BIOS to factory defaults.
Reset(ctx context.Context) error
}
Manager provides vendor-specific BIOS operations.
type Setting ¶
type Setting struct {
Name string `json:"name"`
CurrentValue string `json:"currentValue"`
DefaultValue string `json:"defaultValue,omitempty"`
PendingValue string `json:"pendingValue,omitempty"`
Type string `json:"type"`
AllowedValues []string `json:"allowedValues,omitempty"`
ReadOnly bool `json:"readOnly,omitempty"`
}
Setting represents a single BIOS attribute.
type SettingChange ¶
SettingChange requests a BIOS attribute modification.