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
This commit is contained in:
30
persistence/authrepository/sqlauthrepository.go
Normal file
30
persistence/authrepository/sqlauthrepository.go
Normal file
@@ -0,0 +1,30 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user