feat: Add RealFS and HomepageModule to utils

This commit is contained in:
ptrcnull 2020-12-29 15:45:43 +01:00
parent 8df5d295d8
commit 5e3708ca60
2 changed files with 35 additions and 0 deletions

19
utils/homepage_module.go Normal file
View File

@ -0,0 +1,19 @@
package utils
type HomepageModule struct {}
func (m HomepageModule) FriendlyName() string {
return "homepage"
}
func (m HomepageModule) Name() string {
return "homepage"
}
func (m HomepageModule) Hidden() bool {
return true
}
func (m HomepageModule) MinAccessLevel() int64 {
return -1
}

16
utils/realfs.go Normal file
View File

@ -0,0 +1,16 @@
package utils
import (
"net/http"
"os"
"path"
)
type RealFS struct {
Path string
}
func (fs RealFS) Open(filename string) (http.File, error) {
return os.Open(path.Join(fs.Path, filename))
}