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.

28 lines
634 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
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 dpMutex sync.Mutex
  12. func DriverProvider() models.DriverProvider {
  13. dpMutex.Lock()
  14. defer dpMutex.Unlock()
  15. if dp == nil {
  16. dp = drivers.DriverMap{
  17. models.DTNanoLeaf: &nanoleaf.Driver{},
  18. models.DTHue: &hue.Driver{},
  19. models.DTLIFX: &lifx.Driver{},
  20. }
  21. }
  22. return dp
  23. }