From 024da3e546e98cbaeea5f7bc86af12b671996f41 Mon Sep 17 00:00:00 2001 From: Gabriel Arakaki Giovanini Date: Thu, 29 Jun 2023 23:05:23 +0200 Subject: ref: Refactor how repository is define To make things easier and reduce the number of package I'll move all repository to one folder, starting with auth and user repository. Also implements all testing on top of the repository interface with a im memory implementation. This will later make mescling unit and integration easier. --- pkg/ext/middleware.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pkg/ext') diff --git a/pkg/ext/middleware.go b/pkg/ext/middleware.go index bc23b90..d255c6d 100644 --- a/pkg/ext/middleware.go +++ b/pkg/ext/middleware.go @@ -7,7 +7,7 @@ import ( "github.com/sirupsen/logrus" "github.com/valyala/fasthttp" - "git.sr.ht/~gabrielgio/img/pkg/components/user" + "git.sr.ht/~gabrielgio/img/pkg/database/repository" ) func HTML(next fasthttp.RequestHandler) fasthttp.RequestHandler { @@ -91,10 +91,10 @@ func (a *AuthMiddleware) LoggedIn(next fasthttp.RequestHandler) fasthttp.Request } type InitialSetupMiddleware struct { - userRepository user.Repository + userRepository repository.UserRepository } -func NewInitialSetupMiddleware(userRepository user.Repository) *InitialSetupMiddleware { +func NewInitialSetupMiddleware(userRepository repository.UserRepository) *InitialSetupMiddleware { return &InitialSetupMiddleware{ userRepository: userRepository, } -- cgit v1.2.3