2023-09-01 12:31:04 +00:00
|
|
|
package types
|
|
|
|
|
2024-06-04 06:31:00 +00:00
|
|
|
import (
|
|
|
|
"io/fs"
|
|
|
|
"os"
|
2024-12-18 11:15:29 +00:00
|
|
|
"time"
|
2024-06-04 06:31:00 +00:00
|
|
|
)
|
|
|
|
|
2023-09-01 12:31:04 +00:00
|
|
|
// KairosFS is our interface for methods that need an FS
|
|
|
|
type KairosFS interface {
|
2024-06-04 06:31:00 +00:00
|
|
|
Open(name string) (fs.File, error)
|
2024-12-18 11:15:29 +00:00
|
|
|
Chmod(name string, mode os.FileMode) error
|
|
|
|
Create(name string) (*os.File, error)
|
|
|
|
Mkdir(name string, perm os.FileMode) error
|
|
|
|
Stat(name string) (os.FileInfo, error)
|
|
|
|
Lstat(name string) (os.FileInfo, error)
|
|
|
|
RemoveAll(path string) error
|
|
|
|
ReadFile(filename string) ([]byte, error)
|
|
|
|
Readlink(name string) (string, error)
|
2024-06-04 06:31:00 +00:00
|
|
|
RawPath(name string) (string, error)
|
2024-12-18 11:15:29 +00:00
|
|
|
ReadDir(dirname string) ([]fs.DirEntry, error)
|
|
|
|
Remove(name string) error
|
|
|
|
OpenFile(name string, flag int, perm fs.FileMode) (*os.File, error)
|
2024-06-04 06:31:00 +00:00
|
|
|
WriteFile(filename string, data []byte, perm os.FileMode) error
|
2024-12-18 11:15:29 +00:00
|
|
|
Rename(oldpath, newpath string) error
|
|
|
|
Truncate(name string, size int64) error
|
|
|
|
Chown(name string, uid, git int) error
|
|
|
|
Chtimes(name string, atime, mtime time.Time) error
|
|
|
|
Glob(pattern string) ([]string, error)
|
|
|
|
Lchown(name string, uid, git int) error
|
|
|
|
Link(oldname, newname string) error
|
|
|
|
PathSeparator() rune
|
|
|
|
Symlink(oldname, newname string) error
|
2023-09-01 12:31:04 +00:00
|
|
|
}
|