Documentation
¶
Overview ¶
Package fileserver is the storage abstraction used by all repository and handler code that reads or writes files. It currently wraps a local implementation (process-in-memory calls into the upstream SDK's local client), but the Storage / FileManager interfaces are the same ones served by a remote file server — so a future remote-backed implementation can be swapped in without touching callers.
Scope: files + JSONL. Agent runtime tools use their own execution backend.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UserHomeDir ¶
UserHomeDir returns the current user's home directory via the local client.
Types ¶
type FileManager ¶
type FileManager interface {
FileRead(req *fsmodel.FileReadRequest) (*fsmodel.FileReadResult, error)
FileWrite(req *fsmodel.FileWriteRequest) error
FileList(req *fsmodel.FileListRequest) (*fsmodel.FileListResult, error)
FileDelete(req *fsmodel.FileDeleteRequest) error
FileMove(req *fsmodel.FileMoveRequest) error
FileCopy(req *fsmodel.FileCopyRequest) error
MkDir(req *fsmodel.MkDirRequest) error
FileExists(path string) (*fsmodel.FileExistsResult, error)
FileUpload(filename string, reader io.Reader, destPath string) (*fsmodel.FileUploadResult, error)
FileDownload(filePath string) (io.ReadCloser, string, error)
FileCreateTemp(req *fsmodel.FileCreateTempRequest) (*fsmodel.FileCreateTempResult, error)
FileGlob(req *fsmodel.FileGlobRequest) (*fsmodel.FileGlobResult, error)
FileEvalSymlinks(req *fsmodel.FileEvalSymlinksRequest) (*fsmodel.FileEvalSymlinksResult, error)
FileAppend(req *fsmodel.FileAppendRequest) error
FileStat(req *fsmodel.FileStatRequest) (*fsmodel.FileStatResult, error)
TempDir() (*fsmodel.TempDirResult, error)
UserHomeDir() (*fsmodel.UserHomeDirResult, error)
}
FileManager is the file-only capability surface (read/write/list/delete/ stat/glob/temp/...). It is Quartet-local; the adapter below translates to the current upstream SDK.
func GetFileManager ¶
func GetFileManager() FileManager
GetFileManager returns the same local singleton, narrowed to FileManager for callers that don't need JSONL.
type Storage ¶
type Storage interface {
FileManager
JSONLCountLines(req *fsmodel.JSONLCountRequest) (*fsmodel.JSONLCountResult, error)
JSONLReadLines(req *fsmodel.JSONLReadRequest) (*fsmodel.JSONLReadResult, error)
JSONLReadTail(req *fsmodel.JSONLTailRequest) (*fsmodel.JSONLTailResult, error)
JSONLAppendLine(req *fsmodel.JSONLAppendRequest) error
}
Storage is the full repo-facing storage surface: files + JSONL. Most repositories depend on Storage; a handful only need FileManager.
func GetStorage ¶
func GetStorage() Storage
GetStorage returns the process-wide local Storage singleton. The local client is stateless, so sharing a single instance across goroutines is safe.