Documentation
¶
Index ¶
- func Mount(cromFile string, mountPoint string, codebookFile string, encryptionKey string, ...) error
- type CromFile
- func (f *CromFile) Flush(ctx context.Context, fh fs.FileHandle) syscall.Errno
- func (f *CromFile) Getattr(ctx context.Context, fh fs.FileHandle, out *fuse.AttrOut) syscall.Errno
- func (f *CromFile) Open(ctx context.Context, flags uint32) (fs.FileHandle, uint32, syscall.Errno)
- func (f *CromFile) Read(ctx context.Context, fh fs.FileHandle, dest []byte, off int64) (fuse.ReadResult, syscall.Errno)
- func (f *CromFile) Write(ctx context.Context, fh fs.FileHandle, data []byte, off int64) (uint32, syscall.Errno)
- type CromRoot
- type MemoryCache
- type RandomReader
- type SovereigntyWatcher
- type TreeInode
- func (n *TreeInode) Getattr(ctx context.Context, f fs.FileHandle, out *fuse.AttrOut) syscall.Errno
- func (n *TreeInode) Lookup(ctx context.Context, name string, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)
- func (n *TreeInode) Open(ctx context.Context, flags uint32) (fh fs.FileHandle, fuseFlags uint32, errno syscall.Errno)
- func (n *TreeInode) Read(ctx context.Context, fh fs.FileHandle, dest []byte, off int64) (fuse.ReadResult, syscall.Errno)
- func (n *TreeInode) Readdir(ctx context.Context) (fs.DirStream, syscall.Errno)
- func (n *TreeInode) Write(ctx context.Context, fh fs.FileHandle, data []byte, off int64) (uint32, syscall.Errno)
- type WriteAheadLog
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CromFile ¶
CromFile represents the unpacked file inside the FUSE mount.
type MemoryCache ¶
type MemoryCache struct {
// contains filtered or unexported fields
}
MemoryCache implements a Byte-Aware LRU Cache (SRE Limits).
func NewMemoryCache ¶
func NewMemoryCache(maxMB int) *MemoryCache
NewMemoryCache creates a new unified LRU Cache limited strictly by Megabytes.
func (*MemoryCache) Get ¶
func (c *MemoryCache) Get(key interface{}) ([]byte, bool)
Get fetches the data if it is cached.
func (*MemoryCache) Put ¶
func (c *MemoryCache) Put(key interface{}, data []byte)
Put saves data to the cache, evicting oldest until it fits within maxBytes.
type RandomReader ¶
type RandomReader struct {
// contains filtered or unexported fields
}
RandomReader provides an io.ReaderAt interface over a .crom file.
func NewRandomReader ¶
func NewRandomReader(f io.ReaderAt, fileSize int64, header *format.Header, blockTable []uint32, entries []format.ChunkEntry, cb *codebook.Reader, encryptionKey string, maxMB int) (*RandomReader, error)
NewRandomReader opens a .crom file for random access. File must be kept open by the caller. We expect exactly the data from format.Reader.Read(), minus the compDeltaPool, but because we want stream reading of the pool, we compute offsets here.
type SovereigntyWatcher ¶
type SovereigntyWatcher struct {
// contains filtered or unexported fields
}
SovereigntyWatcher monitors critical system conditions and triggers automatic unmount of the FUSE filesystem when sovereignty is compromised.
Triggers:
- Codebook file is deleted or becomes inaccessible (polling every 1s)
- OS signals (SIGINT, SIGTERM) for graceful shutdown
- Manual stop via the stopCh channel (e.g., key invalidation)
func NewSovereigntyWatcher ¶
func NewSovereigntyWatcher(server *fuse.Server, codebookPath string, mountPoint string) *SovereigntyWatcher
NewSovereigntyWatcher creates a new watcher bound to a FUSE server instance.
func (*SovereigntyWatcher) Start ¶
func (w *SovereigntyWatcher) Start()
Start begins monitoring in the background. It returns immediately. The watcher will unmount and print a reason when triggered.
func (*SovereigntyWatcher) Stop ¶
func (w *SovereigntyWatcher) Stop()
Stop triggers manual unmount (e.g., when encryption key is wiped from memory).
type TreeInode ¶
TreeInode implementa navegação POSIX de grafos usando o SQLite Inodes do CromDB.
type WriteAheadLog ¶
type WriteAheadLog struct {
// contains filtered or unexported fields
}
WriteAheadLog manages memory buffering for FUSE writes, preventing the .crom file from being hammered with appending patches byte-by-byte (which would ruin compression).
func NewWriteAheadLog ¶
func NewWriteAheadLog(cromFilePath string) *WriteAheadLog
NewWriteAheadLog creates a new WAL that flushes automatically after quiet periods.
func (*WriteAheadLog) Append ¶
func (wal *WriteAheadLog) Append(data []byte, offset int64) error
Append stages a write operation to memory.
func (*WriteAheadLog) Close ¶
func (wal *WriteAheadLog) Close()
Close forces a final flush and stops the background worker.