add files

This commit is contained in:
Adrian Zürcher
2025-04-25 18:56:27 +02:00
parent 2b5a5a7905
commit 85bd8de2a2
14 changed files with 667 additions and 0 deletions

20
drivers.go Normal file
View 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 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,
}
}