From b8b6d3037c524575f140650ac243c16df6a98a92 Mon Sep 17 00:00:00 2001 From: Gabriel Arakaki Giovanini Date: Wed, 19 Jul 2023 21:01:49 +0200 Subject: feat: Move last page to qtpl --- pkg/service/filesystem.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'pkg/service') diff --git a/pkg/service/filesystem.go b/pkg/service/filesystem.go index 2e4b510..b4479ea 100644 --- a/pkg/service/filesystem.go +++ b/pkg/service/filesystem.go @@ -6,6 +6,7 @@ import ( "net/url" "path" "strings" + "syscall" "git.sr.ht/~gabrielgio/img/pkg/database/repository" "git.sr.ht/~gabrielgio/img/pkg/list" @@ -33,6 +34,20 @@ type ( } ) +func (f *FileParam) GetUid() int { + if stat, ok := f.Info.Sys().(*syscall.Stat_t); ok { + return int(stat.Uid) + } + return 0 +} + +func (f *FileParam) GetGid() int { + if stat, ok := f.Info.Sys().(*syscall.Stat_t); ok { + return int(stat.Gid) + } + return 0 +} + func NewFileSystemController( fsRepository repository.FileSystemRepository, userRepository repository.UserRepository, -- cgit v1.2.3