Files
new-server/models/driver.go
T
2021-05-22 12:35:27 +02:00

18 lines
496 B
Go

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