Skip to content

Commit

Permalink
Split ReadInfo into BMC and Machine parts
Browse files Browse the repository at this point in the history
  • Loading branch information
Gchbg committed May 3, 2024
1 parent 0a29963 commit 514f75c
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions internal/bmc/bmc.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,22 @@ type Credentials struct {
}

type Info struct {
Type string
Type Typ
Manufacturer string
SerialNumber string
FirmwareVersion string
Console string
Machines []Machine
}

type Typ string

const (
TypeMachine Typ = "Machine"
TypeSwitch Typ = "Switch"
TypeRouter Typ = "Router"
)

type Machine struct {
UUID string
Manufacturer string
Expand All @@ -44,9 +52,12 @@ type Machine struct {
LocatorLED LED
}

type LEDControl interface {
SetLocatorLED(ctx context.Context, state LED) (LED, error)
}
type Power string

const (
PowerOn Power = "On"
PowerOff Power = "Off"
)

type LED string

Expand All @@ -56,18 +67,15 @@ const (
LEDBlinking LED = "Blinking"
)

type LEDControl interface {
SetLocatorLED(ctx context.Context, state LED) (LED, error)
}

type PowerControl interface {
PowerOn(ctx context.Context) error
PowerOff(ctx context.Context, force bool) error
}

type Power string

const (
PowerOn Power = "On"
PowerOff Power = "Off"
)

type RestartControl interface {
Restart(ctx context.Context, force bool) error
}
Expand Down

0 comments on commit 514f75c

Please sign in to comment.