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.

26 lines
537 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/nanoleaf"
  6. "git.aiterp.net/lucifer/new-server/models"
  7. "sync"
  8. )
  9. var dp models.DriverProvider
  10. var dpMutex sync.Mutex
  11. func DriverProvider() models.DriverProvider {
  12. dpMutex.Lock()
  13. defer dpMutex.Unlock()
  14. if dp == nil {
  15. dp = drivers.DriverMap{
  16. models.DTNanoLeaf: &nanoleaf.Driver{},
  17. models.DTHue: &hue.Driver{},
  18. }
  19. }
  20. return dp
  21. }