tools

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package tools provides general utility functions used across the application. This includes helpers for file I/O, Markdown generation, and other common tasks that don't fit into more specific domain packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendFencedCodeBlock

func AppendFencedCodeBlock(buf *bytes.Buffer, content string, languageHint string)

AppendFencedCodeBlock adds a standard Markdown fenced code block to the buffer.

func AppendFileMarkerFooter

func AppendFileMarkerFooter(buf *bytes.Buffer, filePath string)

AppendFileMarkerFooter adds the explicit file end marker.

func AppendFileMarkerHeader

func AppendFileMarkerHeader(buf *bytes.Buffer, filePath string)

AppendFileMarkerHeader adds the explicit file start marker.

func AppendSectionHeader

func AppendSectionHeader(buf *bytes.Buffer, title string)

AppendSectionHeader adds a standard Markdown H3 section header to the buffer.

func ReadFileContent

func ReadFileContent(filePath string) ([]byte, error)

ReadFileContent reads the entire content of the file at the specified path. Returns the content as a byte slice or an error if reading fails.

func WriteBufferToFile

func WriteBufferToFile(filePath string, buf *bytes.Buffer) error

WriteBufferToFile writes the content of a bytes.Buffer to the specified file path. It uses default file permissions (0600). It prints informational messages about writing to os.Stdout. TODO: Refactor to remove direct fmt.Printf calls.

Calling commands should use their Presenter for user-facing messages
or a Logger for debug/trace information related to file writing.
This function should focus solely on writing the file.

Types

This section is empty.

Jump to

Keyboard shortcuts

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