mirror of
https://github.com/sysadminsmedia/homebox.git
synced 2025-12-21 13:23:14 +01:00
* Initial plan * Fix item deletion to properly clean up attachment files Co-authored-by: tankerkiller125 <3457368+tankerkiller125@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: tankerkiller125 <3457368+tankerkiller125@users.noreply.github.com>
37 lines
1.2 KiB
Go
37 lines
1.2 KiB
Go
// Package repo provides the data access layer for the application.
|
|
package repo
|
|
|
|
import (
|
|
"github.com/sysadminsmedia/homebox/backend/internal/core/services/reporting/eventbus"
|
|
"github.com/sysadminsmedia/homebox/backend/internal/data/ent"
|
|
"github.com/sysadminsmedia/homebox/backend/internal/sys/config"
|
|
)
|
|
|
|
// AllRepos is a container for all the repository interfaces
|
|
type AllRepos struct {
|
|
Users *UserRepository
|
|
AuthTokens *TokenRepository
|
|
Groups *GroupRepository
|
|
Locations *LocationRepository
|
|
Labels *LabelRepository
|
|
Items *ItemsRepository
|
|
Attachments *AttachmentRepo
|
|
MaintEntry *MaintenanceEntryRepository
|
|
Notifiers *NotifierRepository
|
|
}
|
|
|
|
func New(db *ent.Client, bus *eventbus.EventBus, storage config.Storage, pubSubConn string, thumbnail config.Thumbnail) *AllRepos {
|
|
attachments := &AttachmentRepo{db, storage, pubSubConn, thumbnail}
|
|
return &AllRepos{
|
|
Users: &UserRepository{db},
|
|
AuthTokens: &TokenRepository{db},
|
|
Groups: NewGroupRepository(db),
|
|
Locations: &LocationRepository{db, bus},
|
|
Labels: &LabelRepository{db, bus},
|
|
Items: &ItemsRepository{db, bus, attachments},
|
|
Attachments: attachments,
|
|
MaintEntry: &MaintenanceEntryRepository{db},
|
|
Notifiers: NewNotifierRepository(db),
|
|
}
|
|
}
|