remodel json data for compatibility
This commit is contained in:
20
models/drivers.go
Normal file
20
models/drivers.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package models
|
||||
|
||||
type Drivers map[string]*Driver
|
||||
|
||||
type Driver struct {
|
||||
Type string `json:"type,omitempty"`
|
||||
Bus string `json:"bus"`
|
||||
Address uint `json:"address"`
|
||||
}
|
||||
|
||||
func NewDrivers() Drivers {
|
||||
return make(Drivers)
|
||||
}
|
||||
|
||||
func (d *Drivers) AddDriver(typ, bus string, address uint) {
|
||||
(*d)[typ] = &Driver{
|
||||
Bus: bus,
|
||||
Address: address,
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user