second commit

This commit is contained in:
Stian Fredrik Aune
2021-05-22 12:35:27 +02:00
parent 8f648de929
commit dda774f22b
17 changed files with 186 additions and 35 deletions
+13 -8
View File
@@ -1,16 +1,21 @@
package models
type Bridge struct {
ID int
Name string
Driver DriverType
Address string
Token string
ID int `json:"id"`
Name string `json:"name"`
Driver DriverKind `json:"driver"`
Address string `json:"address"`
Token string `json:"token"`
}
type DriverType string
type DriverKind string
var (
DTHue DriverType = "Hue"
DTNanoLeaf DriverType = "NanoLeaf"
DTHue DriverKind = "Hue"
DTNanoLeaf DriverKind = "NanoLeaf"
)
var ValidDriverKinds = []DriverKind{
DTHue,
DTNanoLeaf,
}
+2 -2
View File
@@ -5,8 +5,8 @@ import (
"time"
)
type DriverResolver interface {
ResolveFor(bridge Bridge) (Driver, error)
type DriverProvider interface {
Provide(kind DriverKind) (Driver, error)
}
type Driver interface {