filesystem

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDirectoryManager

func NewDirectoryManager() service.DirectoryManager

NewDirectoryManager creates a new instance of DirectoryManager and returns it as a service.DirectoryManager interface.

func NewFileWriter

func NewFileWriter() service.FileWriter

NewFileWriter creates a new instance of FileWriter and returns it as a service.FileWriter interface.

Types

type ContextReader

type ContextReader struct{}

ContextReader reads existing context files from a previously generated output directory.

func NewContextReader

func NewContextReader() *ContextReader

NewContextReader creates a new ContextReader.

func (*ContextReader) ReadExistingContext

func (r *ContextReader) ReadExistingContext(basePath string) (string, error)

ReadExistingContext reads CONTEXT.md (required) and AGENTS.md (optional) from the given directory structure and returns their concatenated content. It expects the directory layout produced by the generate command:

<basePath>/AGENTS.md (optional, at root)
<basePath>/context/CONTEXT.md (required)

type DirectoryManager

type DirectoryManager struct{}

DirectoryManager handles directory operations

func (*DirectoryManager) CreateDir

func (d *DirectoryManager) CreateDir(path string, perm os.FileMode) error

CreateDir creates a directory and any necessary parents. Uses os.MkdirAll internally.

func (*DirectoryManager) Exists

func (d *DirectoryManager) Exists(path string) (bool, error)

Exists checks if a path exists in the filesystem. Returns true if exists, false if not (or error).

type FileWriter

type FileWriter struct{}

FileWriter handles file writing operations securely

func (*FileWriter) WriteFile

func (w *FileWriter) WriteFile(path string, content []byte, perm os.FileMode) error

WriteFile writes content to a file at the specified path. It automatically creates parent directories if they don't exist. Returns error if operation fails or permissions are denied.

Jump to

Keyboard shortcuts

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