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

Method Edit

pkg/backends/protocol.go:74–74  ·  view source on GitHub ↗

Edit 编辑文件(字符串替换) path: 文件路径 oldStr: 要替换的旧字符串 newStr: 新字符串 replaceAll: true=替换所有匹配, false=仅替换第一个 返回: EditResult,包含替换次数

(ctx context.Context, path, oldStr, newStr string, replaceAll bool)

Source from the content-addressed store, hash-verified

72 // replaceAll: true=替换所有匹配, false=仅替换第一个
73 // 返回: EditResult,包含替换次数
74 Edit(ctx context.Context, path, oldStr, newStr string, replaceAll bool) (*EditResult, error)
75
76 // GrepRaw 正则表达式搜索
77 // pattern: 正则表达式模式

Callers 3

ExecuteMethod · 0.65
TestBackendIntegrationFunction · 0.65
EditMethod · 0.65

Implementers 5

mockBackendpkg/middleware/agent_memory_test.go
FilesystemBackendpkg/backends/filesystem.go
StoreBackendpkg/backends/store_backend.go
CompositeBackendpkg/backends/composite.go
StateBackendpkg/backends/state.go

Calls

no outgoing calls

Tested by 1

TestBackendIntegrationFunction · 0.52