personal-website/webfilesystem/webfilesystem.go

54 lines
949 B
Go
Raw Normal View History

2023-03-22 21:53:06 +00:00
package webfilesystem
2023-04-12 17:04:25 +00:00
import "github.com/google/uuid"
2023-03-22 21:53:06 +00:00
type WebFileSystem struct {
folders []*Folder
}
2023-04-13 01:09:07 +00:00
func (fs *WebFileSystem) List() []*WebFSFile {
// aboutMe := &Exec{
// WebFSFile: WebFSFile{
// Id: uuid.NewString(),
// FileName: "Aboutme.app",
// },
// }
// testImg :=
// mockFolder := Folder{
// files: []File{aboutMe},
// }
// kek := []*WebFSFile{}
return []*WebFSFile{{uuid.NewString(), "Aboutme", "app", "personal-properties"}, {uuid.NewString(), "lel.lol", "lol", nil}, {uuid.NewString(), "lel.img", "img", nil}}
// return mockFolder.files
2023-03-22 21:53:06 +00:00
}
type Folder struct {
2023-04-13 01:09:07 +00:00
files []File
2023-03-22 21:53:06 +00:00
}
2023-04-13 01:09:07 +00:00
type WebFSFile struct {
2023-04-12 17:04:25 +00:00
Id string
2023-03-22 21:53:06 +00:00
FileName string
2023-04-13 01:09:07 +00:00
Type string
data interface{}
}
type File interface {
GetUuid() string
GetFileName() string
}
type Image struct {
}
type Exec struct {
WebFSFile
}
func (e *Exec) GetUuid() string {
return e.Id
}
func (e *Exec) GetFileName() string {
return e.FileName
2023-03-22 21:53:06 +00:00
}