21 lines
351 B
Go
21 lines
351 B
Go
package models
|
|
|
|
type Drivers map[string]*Driver
|
|
|
|
type Driver struct {
|
|
Type string `json:"type,omitempty"`
|
|
Bus string `json:"bus"`
|
|
Address int `json:"address"`
|
|
}
|
|
|
|
func NewDrivers() Drivers {
|
|
return make(Drivers)
|
|
}
|
|
|
|
func (d *Drivers) AddDriver(typ, bus string, address int) {
|
|
(*d)[typ] = &Driver{
|
|
Bus: bus,
|
|
Address: address,
|
|
}
|
|
}
|