Files
tecamino-json_data/models/drivers.go
2025-04-26 23:14:50 +02:00

21 lines
352 B
Go

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,
}
}