second commit
This commit is contained in:
+13
-8
@@ -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
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user