You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
743 B
32 lines
743 B
package models
|
|
|
|
import "context"
|
|
|
|
type Bridge struct {
|
|
ID int `json:"id" db:"id"`
|
|
Name string `json:"name" db:"name"`
|
|
Driver DriverKind `json:"driver" db:"driver"`
|
|
Address string `json:"address" db:"address"`
|
|
Token string `json:"-" db:"token"`
|
|
}
|
|
|
|
type BridgeRepository interface {
|
|
Find(ctx context.Context, id int) (Bridge, error)
|
|
FetchAll(ctx context.Context) ([]Bridge, error)
|
|
Save(ctx context.Context, bridge *Bridge) error
|
|
Delete(ctx context.Context, bridge *Bridge) error
|
|
}
|
|
|
|
type DriverKind string
|
|
|
|
var (
|
|
DTHue DriverKind = "Hue"
|
|
DTNanoLeaf DriverKind = "Nanoleaf"
|
|
DTLIFX DriverKind = "LIFX"
|
|
DTMill DriverKind = "Mill"
|
|
)
|
|
|
|
var ValidDriverKinds = []DriverKind{
|
|
DTHue,
|
|
DTNanoLeaf,
|
|
}
|