Skip to content

Commit

Permalink
Add supermicro.Unmarshal() to config
Browse files Browse the repository at this point in the history
  • Loading branch information
splaspood committed Jun 3, 2024
1 parent 3db7cec commit abd7b90
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions config/asrockrack.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ func (cm *asrockrackVendorConfig) Marshal() (string, error) {
}
}

func (cm *asrockrackVendorConfig) Unmarshal(cfgData string) (biosConfig *supermicroConfig, err error) {
err = xml.Unmarshal([]byte(cfgData), biosConfig)
return
}

// Generic config options

func (cm *asrockrackVendorConfig) EnableTPM() {
Expand Down
5 changes: 5 additions & 0 deletions config/dell.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ func (cm *dellVendorConfig) Marshal() (string, error) {
}
}

func (cm *dellVendorConfig) Unmarshal(cfgData string) (biosConfig *dellConfig, err error) {
err = xml.Unmarshal([]byte(cfgData), biosConfig)
return
}

// Generic config options

func (cm *dellVendorConfig) EnableTPM() {
Expand Down
1 change: 1 addition & 0 deletions config/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ type VendorConfigManager interface {

Raw(name, value string, menuPath []string)
Marshal() (string, error)
Unmarshal(cfgData string) (biosConfig *supermicroConfig, err error)
}

func NewVendorConfigManager(configFormat, vendorName string, vendorOptions map[string]string) (VendorConfigManager, error) {
Expand Down
5 changes: 5 additions & 0 deletions config/supermicro.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ func (cm *supermicroVendorConfig) Marshal() (string, error) {
}
}

func (cm *supermicroVendorConfig) Unmarshal(cfgData string) (biosConfig *supermicroConfig, err error) {
err = xml.Unmarshal([]byte(cfgData), biosConfig)
return
}

// Generic config options

func (cm *supermicroVendorConfig) EnableTPM() {
Expand Down

0 comments on commit abd7b90

Please sign in to comment.