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.

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