Files
new-server/models/driver.go
T
gisle 6947fc3461
continuous-integration/drone/push Build is passing
add delete light endpoint and forget for Hue.
2022-01-31 23:09:00 +01:00

23 lines
640 B
Go

package models
import (
"context"
"time"
)
type DriverProvider interface {
Provide(kind DriverKind) (Driver, error)
}
type Driver interface {
SearchBridge(ctx context.Context, address, token string, dryRun bool) ([]Bridge, error)
SearchDevices(ctx context.Context, bridge Bridge, timeout time.Duration) ([]Device, error)
ListDevices(ctx context.Context, bridge Bridge) ([]Device, error)
Publish(ctx context.Context, bridge Bridge, devices []Device) error
Run(ctx context.Context, bridge Bridge, ch chan<- Event) error
}
type ForgettableDriver interface {
ForgetDevice(ctx context.Context, bridge Bridge, device Device) error
}