Documentation
¶
Index ¶
- type MacheFS
- func (fs *MacheFS) Chmod(path string, mode uint32) int
- func (fs *MacheFS) Chown(path string, uid, gid uint32) int
- func (fs *MacheFS) Create(path string, flags int, mode uint32) (int, uint64)
- func (fs *MacheFS) Flush(path string, fh uint64) int
- func (fs *MacheFS) Getattr(path string, stat *fuse.Stat_t, fh uint64) int
- func (fs *MacheFS) Mkdir(path string, mode uint32) int
- func (fs *MacheFS) Open(path string, flags int) (int, uint64)
- func (fs *MacheFS) Opendir(path string) (int, uint64)
- func (fs *MacheFS) Read(path string, buff []byte, ofst int64, fh uint64) int
- func (fs *MacheFS) Readdir(path string, fill func(name string, stat *fuse.Stat_t, ofst int64) bool, ...) int
- func (fs *MacheFS) Readlink(path string) (int, string)
- func (fs *MacheFS) Release(path string, fh uint64) int
- func (fs *MacheFS) Releasedir(path string, fh uint64) int
- func (fs *MacheFS) Rmdir(path string) int
- func (fs *MacheFS) SetPromptContent(content []byte)
- func (fs *MacheFS) SetQueryFunc(fn func(string, ...any) (*sql.Rows, error))
- func (fs *MacheFS) SetWritable(writable bool, diagStatus *sync.Map)
- func (fs *MacheFS) Truncate(path string, size int64, fh uint64) int
- func (fs *MacheFS) Unlink(path string) int
- func (fs *MacheFS) Utimens(path string, tmsp []fuse.Timespec) int
- func (fs *MacheFS) Write(path string, buff []byte, ofst int64, fh uint64) int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MacheFS ¶
type MacheFS struct {
fuse.FileSystemBase
Schema *api.Topology
Graph graph.Graph
// Write-back support (nil Engine = read-only)
Writable bool
Engine *ingest.Engine
// contains filtered or unexported fields
}
MacheFS implements the FUSE interface from cgofuse. It delegates all file/directory decisions to the Graph — no heuristics.
func (*MacheFS) Open ¶
Open validates that the path is a file node. For writable mounts, write flags allocate a writeHandle backed by the node's current content.
func (*MacheFS) Read ¶
Read returns the Data of a file node. If a writeHandle exists for this fh, reads from the in-progress buffer instead.
func (*MacheFS) Readdir ¶
func (fs *MacheFS) Readdir(path string, fill func(name string, stat *fuse.Stat_t, ofst int64) bool, ofst int64, fh uint64) int
Readdir serves entries from the cached handle with inline stats (ReaddirPlus). Auto-mode (offset=0 to fill): fuse-t requires all results in the first pass. The NFS translation layer handles pagination to the macOS NFS client. cgofuse fill() convention: true = accepted, false = buffer full.
Stats are populated for each entry to enable ReaddirPlus — this eliminates the N+1 LOOKUP storm where the kernel would issue a separate Getattr call for every directory entry. With fuse-t's NFS translation, this maps to NFS READDIRPLUS which returns attributes inline.
func (*MacheFS) Readlink ¶
Readlink returns the symlink target for callers/, callees/ entries and /.query/<name>/<entry>.
func (*MacheFS) Release ¶
Release is THE COMMIT POINT for write-back. On close: splice new content into source → goimports → re-ingest → graph updated.
func (*MacheFS) Releasedir ¶
Releasedir frees the cached directory listing.
func (*MacheFS) SetPromptContent ¶ added in v0.2.0
SetPromptContent sets the content for the /PROMPT.txt virtual file (agent mode).
func (*MacheFS) SetQueryFunc ¶
SetQueryFunc enables the /.query/ magic directory. Pass the SQLiteGraph's QueryRefs method. If never called, /.query is not exposed.
func (*MacheFS) SetWritable ¶ added in v0.6.0
SetWritable enables write-back mode and wires the diagnostics handler.