2022-08-30 02:30:36 +00:00
|
|
|
package services
|
|
|
|
|
2022-09-24 19:33:38 +00:00
|
|
|
import "github.com/hay-kot/homebox/backend/internal/repo"
|
2022-08-30 02:30:36 +00:00
|
|
|
|
|
|
|
type AllServices struct {
|
2022-08-31 05:22:01 +00:00
|
|
|
User *UserService
|
2022-10-15 20:15:55 +00:00
|
|
|
Group *GroupService
|
2022-08-31 05:22:01 +00:00
|
|
|
Location *LocationService
|
2022-09-02 01:52:40 +00:00
|
|
|
Labels *LabelService
|
2022-09-03 09:17:48 +00:00
|
|
|
Items *ItemService
|
2022-08-30 02:30:36 +00:00
|
|
|
}
|
|
|
|
|
2022-10-15 20:15:55 +00:00
|
|
|
func New(repos *repo.AllRepos) *AllServices {
|
2022-09-24 19:33:38 +00:00
|
|
|
if repos == nil {
|
|
|
|
panic("repos cannot be nil")
|
|
|
|
}
|
|
|
|
|
2022-08-30 02:30:36 +00:00
|
|
|
return &AllServices{
|
2022-08-31 05:22:01 +00:00
|
|
|
User: &UserService{repos},
|
2022-10-15 20:15:55 +00:00
|
|
|
Group: &GroupService{repos},
|
2022-08-31 05:22:01 +00:00
|
|
|
Location: &LocationService{repos},
|
2022-09-02 01:52:40 +00:00
|
|
|
Labels: &LabelService{repos},
|
2022-09-12 22:47:27 +00:00
|
|
|
Items: &ItemService{
|
2022-09-27 23:52:13 +00:00
|
|
|
repo: repos,
|
|
|
|
at: attachmentTokens{},
|
2022-09-12 22:47:27 +00:00
|
|
|
},
|
2022-08-30 02:30:36 +00:00
|
|
|
}
|
|
|
|
}
|