owncast/persistence/authrepository/sqlauthrepository.go
Gabe Kangas 0b5d7c8a4d
Config repository (#3988)
* WIP

* fix(test): fix ap test failing

* fix: fix unkeyed fields being used

* chore(tests): clean up browser tests by splitting out federation UI tests
2024-11-15 19:20:58 -08:00

30 lines
624 B
Go

package authrepository
import (
"github.com/owncast/owncast/core/data"
)
type SqlAuthRepository struct {
datastore *data.Datastore
}
// NOTE: This is temporary during the transition period.
var temporaryGlobalInstance AuthRepository
// Get will return the user repository.
func Get() AuthRepository {
if temporaryGlobalInstance == nil {
i := New(data.GetDatastore())
temporaryGlobalInstance = i
}
return temporaryGlobalInstance
}
// New will create a new instance of the UserRepository.
func New(datastore *data.Datastore) *SqlAuthRepository {
r := &SqlAuthRepository{
datastore: datastore,
}
return r
}