simplify file object

This commit is contained in:
2026-09-01 00:19:08 +01:00
parent d13ee5cf13
commit 19f540e808
2 changed files with 13 additions and 25 deletions
-21
View File
@@ -1,7 +1,6 @@
package sqan
import (
"errors"
"time"
)
@@ -12,26 +11,6 @@ type File struct {
RelativePath string `json:"relativePath,omitempty"`
Filename string `json:"filename,omitempty"`
Extension string `json:"extension,omitempty"`
Hash string `json:"hash,omitempty"`
Size int64 `json:"size,omitempty"`
Modified time.Time `json:"modified,omitempty"`
}
func (f *File) Process() error {
return errors.New("unimplemented")
}
func NewFile(rootDir, absPath string) *File {
relPath, relDir, filename, extension := ParsePath(rootDir, absPath)
f := &File{
RootDir: rootDir,
AbsolutePath: absPath,
RelativeDir: relDir,
RelativePath: relPath,
Filename: filename,
Extension: extension,
}
return f
}