Files
go-ha/internal/services/builder.go
Sam Lewis 7bcca889f9 good progress yay:
- impl http client
- create http client in App()
- generic builder for Service.*
- set Service on app to pass to callbacks later
- impl State
- set State on app to pass to callbacks later
- change panic to log.Fatalln
2022-10-11 01:22:23 -04:00

12 lines
191 B
Go

package services
import (
"context"
"nhooyr.io/websocket"
)
func BuildService[T Light | HomeAssistant](conn *websocket.Conn, ctx context.Context) *T {
return &T{conn: conn, ctx: ctx}
}