Documentation ¶
Index ¶
- Constants
- Variables
- func AppendToFile(ctx *core.Context, args ...core.Value) error
- func Copy(ctx *core.Context, args ...core.Value) error
- func CreateDirInProcessTempDir(namePrefix string) core.Path
- func DeleteDeadProcessTempDirs(logger zerolog.Logger, maxDuration time.Duration)
- func DeleteDirInProcessTempDir(path core.Path) error
- func DeleteProcessTempDir()
- func Exists(ctx *core.Context, pth core.Path) core.Bool
- func Find(ctx *core.Context, dir core.Path, filters ...core.Pattern) (*core.List, error)
- func GetCreateProcessTempDir() core.Path
- func GetCreationAndModifTime(i fs.FileInfo) (time.Time, time.Time, error)
- func GetTreeData(ctx *core.Context, path core.Path) *core.Treedata
- func Glob(ctx *core.Context, patt core.PathPattern) []core.Path
- func IsAppend(flag int) bool
- func IsCreate(flag int) bool
- func IsDir(ctx *core.Context, pth core.Path) core.Bool
- func IsExclusive(flag int) bool
- func IsFile(ctx *core.Context, pth core.Path) core.Bool
- func IsReadAndWrite(flag int) bool
- func IsReadOnly(flag int) bool
- func IsTruncate(flag int) bool
- func ListFiles(ctx *core.Context, pathOrPatt *core.OptionalParam[core.Value]) ([]core.FileInfo, error)
- func Mkdir(ctx *core.Context, dirpath core.Path, ...) error
- func Mkfile(ctx *core.Context, fpath core.Path, args ...core.Value) error
- func NewFilesystemSnapshot(ctx *core.Context, desc *core.Object) *core.FilesystemSnapshotIL
- func NewFsNamespace() *core.Namespace
- func NormalizeAsAbsolute(path string) string
- func Read(ctx *core.Context, path core.Path, args ...core.Value) (result core.Value, finalErr error)
- func ReadDir(ctx *core.Context, pth core.Path) ([]fs.DirEntry, error)
- func ReadEntireFile(ctx *core.Context, fpath core.Path) ([]byte, error)
- func ReadFile(ctx *core.Context, fpath core.Path) (*core.ByteSlice, error)
- func Remove(ctx *core.Context, args ...core.Value) error
- func Rename(ctx *core.Context, old, new core.Path) error
- func ReplaceFileContent(ctx *core.Context, args ...core.Value) error
- type AddressableContentBytes
- type AppendBytesToFile
- func (e *AppendBytesToFile) Apply(ctx *core.Context) error
- func (e AppendBytesToFile) CheckPermissions(ctx *core.Context) error
- func (e AppendBytesToFile) IsApplied() bool
- func (e AppendBytesToFile) IsApplying() bool
- func (e AppendBytesToFile) PermissionKind() core.PermissionKind
- func (e AppendBytesToFile) Resources() []core.ResourceName
- func (e AppendBytesToFile) Reversability(*core.Context) core.Reversability
- func (e AppendBytesToFile) Reverse(ctx *core.Context) error
- type BasicTestSuite
- func (s *BasicTestSuite) TestCreate(c *check.C)
- func (s *BasicTestSuite) TestCreateAndClose(c *check.C)
- func (s *BasicTestSuite) TestCreateDepth(c *check.C)
- func (s *BasicTestSuite) TestCreateDepthAbsolute(c *check.C)
- func (s *BasicTestSuite) TestCreateOverwrite(c *check.C)
- func (s *BasicTestSuite) TestFileCloseTwice(c *check.C)
- func (s *BasicTestSuite) TestFileClosed(c *check.C)
- func (s *BasicTestSuite) TestFileNonRead(c *check.C)
- func (s *BasicTestSuite) TestFileRead(c *check.C)
- func (s *BasicTestSuite) TestFileSeekClosed(c *check.C)
- func (s *BasicTestSuite) TestFileSeekCurrent(c *check.C)
- func (s *BasicTestSuite) TestFileSeekEnd(c *check.C)
- func (s *BasicTestSuite) TestFileSeekstart(c *check.C)
- func (s *BasicTestSuite) TestFileWrite(c *check.C)
- func (s *BasicTestSuite) TestFileWriteClose(c *check.C)
- func (s *BasicTestSuite) TestJoin(c *check.C)
- func (s *BasicTestSuite) TestOpen(c *check.C)
- func (s *BasicTestSuite) TestOpenAndStat(c *check.C)
- func (s *BasicTestSuite) TestOpenAndWrite(c *check.C)
- func (s *BasicTestSuite) TestOpenFile(c *check.C)
- func (s *BasicTestSuite) TestOpenFileAppend(c *check.C)
- func (s *BasicTestSuite) TestOpenFileNoTruncate(c *check.C)
- func (s *BasicTestSuite) TestOpenFileReadAfterRemoval(c *check.C)
- func (s *BasicTestSuite) TestOpenFileReadWrite(c *check.C)
- func (s *BasicTestSuite) TestOpenFileReadWriteAfterRemoval(c *check.C)
- func (s *BasicTestSuite) TestOpenFileWithModes(c *check.C)
- func (s *BasicTestSuite) TestOpenNotExists(c *check.C)
- func (s *BasicTestSuite) TestReadAtEOF(c *check.C)
- func (s *BasicTestSuite) TestReadAtOffset(c *check.C)
- func (s *BasicTestSuite) TestReadAtOnReadOnly(c *check.C)
- func (s *BasicTestSuite) TestReadAtOnReadWrite(c *check.C)
- func (s *BasicTestSuite) TestReadWriteLargeFile(c *check.C)
- func (s *BasicTestSuite) TestRemove(c *check.C)
- func (s *BasicTestSuite) TestRemoveNonExisting(c *check.C)
- func (s *BasicTestSuite) TestRemoveNotEmptyDir(c *check.C)
- func (s *BasicTestSuite) TestRename(c *check.C)
- func (s *BasicTestSuite) TestSeekToEndAndWrite(c *check.C)
- func (s *BasicTestSuite) TestStat(c *check.C)
- func (s *BasicTestSuite) TestStatDeep(c *check.C)
- func (s *BasicTestSuite) TestStatNonExistent(c *check.C)
- func (s *BasicTestSuite) TestTruncate(c *check.C)
- func (s *BasicTestSuite) TestWriteFile(c *check.C)
- type ClosableFilesystem
- type CreateDir
- func (e *CreateDir) Apply(ctx *core.Context) error
- func (e CreateDir) CheckPermissions(ctx *core.Context) error
- func (e CreateDir) IsApplied() bool
- func (e CreateDir) IsApplying() bool
- func (e CreateDir) PermissionKind() core.PermissionKind
- func (e CreateDir) Resources() []core.ResourceName
- func (e CreateDir) Reversability(*core.Context) core.Reversability
- func (e CreateDir) Reverse(ctx *core.Context) error
- type CreateFile
- func (e *CreateFile) Apply(ctx *core.Context) error
- func (e CreateFile) CheckPermissions(ctx *core.Context) error
- func (e CreateFile) IsApplied() bool
- func (e CreateFile) IsApplying() bool
- func (e CreateFile) PermissionKind() core.PermissionKind
- func (e CreateFile) Resources() []core.ResourceName
- func (e CreateFile) Reversability(*core.Context) core.Reversability
- func (e CreateFile) Reverse(ctx *core.Context) error
- type DirTestSuite
- func (s *DirTestSuite) TestCreateFileInDir(c *check.C)
- func (s *DirTestSuite) TestMkdirAll(c *check.C)
- func (s *DirTestSuite) TestMkdirAllAndCreate(c *check.C)
- func (s *DirTestSuite) TestMkdirAllIdempotent(c *check.C)
- func (s *DirTestSuite) TestMkdirAllNested(c *check.C)
- func (s *DirTestSuite) TestMkdirAllWithExistingFile(c *check.C)
- func (s *DirTestSuite) TestOpenDir(c *check.C)
- func (s *DirTestSuite) TestReadDir(c *check.C)
- func (s *DirTestSuite) TestReadDirAfterFileRename(c *check.C)
- func (s *DirTestSuite) TestReadDirFileInfo(c *check.C)
- func (s *DirTestSuite) TestReadDirFileInfoDirs(c *check.C)
- func (s *DirTestSuite) TestReadDirNested(c *check.C)
- func (s *DirTestSuite) TestReadDirWithMkDirAll(c *check.C)
- func (s *DirTestSuite) TestRemoveFileFromDir(c *check.C)
- func (s *DirTestSuite) TestRemoveNonEmptyDir(c *check.C)
- func (s *DirTestSuite) TestRenameDir(c *check.C)
- func (s *DirTestSuite) TestRenameFileInsideDir(c *check.C)
- func (s *DirTestSuite) TestRenameToDir(c *check.C)
- func (s *DirTestSuite) TestStatDir(c *check.C)
- func (s *DirTestSuite) TestStatRootDir(c *check.C)
- type Event
- func (e Event) CreateCoreEvent() *core.Event
- func (e Event) HasChmodOp() bool
- func (e Event) HasCreateOp() bool
- func (e Event) HasRemoveOp() bool
- func (e Event) HasRenameOp() bool
- func (e Event) HasWriteOp() bool
- func (e Event) IsStructureChange() bool
- func (e Event) IsStructureOrContentChange() bool
- func (e Event) Path() core.Path
- func (e Event) Time() core.DateTime
- type File
- func (f *File) Equal(ctx *core.Context, other core.Value, alreadyCompared map[uintptr]uintptr, ...) bool
- func (f *File) GetGoMethod(name string) (*core.GoFunction, bool)
- func (f *File) IsMutable() bool
- func (f *File) PrettyPrint(w *bufio.Writer, config *core.PrettyPrintConfig, depth int, ...)
- func (f *File) Prop(ctx *core.Context, name string) core.Value
- func (*File) PropertyNames(ctx *core.Context) []string
- func (*File) SetProp(ctx *core.Context, name string, value core.Value) error
- func (f *File) ToSymbolicValue(ctx *core.Context, encountered map[uintptr]symbolic.Value) (symbolic.Value, error)
- type FilesystemEventSource
- func (evs *FilesystemEventSource) Close()
- func (evs *FilesystemEventSource) Equal(ctx *core.Context, other core.Value, alreadyCompared map[uintptr]uintptr, ...) bool
- func (evs *FilesystemEventSource) GetFilter() core.PathPattern
- func (evs *FilesystemEventSource) GetGoMethod(name string) (*core.GoFunction, bool)
- func (evs *FilesystemEventSource) GetPath() core.Path
- func (evs *FilesystemEventSource) IsClosed() bool
- func (evs *FilesystemEventSource) IsMutable() bool
- func (evs *FilesystemEventSource) Iterator(ctx *core.Context, config core.IteratorConfiguration) core.Iterator
- func (evs *FilesystemEventSource) PrettyPrint(w *bufio.Writer, config *core.PrettyPrintConfig, depth int, ...)
- func (evs *FilesystemEventSource) Prop(ctx *core.Context, name string) core.Value
- func (*FilesystemEventSource) PropertyNames(ctx *core.Context) []string
- func (*FilesystemEventSource) SetProp(ctx *core.Context, name string, value core.Value) error
- func (evs *FilesystemEventSource) ToSymbolicValue(ctx *core.Context, encountered map[uintptr]symbolic.Value) (symbolic.Value, error)
- type FilesystemIL
- func (fls *FilesystemIL) Equal(ctx *core.Context, other core.Value, alreadyCompared map[uintptr]uintptr, ...) bool
- func (evs *FilesystemIL) IsMutable() bool
- func (fls *FilesystemIL) PrettyPrint(w *bufio.Writer, config *core.PrettyPrintConfig, depth int, ...)
- func (evs *FilesystemIL) ToSymbolicValue(ctx *core.Context, encountered map[uintptr]symbolic.Value) (symbolic.Value, error)
- type GenericBasic
- func (i GenericBasic) Create(filename string) (afs.File, error)
- func (i GenericBasic) Join(elem ...string) string
- func (i GenericBasic) Open(filename string) (afs.File, error)
- func (i GenericBasic) OpenFile(filename string, flag int, perm os.FileMode) (afs.File, error)
- func (i GenericBasic) Remove(filename string) error
- func (i GenericBasic) Rename(oldpath, newpath string) error
- func (i GenericBasic) Stat(filename string) (os.FileInfo, error)
- type GenericFile
- func (f *GenericFile) Close() error
- func (f *GenericFile) Lock() error
- func (f *GenericFile) Name() string
- func (f *GenericFile) Read(p []byte) (n int, err error)
- func (f *GenericFile) ReadAt(p []byte, off int64) (n int, err error)
- func (f *GenericFile) Seek(offset int64, whence int) (int64, error)
- func (f *GenericFile) Truncate(size int64) error
- func (f *GenericFile) Unlock() error
- func (f *GenericFile) Write(p []byte) (n int, err error)
- type InMemFileContent
- func (c *InMemFileContent) IsDirty() bool
- func (c *InMemFileContent) Len() int
- func (c *InMemFileContent) ModifTime() time.Time
- func (c *InMemFileContent) Persist(persistFn func(p []byte) error) (finalErr error)
- func (c *InMemFileContent) ReadAt(b []byte, off int64) (n int, err error)
- func (c *InMemFileContent) ShouldBePersisted() bool
- func (c *InMemFileContent) Truncate(size int64) error
- func (c *InMemFileContent) WriteAt(p []byte, off int64) (int, error)
- type InMemfile
- func (f *InMemfile) Close() error
- func (f *InMemfile) Duplicate(originalPath string, mode os.FileMode, flag int) billy.File
- func (f *InMemfile) FileInfo() core.FileInfo
- func (f *InMemfile) FileInfoContentNotLocked() core.FileInfo
- func (f *InMemfile) Lock() error
- func (f *InMemfile) Name() string
- func (f *InMemfile) Read(b []byte) (int, error)
- func (f *InMemfile) ReadAt(b []byte, off int64) (int, error)
- func (f *InMemfile) Seek(offset int64, whence int) (int64, error)
- func (f *InMemfile) Stat() (os.FileInfo, error)
- func (*InMemfile) Sync() error
- func (f *InMemfile) Truncate(size int64) error
- func (f *InMemfile) Unlock() error
- func (f *InMemfile) Write(p []byte) (int, error)
- type InMemorySnapshot
- func (s *InMemorySnapshot) Content(path string) (core.AddressableContent, error)
- func (s *InMemorySnapshot) ForEachEntry(fn func(m core.EntrySnapshotMetadata) error) error
- func (s *InMemorySnapshot) IsStoredLocally() bool
- func (s *InMemorySnapshot) Metadata(path string) (core.EntrySnapshotMetadata, error)
- func (s *InMemorySnapshot) NewAdaptedFilesystem(maxTotalStorageSizeHint core.ByteCount) (core.SnapshotableFilesystem, error)
- func (s *InMemorySnapshot) RootDirEntries() []string
- func (s *InMemorySnapshot) WriteTo(fls afs.Filesystem, params core.SnapshotWriteToFilesystem) error
- type MemFilesystem
- func (fs *MemFilesystem) Absolute(path string) (string, error)
- func (fs *MemFilesystem) Capabilities() billy.Capability
- func (fs *MemFilesystem) Chroot(path string) (billy.Filesystem, error)
- func (fls *MemFilesystem) Close(ctx *core.Context) error
- func (fs *MemFilesystem) Create(filename string) (billy.File, error)
- func (fls *MemFilesystem) Events() *memds.TSArrayQueue[Event]
- func (fls *MemFilesystem) GetWatchers() []*VirtualFilesystemWatcher
- func (fs *MemFilesystem) Join(elem ...string) string
- func (fs *MemFilesystem) Lstat(filename string) (os.FileInfo, error)
- func (fs *MemFilesystem) MkdirAll(path string, perm os.FileMode) error
- func (fs *MemFilesystem) Open(filename string) (billy.File, error)
- func (fs *MemFilesystem) OpenFile(filename string, flag int, perm os.FileMode) (billy.File, error)
- func (fs *MemFilesystem) ReadDir(path string) ([]os.FileInfo, error)
- func (fs *MemFilesystem) Readlink(link string) (string, error)
- func (fs *MemFilesystem) Remove(filename string) error
- func (fs *MemFilesystem) Rename(from, to string) error
- func (fs *MemFilesystem) Root() string
- func (fs *MemFilesystem) Stat(filename string) (os.FileInfo, error)
- func (fs *MemFilesystem) Symlink(target, link string) error
- func (fs *MemFilesystem) TakeFilesystemSnapshot(config core.FilesystemSnapshotConfig) (core.FilesystemSnapshot, error)
- func (fs *MemFilesystem) TempFile(dir, prefix string) (billy.File, error)
- func (fls *MemFilesystem) Watcher(evs *FilesystemEventSource) *VirtualFilesystemWatcher
- type MetaFilesystem
- func (fls *MetaFilesystem) Absolute(path string) (string, error)
- func (fls *MetaFilesystem) Chroot(path string) (billy.Filesystem, error)
- func (fls *MetaFilesystem) Close(ctx *core.Context) error
- func (fls *MetaFilesystem) Create(filename string) (billy.File, error)
- func (fls *MetaFilesystem) DoWithContext(ctx *core.Context, fn func() error) error
- func (fls *MetaFilesystem) Events() *memds.TSArrayQueue[Event]
- func (fls *MetaFilesystem) GetWatchers() []*VirtualFilesystemWatcher
- func (fls *MetaFilesystem) Join(elem ...string) string
- func (fls *MetaFilesystem) Lstat(filename string) (os.FileInfo, error)
- func (fls *MetaFilesystem) MkdirAll(path string, perm os.FileMode) error
- func (fls *MetaFilesystem) MkdirAllNoLock(path string, perm os.FileMode) error
- func (fls *MetaFilesystem) MkdirAllNoLock_(path string, perm os.FileMode, tx *buntdb.Tx) error
- func (fls *MetaFilesystem) Open(filename string) (billy.File, error)
- func (fls *MetaFilesystem) OpenFile(filename string, flag int, perm os.FileMode) (billy.File, error)
- func (fls *MetaFilesystem) ReadDir(path string) ([]os.FileInfo, error)
- func (fls *MetaFilesystem) Readlink(link string) (string, error)
- func (fls *MetaFilesystem) Remove(filename string) error
- func (fls *MetaFilesystem) Rename(from, to string) error
- func (fls *MetaFilesystem) Root() string
- func (fls *MetaFilesystem) Stat(filename string) (os.FileInfo, error)
- func (fls *MetaFilesystem) Symlink(target, link string) error
- func (fls *MetaFilesystem) TakeFilesystemSnapshot(config core.FilesystemSnapshotConfig) (core.FilesystemSnapshot, error)
- func (fls *MetaFilesystem) TempFile(dir, prefix string) (billy.File, error)
- func (fls *MetaFilesystem) Walk(...) error
- func (fls *MetaFilesystem) Watcher(evs *FilesystemEventSource) *VirtualFilesystemWatcher
- type MetaFilesystemParams
- type OsFilesystem
- func (fs OsFilesystem) Absolute(path string) (string, error)
- func (fs OsFilesystem) Chroot(path string) (billy.Filesystem, error)
- func (fs *OsFilesystem) Create(filename string) (billy.File, error)
- func (fs *OsFilesystem) Lstat(filename string) (fs.FileInfo, error)
- func (fs *OsFilesystem) MkdirAll(filename string, perm fs.FileMode) error
- func (fs *OsFilesystem) Open(filename string) (billy.File, error)
- func (fs *OsFilesystem) OpenFile(filename string, flag int, perm fs.FileMode) (billy.File, error)
- func (fs *OsFilesystem) OsFs()
- func (fs *OsFilesystem) ReadDir(path string) ([]fs.FileInfo, error)
- func (fs *OsFilesystem) Readlink(link string) (string, error)
- func (fs *OsFilesystem) Remove(filename string) error
- func (fs *OsFilesystem) Rename(from, to string) error
- func (fs OsFilesystem) Root() string
- func (fs *OsFilesystem) Stat(filename string) (fs.FileInfo, error)
- func (fs *OsFilesystem) Symlink(target string, link string) error
- func (fs *OsFilesystem) TempFile(dir string, prefix string) (billy.File, error)
- func (fs *OsFilesystem) WithSecondaryContext(ctx *core.Context) any
- func (fs *OsFilesystem) WithoutSecondaryContext() any
- type RemoveFile
- func (e *RemoveFile) Apply(ctx *core.Context) (finalErr error)
- func (e RemoveFile) CheckPermissions(ctx *core.Context) error
- func (e RemoveFile) IsApplied() bool
- func (e RemoveFile) IsApplying() bool
- func (e RemoveFile) PermissionKind() core.PermissionKind
- func (e RemoveFile) Resources() []core.ResourceName
- func (e RemoveFile) Reversability(*core.Context) core.Reversability
- func (e *RemoveFile) Reverse(ctx *core.Context) error
- type RenameFile
- func (e *RenameFile) Apply(ctx *core.Context) error
- func (e RenameFile) CheckPermissions(ctx *core.Context) error
- func (e RenameFile) IsApplied() bool
- func (e RenameFile) IsApplying() bool
- func (e RenameFile) PermissionKind() core.PermissionKind
- func (e RenameFile) Resources() []core.ResourceName
- func (e RenameFile) Reversability(*core.Context) core.Reversability
- func (e RenameFile) Reverse(ctx *core.Context) error
- type SortableFileInfo
- type VirtualFilesystemWatcher
- type WatchableVirtualFilesystem
Constants ¶
const ( FS_WRITE_LIMIT_NAME = "fs/write" FS_READ_LIMIT_NAME = "fs/read" FS_TOTAL_NEW_FILE_LIMIT_NAME = "fs/total-new-files" FS_NEW_FILE_RATE_LIMIT_NAME = "fs/create-file" FS_WRITE_MIN_CHUNK_SIZE = 100_000 FS_READ_MIN_CHUNK_SIZE = 1_000_000 DEFAULT_R_FILE_FMODE = fs.FileMode(0o400) DEFAULT_FILE_FMODE = fs.FileMode(0o600) DEFAULT_DIR_FMODE = fs.FileMode(0o700) )
const ( METAFS_UNDERLYING_FILE_PROPNAME = "underlying-file" METAFS_FILE_MODE_PROPNAME = "file-mode" METAFS_CREATION_TIME_PROPNAME = "creation-time" METAFS_MODIF_TIME_PROPNAME = "modification-time" METAFS_SYMLINK_TARGET_PROPNAME = "symlink-target" METAFS_CHILDREN_PROPNAME = "children" METAFS_UNDERLYING_UNDERLYING_FILE_PERM = 0600 METAFS_AUTO_CREATED_DIR_PERM = fs.FileMode(0700) METAFS_FILES_KEY = "/files" METAFS_KV_FILENAME = "metadata.kv" METAFS_MIN_USABLE_SPACE = 10_000_000 METAFS_USED_SPACE_CHECK_INTERVAL = time.Second / 2 METAFS_ALWAYS_CHECK_USED_SPACE_BYTE_COUNT_THRESHOLD = 100_000 METAFS_DEFAULT_MAX_FILE_COUNT = 1000 METAFS_DEFAULT_MAX_PARALLEL_FILE_CREATION_COUNT = 10 METAFS_MAX_SNAPSHOTABLE_SIZE = core.ByteCount(100_000_000) METAFS_DEFAULT_MAX_UNTRACK_CLOSED_FILE_COUNT = 10 )
const ( MAX_SMALL_CHANGE_SIZE = 1000 //byte count META_FS_FILE_SNAPSHOTING_WAIT_TIMEOUT = 100 * time.Millisecond )
const ( WATCHER_MANAGEMENT_TICK_INTERVAL = 25 * time.Millisecond OLD_EVENT_MIN_AGE = max(50*time.Millisecond, 2*WATCHER_MANAGEMENT_TICK_INTERVAL) )
const (
FS_SNAPSHOT_SYMB_DESC_FILES_PROPNAME = "files"
)
const (
MAX_FILE_HIERARCHY_DEPTH = 5
)
const (
PROCESS_TEMP_DIR_PREFIX = "inoxlangprocess"
)
const (
TRUE_MAX_IN_MEM_STORAGE = core.ByteCount(100_000_000)
)
Variables ¶
var ( ErrCannotOpenDir = errors.New("cannot open directory") ErrClosedFilesystem = errors.New("closed filesystem") ErrMaxFileNumberAlreadyReached = errors.New("the maximum number of files in the filesystem has already been reached") ErrTooManyParallelFileCreation = errors.New("too many files are being created in parallel") ErrNoRemainingSpaceUsableByFS = errors.New("no remaining space usable by filesystem") ErrNoRemainingSpaceToApplyChange = errors.New("no remaining space to apply change") ErrMaxUsableSpaceTooSmall = errors.New("the given usable space value is too small") )
var ( ErrTooDeepFileHierarchy = errors.New("file hierarchy is too deep") MKDIR_ARG_NAMES = []string{"dirpath", "content"} MKDIR_SYMB_PARAMS = &[]symbolic.Value{symbolic.ANY_DIR_PATH, symbolic.ANY_DICT} MKFILE_ARG_NAMES = []string{"filepath", "content"} MKFILE_SYMB_PARAMS = &[]symbolic.Value{symbolic.ANY_NON_DIR_PATH, symbolic.ANY_READABLE} )
var ( READFILE_ARG_NAMES = []string{"filepath"} READFILE_SYMB_PARAMS = &[]symbolic.Value{symbolic.ANY_DIR_PATH} LISTFILES_ARG_NAMES = []string{"path-or-pattern"} LISTFILES_SYMB_PARAMS = &[]symbolic.Value{symbolic.NewMultivalue(symbolic.ANY_PATH, symbolic.ANY_PATH_PATTERN)} )
var ( NEW_FS_SNAPSHOT_DESC = symbolic.NewInexactObject2(map[string]symbolic.Serializable{ FS_SNAPSHOT_SYMB_DESC_FILES_PROPNAME: symbolic.ANY_DICT, }) NEW_FS_SNAPSHOT_SYMB_ARGS = &[]symbolic.Value{NEW_FS_SNAPSHOT_DESC} NEW_FS_SNAPSHOT_SYMB_ARG_NAMES = []string{"description"} ErrFileBeingSnapshoted = errors.New("file is being snapshoted") )
var (
ErrInMemoryStorageLimitExceededDuringWrite = errors.New("in-memory file storage limit exceeded during write operation")
)
var (
ErrOsFilesystemNotAvailable = errors.New("os filesystem not available")
)
var (
ErrTimeInfoNotAvailable = errors.New("time information of file is not available")
)
var (
REQUIRED_METAFS_FILE_METADATA_PROPNAMES = []string{METAFS_FILE_MODE_PROPNAME, METAFS_CREATION_TIME_PROPNAME, METAFS_MODIF_TIME_PROPNAME}
)
Functions ¶
func Copy ¶
Copy copy a single file or copy a list of files in destination directory. arguments: ./src ./copy -> copy the ./src file into ./copy that SHOULD NOT exist. arguments [./file, ./dir] ./dest_dir -> copy the provided files into ./dest_dir. Copy never overwrites a file or directory and returns an error if there is already a file at any destination path.
func CreateDirInProcessTempDir ¶
CreateTempdir creates a directory with permissions o700 in the process's temporary directory in the OS's filesystem. The process's temporary directory is created if necessary.
func DeleteProcessTempDir ¶
func DeleteProcessTempDir()
func GetCreateProcessTempDir ¶
func GetCreationAndModifTime ¶
GetCreationAndModifTime returns the creation time & content modification time.
func Glob ¶
Glob is the implementation of the fs.glob function, it calls the internal glob function.
func IsExclusive ¶
func IsReadAndWrite ¶
func IsReadOnly ¶
func IsTruncate ¶
func Mkdir ¶
func Mkdir(ctx *core.Context, dirpath core.Path, content *core.OptionalParam[*core.Dictionary]) error
Mkdir expects a core.Path argument and creates a directory. If a dictionary is passed a file hiearchy will also be created.
func Mkfile ¶
Mkfile creates a regular file, if an additional argument is passed it will be used as the content of the file.
func NewFilesystemSnapshot ¶
func NewFsNamespace ¶
func NormalizeAsAbsolute ¶
Types ¶
type AddressableContentBytes ¶
func (AddressableContentBytes) ChecksumSHA256 ¶
func (b AddressableContentBytes) ChecksumSHA256() [32]byte
func (AddressableContentBytes) Reader ¶
func (b AddressableContentBytes) Reader() io.Reader
type AppendBytesToFile ¶
type AppendBytesToFile struct {
// contains filtered or unexported fields
}
func (AppendBytesToFile) CheckPermissions ¶
func (e AppendBytesToFile) CheckPermissions(ctx *core.Context) error
func (AppendBytesToFile) IsApplied ¶
func (e AppendBytesToFile) IsApplied() bool
func (AppendBytesToFile) IsApplying ¶
func (e AppendBytesToFile) IsApplying() bool
func (AppendBytesToFile) PermissionKind ¶
func (e AppendBytesToFile) PermissionKind() core.PermissionKind
func (AppendBytesToFile) Resources ¶
func (e AppendBytesToFile) Resources() []core.ResourceName
func (AppendBytesToFile) Reversability ¶
func (e AppendBytesToFile) Reversability(*core.Context) core.Reversability
type BasicTestSuite ¶
BasicTestSuite is a convenient test suite to validate any implementation of billy.Basic
func (*BasicTestSuite) TestCreate ¶
func (s *BasicTestSuite) TestCreate(c *check.C)
func (*BasicTestSuite) TestCreateAndClose ¶
func (s *BasicTestSuite) TestCreateAndClose(c *check.C)
func (*BasicTestSuite) TestCreateDepth ¶
func (s *BasicTestSuite) TestCreateDepth(c *check.C)
func (*BasicTestSuite) TestCreateDepthAbsolute ¶
func (s *BasicTestSuite) TestCreateDepthAbsolute(c *check.C)
func (*BasicTestSuite) TestCreateOverwrite ¶
func (s *BasicTestSuite) TestCreateOverwrite(c *check.C)
func (*BasicTestSuite) TestFileCloseTwice ¶
func (s *BasicTestSuite) TestFileCloseTwice(c *check.C)
func (*BasicTestSuite) TestFileClosed ¶
func (s *BasicTestSuite) TestFileClosed(c *check.C)
func (*BasicTestSuite) TestFileNonRead ¶
func (s *BasicTestSuite) TestFileNonRead(c *check.C)
func (*BasicTestSuite) TestFileRead ¶
func (s *BasicTestSuite) TestFileRead(c *check.C)
func (*BasicTestSuite) TestFileSeekClosed ¶
func (s *BasicTestSuite) TestFileSeekClosed(c *check.C)
func (*BasicTestSuite) TestFileSeekCurrent ¶
func (s *BasicTestSuite) TestFileSeekCurrent(c *check.C)
func (*BasicTestSuite) TestFileSeekEnd ¶
func (s *BasicTestSuite) TestFileSeekEnd(c *check.C)
func (*BasicTestSuite) TestFileSeekstart ¶
func (s *BasicTestSuite) TestFileSeekstart(c *check.C)
func (*BasicTestSuite) TestFileWrite ¶
func (s *BasicTestSuite) TestFileWrite(c *check.C)
func (*BasicTestSuite) TestFileWriteClose ¶
func (s *BasicTestSuite) TestFileWriteClose(c *check.C)
func (*BasicTestSuite) TestJoin ¶
func (s *BasicTestSuite) TestJoin(c *check.C)
func (*BasicTestSuite) TestOpen ¶
func (s *BasicTestSuite) TestOpen(c *check.C)
func (*BasicTestSuite) TestOpenAndStat ¶
func (s *BasicTestSuite) TestOpenAndStat(c *check.C)
func (*BasicTestSuite) TestOpenAndWrite ¶
func (s *BasicTestSuite) TestOpenAndWrite(c *check.C)
func (*BasicTestSuite) TestOpenFile ¶
func (s *BasicTestSuite) TestOpenFile(c *check.C)
func (*BasicTestSuite) TestOpenFileAppend ¶
func (s *BasicTestSuite) TestOpenFileAppend(c *check.C)
func (*BasicTestSuite) TestOpenFileNoTruncate ¶
func (s *BasicTestSuite) TestOpenFileNoTruncate(c *check.C)
func (*BasicTestSuite) TestOpenFileReadAfterRemoval ¶
func (s *BasicTestSuite) TestOpenFileReadAfterRemoval(c *check.C)
func (*BasicTestSuite) TestOpenFileReadWrite ¶
func (s *BasicTestSuite) TestOpenFileReadWrite(c *check.C)
func (*BasicTestSuite) TestOpenFileReadWriteAfterRemoval ¶
func (s *BasicTestSuite) TestOpenFileReadWriteAfterRemoval(c *check.C)
func (*BasicTestSuite) TestOpenFileWithModes ¶
func (s *BasicTestSuite) TestOpenFileWithModes(c *check.C)
func (*BasicTestSuite) TestOpenNotExists ¶
func (s *BasicTestSuite) TestOpenNotExists(c *check.C)
func (*BasicTestSuite) TestReadAtEOF ¶
func (s *BasicTestSuite) TestReadAtEOF(c *check.C)
func (*BasicTestSuite) TestReadAtOffset ¶
func (s *BasicTestSuite) TestReadAtOffset(c *check.C)
func (*BasicTestSuite) TestReadAtOnReadOnly ¶
func (s *BasicTestSuite) TestReadAtOnReadOnly(c *check.C)
func (*BasicTestSuite) TestReadAtOnReadWrite ¶
func (s *BasicTestSuite) TestReadAtOnReadWrite(c *check.C)
func (*BasicTestSuite) TestReadWriteLargeFile ¶
func (s *BasicTestSuite) TestReadWriteLargeFile(c *check.C)
func (*BasicTestSuite) TestRemove ¶
func (s *BasicTestSuite) TestRemove(c *check.C)
func (*BasicTestSuite) TestRemoveNonExisting ¶
func (s *BasicTestSuite) TestRemoveNonExisting(c *check.C)
func (*BasicTestSuite) TestRemoveNotEmptyDir ¶
func (s *BasicTestSuite) TestRemoveNotEmptyDir(c *check.C)
func (*BasicTestSuite) TestRename ¶
func (s *BasicTestSuite) TestRename(c *check.C)
func (*BasicTestSuite) TestSeekToEndAndWrite ¶
func (s *BasicTestSuite) TestSeekToEndAndWrite(c *check.C)
func (*BasicTestSuite) TestStat ¶
func (s *BasicTestSuite) TestStat(c *check.C)
func (*BasicTestSuite) TestStatDeep ¶
func (s *BasicTestSuite) TestStatDeep(c *check.C)
func (*BasicTestSuite) TestStatNonExistent ¶
func (s *BasicTestSuite) TestStatNonExistent(c *check.C)
func (*BasicTestSuite) TestTruncate ¶
func (s *BasicTestSuite) TestTruncate(c *check.C)
func (*BasicTestSuite) TestWriteFile ¶
func (s *BasicTestSuite) TestWriteFile(c *check.C)
type ClosableFilesystem ¶
type ClosableFilesystem interface { afs.Filesystem Close(ctx *core.Context) error }
type CreateDir ¶
type CreateDir struct {
// contains filtered or unexported fields
}
func (CreateDir) IsApplying ¶
func (CreateDir) PermissionKind ¶
func (e CreateDir) PermissionKind() core.PermissionKind
func (CreateDir) Resources ¶
func (e CreateDir) Resources() []core.ResourceName
func (CreateDir) Reversability ¶
func (e CreateDir) Reversability(*core.Context) core.Reversability
type CreateFile ¶
type CreateFile struct {
// contains filtered or unexported fields
}
func (CreateFile) CheckPermissions ¶
func (e CreateFile) CheckPermissions(ctx *core.Context) error
func (CreateFile) IsApplied ¶
func (e CreateFile) IsApplied() bool
func (CreateFile) IsApplying ¶
func (e CreateFile) IsApplying() bool
func (CreateFile) PermissionKind ¶
func (e CreateFile) PermissionKind() core.PermissionKind
func (CreateFile) Resources ¶
func (e CreateFile) Resources() []core.ResourceName
func (CreateFile) Reversability ¶
func (e CreateFile) Reversability(*core.Context) core.Reversability
type DirTestSuite ¶
DirTestSuite is a convenient test suite to validate any implementation of billy.Dir
func (*DirTestSuite) TestCreateFileInDir ¶
func (s *DirTestSuite) TestCreateFileInDir(c *check.C)
func (*DirTestSuite) TestMkdirAll ¶
func (s *DirTestSuite) TestMkdirAll(c *check.C)
func (*DirTestSuite) TestMkdirAllAndCreate ¶
func (s *DirTestSuite) TestMkdirAllAndCreate(c *check.C)
func (*DirTestSuite) TestMkdirAllIdempotent ¶
func (s *DirTestSuite) TestMkdirAllIdempotent(c *check.C)
func (*DirTestSuite) TestMkdirAllNested ¶
func (s *DirTestSuite) TestMkdirAllNested(c *check.C)
func (*DirTestSuite) TestMkdirAllWithExistingFile ¶
func (s *DirTestSuite) TestMkdirAllWithExistingFile(c *check.C)
func (*DirTestSuite) TestOpenDir ¶
func (s *DirTestSuite) TestOpenDir(c *check.C)
func (*DirTestSuite) TestReadDir ¶
func (s *DirTestSuite) TestReadDir(c *check.C)
func (*DirTestSuite) TestReadDirAfterFileRename ¶
func (s *DirTestSuite) TestReadDirAfterFileRename(c *check.C)
func (*DirTestSuite) TestReadDirFileInfo ¶
func (s *DirTestSuite) TestReadDirFileInfo(c *check.C)
func (*DirTestSuite) TestReadDirFileInfoDirs ¶
func (s *DirTestSuite) TestReadDirFileInfoDirs(c *check.C)
func (*DirTestSuite) TestReadDirNested ¶
func (s *DirTestSuite) TestReadDirNested(c *check.C)
func (*DirTestSuite) TestReadDirWithMkDirAll ¶
func (s *DirTestSuite) TestReadDirWithMkDirAll(c *check.C)
func (*DirTestSuite) TestRemoveFileFromDir ¶
func (s *DirTestSuite) TestRemoveFileFromDir(c *check.C)
func (*DirTestSuite) TestRemoveNonEmptyDir ¶
func (s *DirTestSuite) TestRemoveNonEmptyDir(c *check.C)
func (*DirTestSuite) TestRenameDir ¶
func (s *DirTestSuite) TestRenameDir(c *check.C)
func (*DirTestSuite) TestRenameFileInsideDir ¶
func (s *DirTestSuite) TestRenameFileInsideDir(c *check.C)
func (*DirTestSuite) TestRenameToDir ¶
func (s *DirTestSuite) TestRenameToDir(c *check.C)
func (*DirTestSuite) TestStatDir ¶
func (s *DirTestSuite) TestStatDir(c *check.C)
func (*DirTestSuite) TestStatRootDir ¶
func (s *DirTestSuite) TestStatRootDir(c *check.C)
type Event ¶
type Event struct {
// contains filtered or unexported fields
}
func (Event) CreateCoreEvent ¶
func (Event) HasChmodOp ¶
func (Event) HasCreateOp ¶
func (Event) HasRemoveOp ¶
func (Event) HasRenameOp ¶
func (Event) HasWriteOp ¶
func (Event) IsStructureChange ¶
IsStructureChange() returns true if e.HasCreateOp() || e.HasRenameOp() || e.HasRemoveOp()
func (Event) IsStructureOrContentChange ¶
IsStructureOrContentChange() returns true if e.HasCreateOp() || e.HasRenameOp() || e.HasRemoveOp() || e.HasWriteOp()
type File ¶
type File struct {
// contains filtered or unexported fields
}
func OpenExisting ¶
OpenExisting is the implementation of fs.open, it calls the internal openExistingFile function.
func (*File) GetGoMethod ¶
func (f *File) GetGoMethod(name string) (*core.GoFunction, bool)
func (*File) PrettyPrint ¶
type FilesystemEventSource ¶
type FilesystemEventSource struct { core.EventSourceBase // contains filtered or unexported fields }
func NewEventSource ¶
func NewEventSource(ctx *core.Context, resourceNameOrPattern core.Value) (*FilesystemEventSource, error)
NewEventSource calls NewEventSourceWithFilesystem with ctx's filesystem.
func NewEventSourceWithFilesystem ¶
func NewEventSourceWithFilesystem(ctx *core.Context, fls afs.Filesystem, resourceNameOrPattern core.Value) (*FilesystemEventSource, error)
func (*FilesystemEventSource) Close ¶
func (evs *FilesystemEventSource) Close()
func (*FilesystemEventSource) GetFilter ¶
func (evs *FilesystemEventSource) GetFilter() core.PathPattern
func (*FilesystemEventSource) GetGoMethod ¶
func (evs *FilesystemEventSource) GetGoMethod(name string) (*core.GoFunction, bool)
func (*FilesystemEventSource) GetPath ¶
func (evs *FilesystemEventSource) GetPath() core.Path
func (*FilesystemEventSource) IsClosed ¶
func (evs *FilesystemEventSource) IsClosed() bool
func (*FilesystemEventSource) IsMutable ¶
func (evs *FilesystemEventSource) IsMutable() bool
func (*FilesystemEventSource) Iterator ¶
func (evs *FilesystemEventSource) Iterator(ctx *core.Context, config core.IteratorConfiguration) core.Iterator
func (*FilesystemEventSource) PrettyPrint ¶
func (evs *FilesystemEventSource) PrettyPrint(w *bufio.Writer, config *core.PrettyPrintConfig, depth int, parentIndentCount int)
func (*FilesystemEventSource) PropertyNames ¶
func (*FilesystemEventSource) PropertyNames(ctx *core.Context) []string
type FilesystemIL ¶
type FilesystemIL struct {
afs.Filesystem
}
func NewMemFilesystemIL ¶
func NewMemFilesystemIL(maxTotalStorageSize core.ByteCount) *FilesystemIL
func (*FilesystemIL) IsMutable ¶
func (evs *FilesystemIL) IsMutable() bool
func (*FilesystemIL) PrettyPrint ¶
func (fls *FilesystemIL) PrettyPrint(w *bufio.Writer, config *core.PrettyPrintConfig, depth int, parentIndentCount int)
type GenericBasic ¶
type GenericBasic struct { CreateFn func(filename string) (afs.File, error) OpenFn func(filename string) (afs.File, error) OpenFileFn func(filename string, flag int, perm os.FileMode) (afs.File, error) StatFn func(filename string) (os.FileInfo, error) RenameFn func(oldpath, newpath string) error RemoveFn func(filename string) error JoinFn func(elem ...string) string }
GenericBasic is an implementation of billy.Basic. All the fields are optional: for example if .CreateFn is not provided the Create method will always return billy.ErrNotSupported.
func (GenericBasic) Join ¶
func (i GenericBasic) Join(elem ...string) string
func (GenericBasic) Remove ¶
func (i GenericBasic) Remove(filename string) error
func (GenericBasic) Rename ¶
func (i GenericBasic) Rename(oldpath, newpath string) error
type GenericFile ¶
type GenericFile struct { Filename string WriteFn func(p []byte) (n int, err error) ReadFn func(p []byte) (n int, err error) ReadAtFn func(p []byte, off int64) (n int, err error) SeekFn func(offset int64, whence int) (int64, error) CloseFn func() error LockFn func() error UnlockFn func() error TruncateFn func(size int64) error }
GenericFile is an implementation of billy.File. All the fields are optional: for example if .WriteFn is not provided the Write method will always return billy.ErrNotSupported.
func (*GenericFile) Close ¶
func (f *GenericFile) Close() error
func (*GenericFile) Lock ¶
func (f *GenericFile) Lock() error
func (*GenericFile) Name ¶
func (f *GenericFile) Name() string
func (*GenericFile) Truncate ¶
func (f *GenericFile) Truncate(size int64) error
func (*GenericFile) Unlock ¶
func (f *GenericFile) Unlock() error
type InMemFileContent ¶
type InMemFileContent struct {
// contains filtered or unexported fields
}
func NewInMemFileContent ¶
func (*InMemFileContent) IsDirty ¶
func (c *InMemFileContent) IsDirty() bool
func (*InMemFileContent) Len ¶
func (c *InMemFileContent) Len() int
func (*InMemFileContent) ModifTime ¶
func (c *InMemFileContent) ModifTime() time.Time
func (*InMemFileContent) Persist ¶
func (c *InMemFileContent) Persist(persistFn func(p []byte) error) (finalErr error)
If the file is not dirty Persist snapshots the content of the file & invokes persistFn, if persistFn returns an error or panics an error is returned.
func (*InMemFileContent) ReadAt ¶
func (c *InMemFileContent) ReadAt(b []byte, off int64) (n int, err error)
func (*InMemFileContent) ShouldBePersisted ¶
func (c *InMemFileContent) ShouldBePersisted() bool
ShouldBePersisted returns true if the content is dirty AND is not being persisted.
func (*InMemFileContent) Truncate ¶
func (c *InMemFileContent) Truncate(size int64) error
type InMemfile ¶
type InMemfile struct {
// contains filtered or unexported fields
}
func (*InMemfile) FileInfoContentNotLocked ¶
type InMemorySnapshot ¶
type InMemorySnapshot struct { MetadataMap map[string]*core.EntrySnapshotMetadata FileContents map[string]core.AddressableContent }
An InMemorySnapshot is an implementation of FilesystemSnapshot that stores all the data & metadata in memory.
func (*InMemorySnapshot) Content ¶
func (s *InMemorySnapshot) Content(path string) (core.AddressableContent, error)
func (*InMemorySnapshot) ForEachEntry ¶
func (s *InMemorySnapshot) ForEachEntry(fn func(m core.EntrySnapshotMetadata) error) error
func (*InMemorySnapshot) IsStoredLocally ¶
func (s *InMemorySnapshot) IsStoredLocally() bool
func (*InMemorySnapshot) Metadata ¶
func (s *InMemorySnapshot) Metadata(path string) (core.EntrySnapshotMetadata, error)
func (*InMemorySnapshot) NewAdaptedFilesystem ¶
func (s *InMemorySnapshot) NewAdaptedFilesystem(maxTotalStorageSizeHint core.ByteCount) (core.SnapshotableFilesystem, error)
func (*InMemorySnapshot) RootDirEntries ¶
func (s *InMemorySnapshot) RootDirEntries() []string
func (*InMemorySnapshot) WriteTo ¶
func (s *InMemorySnapshot) WriteTo(fls afs.Filesystem, params core.SnapshotWriteToFilesystem) error
type MemFilesystem ¶
type MemFilesystem struct {
// contains filtered or unexported fields
}
func NewMemFilesystem ¶
func NewMemFilesystem(maxTotalStorageSize core.ByteCount) *MemFilesystem
func NewMemFilesystemFromSnapshot ¶
func NewMemFilesystemFromSnapshot(snapshot core.FilesystemSnapshot, maxTotalStorageSize core.ByteCount) *MemFilesystem
func (*MemFilesystem) Capabilities ¶
func (fs *MemFilesystem) Capabilities() billy.Capability
Capabilities implements the Capable interface.
func (*MemFilesystem) Chroot ¶
func (fs *MemFilesystem) Chroot(path string) (billy.Filesystem, error)
func (*MemFilesystem) Create ¶
func (fs *MemFilesystem) Create(filename string) (billy.File, error)
func (*MemFilesystem) Events ¶
func (fls *MemFilesystem) Events() *memds.TSArrayQueue[Event]
func (*MemFilesystem) GetWatchers ¶
func (fls *MemFilesystem) GetWatchers() []*VirtualFilesystemWatcher
func (*MemFilesystem) Join ¶
func (fs *MemFilesystem) Join(elem ...string) string
func (*MemFilesystem) MkdirAll ¶
func (fs *MemFilesystem) MkdirAll(path string, perm os.FileMode) error
func (*MemFilesystem) Open ¶
func (fs *MemFilesystem) Open(filename string) (billy.File, error)
func (*MemFilesystem) ReadDir ¶
func (fs *MemFilesystem) ReadDir(path string) ([]os.FileInfo, error)
func (*MemFilesystem) Remove ¶
func (fs *MemFilesystem) Remove(filename string) error
func (*MemFilesystem) Rename ¶
func (fs *MemFilesystem) Rename(from, to string) error
func (*MemFilesystem) Root ¶
func (fs *MemFilesystem) Root() string
func (*MemFilesystem) Symlink ¶
func (fs *MemFilesystem) Symlink(target, link string) error
func (*MemFilesystem) TakeFilesystemSnapshot ¶
func (fs *MemFilesystem) TakeFilesystemSnapshot(config core.FilesystemSnapshotConfig) (core.FilesystemSnapshot, error)
func (*MemFilesystem) TempFile ¶
func (fs *MemFilesystem) TempFile(dir, prefix string) (billy.File, error)
func (*MemFilesystem) Watcher ¶
func (fls *MemFilesystem) Watcher(evs *FilesystemEventSource) *VirtualFilesystemWatcher
type MetaFilesystem ¶
type MetaFilesystem struct {
// contains filtered or unexported fields
}
MetaFilesystem is a filesystem that works on top of another filesystem, it stores its metadata in a file and file contents in regular files.
func OpenMetaFilesystem ¶
func OpenMetaFilesystem(ctx *core.Context, underlying billy.Basic, opts MetaFilesystemParams) (*MetaFilesystem, error)
func (*MetaFilesystem) Chroot ¶
func (fls *MetaFilesystem) Chroot(path string) (billy.Filesystem, error)
func (*MetaFilesystem) Create ¶
func (fls *MetaFilesystem) Create(filename string) (billy.File, error)
func (*MetaFilesystem) DoWithContext ¶
func (fls *MetaFilesystem) DoWithContext(ctx *core.Context, fn func() error) error
DoWithContext implements core.IDoWithContext.
func (*MetaFilesystem) Events ¶
func (fls *MetaFilesystem) Events() *memds.TSArrayQueue[Event]
func (*MetaFilesystem) GetWatchers ¶
func (fls *MetaFilesystem) GetWatchers() []*VirtualFilesystemWatcher
func (*MetaFilesystem) Join ¶
func (fls *MetaFilesystem) Join(elem ...string) string
func (*MetaFilesystem) Lstat ¶
func (fls *MetaFilesystem) Lstat(filename string) (os.FileInfo, error)
func (*MetaFilesystem) MkdirAll ¶
func (fls *MetaFilesystem) MkdirAll(path string, perm os.FileMode) error
func (*MetaFilesystem) MkdirAllNoLock ¶
func (fls *MetaFilesystem) MkdirAllNoLock(path string, perm os.FileMode) error
func (*MetaFilesystem) MkdirAllNoLock_ ¶
func (*MetaFilesystem) Open ¶
func (fls *MetaFilesystem) Open(filename string) (billy.File, error)
func (*MetaFilesystem) ReadDir ¶
func (fls *MetaFilesystem) ReadDir(path string) ([]os.FileInfo, error)
func (*MetaFilesystem) Remove ¶
func (fls *MetaFilesystem) Remove(filename string) error
func (*MetaFilesystem) Rename ¶
func (fls *MetaFilesystem) Rename(from, to string) error
func (*MetaFilesystem) Root ¶
func (fls *MetaFilesystem) Root() string
func (*MetaFilesystem) Symlink ¶
func (fls *MetaFilesystem) Symlink(target, link string) error
func (*MetaFilesystem) TakeFilesystemSnapshot ¶
func (fls *MetaFilesystem) TakeFilesystemSnapshot(config core.FilesystemSnapshotConfig) (core.FilesystemSnapshot, error)
func (*MetaFilesystem) TempFile ¶
func (fls *MetaFilesystem) TempFile(dir, prefix string) (billy.File, error)
func (*MetaFilesystem) Watcher ¶
func (fls *MetaFilesystem) Watcher(evs *FilesystemEventSource) *VirtualFilesystemWatcher
type MetaFilesystemParams ¶
type MetaFilesystemParams struct { //used if underlying is a filesystem Dir string //maximum space usable in the underlying filesystem, ignored if dir is false. //The value should be greater or equal to METAFS_MIN_USABLE_SPACE, it defaults to METAFS_MIN_USABLE_SPACE. MaxUsableSpace core.ByteCount //The value defaults to METAFS_DEFAULT_MAX_FILE_COUNT, ignored if dir is false. MaxFileCount int32 //The value defaults to METAFS_DEFAULT_MAX_PARALLEL_FILE_CREATION_COUNT, ignored if dir is false. MaxParallelCreationCount int16 }
type OsFilesystem ¶
func GetOsFilesystem ¶
func GetOsFilesystem() *OsFilesystem
func (OsFilesystem) Chroot ¶
func (fs OsFilesystem) Chroot(path string) (billy.Filesystem, error)
func (*OsFilesystem) Create ¶
func (fs *OsFilesystem) Create(filename string) (billy.File, error)
func (*OsFilesystem) MkdirAll ¶
func (fs *OsFilesystem) MkdirAll(filename string, perm fs.FileMode) error
func (*OsFilesystem) Open ¶
func (fs *OsFilesystem) Open(filename string) (billy.File, error)
func (*OsFilesystem) OsFs ¶
func (fs *OsFilesystem) OsFs()
func (*OsFilesystem) Remove ¶
func (fs *OsFilesystem) Remove(filename string) error
func (*OsFilesystem) Rename ¶
func (fs *OsFilesystem) Rename(from, to string) error
we override Rename because osfs.OS.Rename is not the same as os.Rename
func (OsFilesystem) Root ¶
func (fs OsFilesystem) Root() string
func (*OsFilesystem) TempFile ¶
func (fs *OsFilesystem) TempFile(dir string, prefix string) (billy.File, error)
func (*OsFilesystem) WithSecondaryContext ¶
func (fs *OsFilesystem) WithSecondaryContext(ctx *core.Context) any
func (*OsFilesystem) WithoutSecondaryContext ¶
func (fs *OsFilesystem) WithoutSecondaryContext() any
type RemoveFile ¶
type RemoveFile struct {
// contains filtered or unexported fields
}
RemoveFile is an effect removing a file (regular file, directory, ...).
func (RemoveFile) CheckPermissions ¶
func (e RemoveFile) CheckPermissions(ctx *core.Context) error
func (RemoveFile) IsApplied ¶
func (e RemoveFile) IsApplied() bool
func (RemoveFile) IsApplying ¶
func (e RemoveFile) IsApplying() bool
func (RemoveFile) PermissionKind ¶
func (e RemoveFile) PermissionKind() core.PermissionKind
func (RemoveFile) Resources ¶
func (e RemoveFile) Resources() []core.ResourceName
func (RemoveFile) Reversability ¶
func (e RemoveFile) Reversability(*core.Context) core.Reversability
type RenameFile ¶
type RenameFile struct {
// contains filtered or unexported fields
}
func (RenameFile) CheckPermissions ¶
func (e RenameFile) CheckPermissions(ctx *core.Context) error
func (RenameFile) IsApplied ¶
func (e RenameFile) IsApplied() bool
func (RenameFile) IsApplying ¶
func (e RenameFile) IsApplying() bool
func (RenameFile) PermissionKind ¶
func (e RenameFile) PermissionKind() core.PermissionKind
func (RenameFile) Resources ¶
func (e RenameFile) Resources() []core.ResourceName
func (RenameFile) Reversability ¶
func (e RenameFile) Reversability(*core.Context) core.Reversability
type SortableFileInfo ¶
func (SortableFileInfo) Len ¶
func (a SortableFileInfo) Len() int
func (SortableFileInfo) Less ¶
func (a SortableFileInfo) Less(i, j int) bool
func (SortableFileInfo) Swap ¶
func (a SortableFileInfo) Swap(i, j int)
type VirtualFilesystemWatcher ¶
type VirtualFilesystemWatcher struct {
// contains filtered or unexported fields
}
func (*VirtualFilesystemWatcher) Close ¶
func (w *VirtualFilesystemWatcher) Close() error
type WatchableVirtualFilesystem ¶
type WatchableVirtualFilesystem interface { ClosableFilesystem //Watcher creates a new Watcher. Watcher(evs *FilesystemEventSource) *VirtualFilesystemWatcher //GetWatchers returns a copy of the list of current watchers, it is preferrable to not return //stopped watchers. GetWatchers() []*VirtualFilesystemWatcher //Events() returns the ACTUAL queue of Events. //If the filesystem is properly added to the watchedVirtualFilesystems, it is periodically emptied by the watcher managing goroutine. //Wathever it is watched, the filesystem is responsible for removing old Events, especially after a recent event. //Old is specified as being >= OLD_EVENT_MIN_AGE. Events() *memds.TSArrayQueue[Event] }
WatchableVirtualFilesystem is implemented by non-OS filesystems that can track FS events.
Source Files ¶
- basic_file_utils.go
- basic_testsuite.go
- clone.go
- closable_fs.go
- comparison.go
- dir_testsuite.go
- effects.go
- error.go
- event.go
- file.go
- filesystem_iland.go
- find.go
- flag_utils.go
- generic.go
- globbing.go
- link.go
- make.go
- memory_file.go
- memory_filesystem.go
- memory_snapshot.go
- memory_storage.go
- meta_filesystem.go
- meta_filesystem_file.go
- mutability.go
- namespaces.go
- os_filesystem.go
- os_filesystem_unix.go
- pretty_print.go
- read.go
- snapshot.go
- snapshot_testsuite.go
- sort.go
- symbolic.go
- temp.go
- times.go
- update.go
- vfs_watcher.go
- watcher_unix.go