package config import ( "git.aiterp.net/lucifer/new-server/internal/drivers" "git.aiterp.net/lucifer/new-server/internal/drivers/nanoleaf" "git.aiterp.net/lucifer/new-server/models" "sync" ) var dp models.DriverProvider var dpMutex sync.Mutex func DriverProvider() models.DriverProvider { dpMutex.Lock() defer dpMutex.Unlock() if dp == nil { dp = drivers.DriverMap{ models.DTNanoLeaf: &nanoleaf.Driver{}, } } return dp }