MCPcopy Create free account
hub / github.com/astercloud/aster / SandboxFS

Interface SandboxFS

pkg/sandbox/interface.go:32–53  ·  view source on GitHub ↗

SandboxFS 沙箱文件系统接口

Source from the content-addressed store, hash-verified

30
31// SandboxFS 沙箱文件系统接口
32type SandboxFS interface {
33 // Resolve 解析路径为绝对路径
34 Resolve(path string) string
35
36 // IsInside 检查路径是否在沙箱内
37 IsInside(path string) bool
38
39 // Read 读取文件内容
40 Read(ctx context.Context, path string) (string, error)
41
42 // Write 写入文件内容
43 Write(ctx context.Context, path string, content string) error
44
45 // Temp 生成临时文件路径
46 Temp(name string) string
47
48 // Stat 获取文件状态
49 Stat(ctx context.Context, path string) (FileInfo, error)
50
51 // Glob 文件匹配
52 Glob(ctx context.Context, pattern string, opts *GlobOptions) ([]string, error)
53}
54
55// FileInfo 文件信息
56type FileInfo struct {

Callers 41

execWithLimitsMethod · 0.65
WatchMethod · 0.65
execDirectMethod · 0.65
TestLocalSandbox_FSFunction · 0.65
ListInfoMethod · 0.65
checkPathSecurityMethod · 0.65
WatchMethod · 0.65
TestLocalSandbox_FSFunction · 0.65
ListInfoMethod · 0.65
ExecuteMethod · 0.65
ExecuteMethod · 0.65
ExecuteMethod · 0.65

Implementers 6

RealFSpkg/tools/builtin/testutils.go
MockFSpkg/sandbox/mock.go
LocalFSpkg/sandbox/local_fs.go
RemoteFSpkg/sandbox/remote.go
AliyunFSpkg/sandbox/cloud/aliyun.go
VolcengineFSpkg/sandbox/cloud/volcengine.go

Calls

no outgoing calls

Tested by

no test coverage detected