Documentation
¶
Index ¶
- Constants
- func CopyFileStreaming(src, dst string) error
- func FormatSize(size int64) string
- func HeadFile(path string, n int) (string, error)
- func ReadFileWithLineNumbers(path string, startLine, endLine int) (string, error)
- func StreamToBase64(path string) (string, error)
- func TailFile(path string, n int) (string, error)
- func TailFileWithLineNumbers(path string, n int) (string, error)
Constants ¶
View Source
const ( // DefaultChunkSize is the default buffer size for streaming operations. DefaultChunkSize = 32 * 1024 // 32KB // TailChunkSize is the chunk size for tail operations. TailChunkSize = 1024 // 1KB )
Variables ¶
This section is empty.
Functions ¶
func CopyFileStreaming ¶
CopyFileStreaming copies a file using streaming with a temporary file for atomicity.
func FormatSize ¶
FormatSize formats a file size in human-readable format.
func ReadFileWithLineNumbers ¶
ReadFileWithLineNumbers reads lines from a file in the given range and prefixes each with its 1-based line number. Use 0 for startLine to indicate "from beginning" and 0 for endLine to indicate "to end".
func StreamToBase64 ¶
StreamToBase64 encodes a file to base64 using streaming to handle large files.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.