From 68a27b7f82a28642485c9570d09e77721b24b1fa Mon Sep 17 00:00:00 2001 From: Hayden <64056131+hay-kot@users.noreply.github.com> Date: Thu, 6 Oct 2022 15:02:15 -0500 Subject: [PATCH] rename repository factory --- backend/app/api/main.go | 2 +- backend/internal/repo/main_test.go | 2 +- backend/internal/repo/repos_all.go | 2 +- backend/internal/services/main_test.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/app/api/main.go b/backend/app/api/main.go index c159158..0309784 100644 --- a/backend/app/api/main.go +++ b/backend/app/api/main.go @@ -114,7 +114,7 @@ func run(cfg *config.Config) error { } app.db = c - app.repos = repo.EntAllRepos(c, cfg.Storage.Data) + app.repos = repo.New(c, cfg.Storage.Data) app.services = services.NewServices(app.repos) // ========================================================================= diff --git a/backend/internal/repo/main_test.go b/backend/internal/repo/main_test.go index 8729bab..92fe4be 100644 --- a/backend/internal/repo/main_test.go +++ b/backend/internal/repo/main_test.go @@ -53,7 +53,7 @@ func TestMain(m *testing.M) { } tClient = client - tRepos = EntAllRepos(tClient, os.TempDir()) + tRepos = New(tClient, os.TempDir()) defer client.Close() bootstrap() diff --git a/backend/internal/repo/repos_all.go b/backend/internal/repo/repos_all.go index 88ca1e4..d01b402 100644 --- a/backend/internal/repo/repos_all.go +++ b/backend/internal/repo/repos_all.go @@ -15,7 +15,7 @@ type AllRepos struct { Attachments *AttachmentRepo } -func EntAllRepos(db *ent.Client, root string) *AllRepos { +func New(db *ent.Client, root string) *AllRepos { return &AllRepos{ Users: &UserRepository{db}, AuthTokens: &TokenRepository{db}, diff --git a/backend/internal/services/main_test.go b/backend/internal/services/main_test.go index fa88314..26c3519 100644 --- a/backend/internal/services/main_test.go +++ b/backend/internal/services/main_test.go @@ -62,7 +62,7 @@ func TestMain(m *testing.M) { } tClient = client - tRepos = repo.EntAllRepos(tClient, os.TempDir()+"/homebox") + tRepos = repo.New(tClient, os.TempDir()+"/homebox") tSvc = NewServices(tRepos) defer client.Close()