fs

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyChange

func ApplyChange(basePath string, change FileChange) error

ApplyChange applies a single file change relative to a base path.

func Read

func Read(rootDir, filePath string) (string, error)

Read safely reads content from a file, ensuring it's within a specific root dir.

func Write

func Write(rootDir, filePath, content string) error

Write safely writes content to a file, ensuring it's within a specific root dir.

Types

type FileChange

type FileChange struct {
	Path    string `json:"path"`
	Content string `json:"content,omitempty"`
	Mode    string `json:"mode"` // "create", "modify", "delete"
}

FileChange represents a file change for batch operations. It's defined here to be shared across different tools.

Jump to

Keyboard shortcuts

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