mirror of
https://github.com/owncast/owncast.git
synced 2024-10-10 19:16:02 +00:00
fix: use interface type instead of concrete type
This commit is contained in:
parent
ec83e103fa
commit
979573525d
@ -49,10 +49,10 @@ type SqlUserRepository struct {
|
||||
}
|
||||
|
||||
// NOTE: This is temporary during the transition period.
|
||||
var temporaryGlobalInstance *SqlUserRepository
|
||||
var temporaryGlobalInstance UserRepository
|
||||
|
||||
// Get will return the user repository.
|
||||
func Get() *SqlUserRepository {
|
||||
func Get() UserRepository {
|
||||
if temporaryGlobalInstance == nil {
|
||||
i := New(data.GetDatastore())
|
||||
temporaryGlobalInstance = i
|
||||
@ -61,12 +61,12 @@ func Get() *SqlUserRepository {
|
||||
}
|
||||
|
||||
// New will create a new instance of the UserRepository.
|
||||
func New(datastore *data.Datastore) *SqlUserRepository {
|
||||
r := &SqlUserRepository{
|
||||
func New(datastore *data.Datastore) UserRepository {
|
||||
r := SqlUserRepository{
|
||||
datastore: datastore,
|
||||
}
|
||||
|
||||
return r
|
||||
return &r
|
||||
}
|
||||
|
||||
// CreateAnonymousUser will create a new anonymous user with the provided display name.
|
||||
|
Loading…
x
Reference in New Issue
Block a user