owncast/storage/chatrepository/chatrepository.go
Gabe Kangas b80ccc4966
WIP
2024-03-25 09:04:05 -07:00

30 lines
582 B
Go

package chatrepository
import "github.com/owncast/owncast/storage/data"
type ChatRepository struct {
datastore *data.Store
}
func New(datastore *data.Store) *ChatRepository {
r := &ChatRepository{
datastore: datastore,
}
r.startPruner()
return r
}
// NOTE: This is temporary during the transition period.
var temporaryGlobalInstance *ChatRepository
// GetUserRepository will return the user repository.
func Get() *ChatRepository {
if temporaryGlobalInstance == nil {
i := New(data.GetDatastore())
temporaryGlobalInstance = i
}
return temporaryGlobalInstance
}