personal-website/wde/wde.go

33 lines
483 B
Go

package wde
import (
"personalwebsite/webfilesystem"
"github.com/gin-gonic/gin"
)
type WDE struct {
fs *webfilesystem.WebFileSystem
FilesWidget FilesWidget
}
func NewWDE(webFs *webfilesystem.WebFileSystem) *WDE {
return &WDE{
fs: webFs,
}
}
type FilesWidget struct {
}
func (w *WDE) Render(path string) (gin.H, error) {
list, err := w.fs.List(path)
if err != nil {
return nil, err
}
return gin.H{
"Name": "Greg Brzezinski",
"Files": list,
}, nil
}