Versions in this module Expand all Collapse all v0 v0.1.0 Jun 24, 2026 Changes in this version + const DefaultMaxBytes + const DefaultMaxCaptureBytes + func ParseCommandLine(line string) (name string, args []string) + func Run(ctx context.Context, inv Invocation) (Command, Result, error) + func RunStream(ctx context.Context, inv Invocation, onLine StreamFunc) (Command, Result, error) + func StripANSI(s string) string + func StripControl(s string) string + type Command struct + Args []string + ExitCode int + Name string + Stderr []byte + Stdout []byte + func CommandFromArgs(argv []string, stdout, stderr []byte, exitCode int) Command + func CommandFromLine(line string, stdout, stderr []byte, exitCode int) Command + func (c Command) Sub() string + type Discovery struct + func (d *Discovery) Observe(cmd Command, res Result) + func (d *Discovery) Top(n int) []DiscoveryEntry + type DiscoveryEntry struct + Bytes int64 + Command string + Count int + type ExecRunner struct + MaxCaptureBytes int + func (r ExecRunner) Run(ctx context.Context, inv Invocation) (Command, error) + func (r ExecRunner) RunStream(ctx context.Context, inv Invocation, onLine StreamFunc) (Command, error) + type FileSink struct + Dir string + func (s FileSink) Save(cmd Command, _ Result) (string, error) + type Filter interface + Apply func(cmd Command) Result + Match func(name string, args []string) bool + Name func() string + type GoTest struct + func (GoTest) Match(name string, args []string) bool + func (GoTest) Name() string + func (g GoTest) Apply(cmd Command) Result + type GroupSpec struct + Examples int + KeyRegex string + Line string + type Invocation struct + Args []string + Dir string + Env []string + Name string + Stdin []byte + Timeout time.Duration + type JSONSpec struct + ArrayField string + ItemTemplate string + SummaryTemplate string + type LimitSpec struct + Keep string + MaxLines int + type LineSpec struct + DedupAdjacent bool + DropBlank bool + DropPrefixes []string + DropRegexps []string + KeepRegexps []string + Source string + StripANSI bool + TrimSpace bool + TruncateLinesAt int + type LogParser struct + func (p *LogParser) Below(rec Record) bool + func (p *LogParser) Parse(line string) Record + type LogSpec struct + DefaultLevel string + DemotePatterns []string + LevelField string + LevelMap map[string]string + LineRegex string + MinLevel string + Source string + Template string + func (s LogSpec) Compile() (*LogParser, error) + type MatchSpec struct + ArgsContain []string + Command string + CommandRegex string + Subcommands []string + type OutputRule struct + Message string + Pattern string + Unless string + type Record struct + Fields map[string]any + Level string + Text string + type RedactOptions struct + Entropy bool + EntropyThreshold float64 + Extra []string + MinEntropyLen int + type Redactor struct + type Registry struct + func Default() *Registry + func New(filters ...Filter) *Registry + func (r *Registry) Compress(cmd Command) Result + func (r *Registry) Observe(fn func(Command, Result)) *Registry + func (r *Registry) Register(f Filter) *Registry + func (r *Registry) RegisterSpec(s Spec) error + func (r *Registry) WithCompact() *Registry + func (r *Registry) WithMaxBytes(n int) *Registry + func (r *Registry) WithNormalize() *Registry + func (r *Registry) WithRedaction() *Registry + func (r *Registry) WithRedactionOptions(opts RedactOptions) (*Registry, error) + func (r *Registry) WithSink(s Sink) *Registry + type Result struct + Filter string + InputBytes int + OutputBytes int + Records []Record + Text string + Truncation Truncation + func (r Result) Lossless() bool + func (r Result) SavedBytes() int + func (r Result) SavedFraction() float64 + type Runner interface + Run func(ctx context.Context, inv Invocation) (Command, error) + type RunnerFunc func(context.Context, Invocation) (Command, error) + func (f RunnerFunc) Run(ctx context.Context, inv Invocation) (Command, error) + type Session struct + Registry *Registry + Runner Runner + func DefaultSession() *Session + func NewSession(runner Runner, reg *Registry) *Session + func (s *Session) Run(ctx context.Context, inv Invocation) (Command, Result, error) + func (s *Session) RunStream(ctx context.Context, inv Invocation, onLine StreamFunc) (Command, Result, error) + type Sink interface + Save func(cmd Command, res Result) (ref string, err error) + type Spec struct + EmptyText string + Group *GroupSpec + JSON *JSONSpec + Limit *LimitSpec + Lines *LineSpec + Log *LogSpec + Match MatchSpec + MatchOutput []OutputRule + Name string + func DefaultSpecs() []Spec + func LoadSpecs(data []byte) ([]Spec, error) + func (s Spec) Compile() (Filter, error) + func (s Spec) Validate() error + type Stats struct + func (s *Stats) Observe(_ Command, res Result) + func (s *Stats) Report() StatsReport + type StatsReport struct + Commands int + DroppedLines int64 + InputBytes int64 + OutputBytes int64 + SavedBytes int64 + SavedFraction float64 + func (r StatsReport) String() string + type Stream int + const StreamStderr + const StreamStdout + func (s Stream) String() string + type StreamEvent struct + Line string + Stream Stream + type StreamFunc func(StreamEvent) + type StreamRunner interface + RunStream func(ctx context.Context, inv Invocation, onLine StreamFunc) (Command, error) + type Truncation struct + DroppedBytes int + DroppedLines int + FullRef string + Happened bool + Masked int + Note string