mirror of
https://github.com/owncast/owncast.git
synced 2024-11-21 12:18:02 +03:00
0b5d7c8a4d
* 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
30 lines
624 B
Go
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
|
|
}
|