This commit is contained in:
Max Richter
2025-09-24 21:32:27 +02:00
parent 26c303d9cf
commit 733ae876b9
27 changed files with 374 additions and 201 deletions

View File

@@ -0,0 +1,34 @@
// Package adapters are the backend to that connects the marka server to a storage
package adapters
import "time"
type FileAdapter interface {
Read(path string) (FsResponse, error)
Write(path string, content []byte) error
}
type FsFile struct {
Name string `json:"name"`
Type string `json:"type"`
Content []byte `json:"content"`
ModTime time.Time `json:"modTime"`
}
type FsDirEntry struct {
Name string `json:"name"`
Type string `json:"type"`
IsDir bool `json:"isDir,omitempty"`
ModTime time.Time `json:"modTime"`
}
type FsDir struct {
Files []FsDirEntry `json:"files"`
Name string `json:"name"`
ModTime time.Time `json:"modTime"`
}
type FsResponse struct {
Dir *FsDir `json:"dir,omitempty"`
File *FsFile `json:"file,omitempty"`
}