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
31 lines
624 B
Go
31 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
|
|
}
|