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 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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