Help us shape the future of Go! Take the 2026 Go Developer Survey

fileserver

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

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 TempDir

func TempDir() (string, error)

TempDir returns the default system temp directory via the local client.

func UserHomeDir

func UserHomeDir() (string, error)

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.

func NewLocal

func NewLocal() Storage

NewLocal returns a fresh local Storage. Prefer GetStorage unless you specifically need an isolated instance.

Directories

Path Synopsis
Package model defines the Quartet-local file and JSONL request/result types.
Package model defines the Quartet-local file and JSONL request/result types.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL