utils

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 31, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultMaxLines    = 2000
	DefaultMaxBytes    = 50 * 1024
	GrepMaxLineLength  = 500
	TruncatedByLines   = "lines"
	TruncatedByBytes   = "bytes"
	TruncatedByNothing = ""
)

Variables

This section is empty.

Functions

func TruncateLine

func TruncateLine(line string, maxChars int) (string, bool)

Types

type TruncationOptions

type TruncationOptions struct {
	MaxLines int
	MaxBytes int
}

type TruncationResult

type TruncationResult struct {
	Content               string
	Truncated             bool
	TruncatedBy           string
	TotalLines            int
	TotalBytes            int
	OutputLines           int
	OutputBytes           int
	LastLinePartial       bool
	FirstLineExceedsLimit bool
	MaxLines              int
	MaxBytes              int
}

func TruncateHead

func TruncateHead(content string, options TruncationOptions) TruncationResult

func TruncateTail

func TruncateTail(content string, options TruncationOptions) TruncationResult

Jump to

Keyboard shortcuts

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