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.

25 lines
596 B

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. package config
  2. import (
  3. "git.aiterp.net/lucifer/new-server/internal/drivers"
  4. "git.aiterp.net/lucifer/new-server/internal/drivers/hue"
  5. "git.aiterp.net/lucifer/new-server/internal/drivers/lifx"
  6. "git.aiterp.net/lucifer/new-server/internal/drivers/nanoleaf"
  7. "git.aiterp.net/lucifer/new-server/models"
  8. "sync"
  9. )
  10. var dp models.DriverProvider
  11. var dpOnce sync.Once
  12. func DriverProvider() models.DriverProvider {
  13. dpOnce.Do(func() {
  14. dp = drivers.DriverMap{
  15. models.DTNanoLeaf: &nanoleaf.Driver{},
  16. models.DTHue: &hue.Driver{},
  17. models.DTLIFX: &lifx.Driver{},
  18. }
  19. })
  20. return dp
  21. }