diff options
author | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2023-06-29 23:05:23 +0200 |
---|---|---|
committer | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2023-06-29 23:06:44 +0200 |
commit | 024da3e546e98cbaeea5f7bc86af12b671996f41 (patch) | |
tree | 08b38491b7e726fb448cceaceb2ef536360b2223 /pkg/view | |
parent | 9ba53fea71728ce64342d0d59f4199876e4b6164 (diff) | |
download | lens-024da3e546e98cbaeea5f7bc86af12b671996f41.tar.gz lens-024da3e546e98cbaeea5f7bc86af12b671996f41.tar.bz2 lens-024da3e546e98cbaeea5f7bc86af12b671996f41.zip |
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.
Diffstat (limited to 'pkg/view')
-rw-r--r-- | pkg/view/media.go | 2 | ||||
-rw-r--r-- | pkg/view/settings.go | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/pkg/view/media.go b/pkg/view/media.go index 22f950d..66e3020 100644 --- a/pkg/view/media.go +++ b/pkg/view/media.go @@ -89,7 +89,7 @@ func (self *MediaView) GetImage(ctx *fasthttp.RequestCtx) error { } ctx.Response.Header.SetContentType(media.MIMEType) - ctx.SendFile(media.Path) + fasthttp.ServeFileUncompressed(ctx, media.Path) return nil } diff --git a/pkg/view/settings.go b/pkg/view/settings.go index e5acb1b..954cc98 100644 --- a/pkg/view/settings.go +++ b/pkg/view/settings.go @@ -5,7 +5,7 @@ import ( "git.sr.ht/~gabrielgio/img" "git.sr.ht/~gabrielgio/img/pkg/components/settings" - "git.sr.ht/~gabrielgio/img/pkg/components/user" + "git.sr.ht/~gabrielgio/img/pkg/database/repository" "git.sr.ht/~gabrielgio/img/pkg/ext" ) @@ -13,18 +13,18 @@ type ( SettingsView struct { // there is not need to create a controller for this settingsRepository settings.Repository - userRepository user.Repository + userRepository repository.UserRepository } SettingsPage struct { Settings *settings.Settings - Users []*user.User + Users []*repository.User } ) func NewSettingsView( settingsRespository settings.Repository, - userRepository user.Repository, + userRepository repository.UserRepository, ) *SettingsView { return &SettingsView{ settingsRepository: settingsRespository, |