Documentation
¶
Index ¶
- type Buffer
- type DiffState
- type DiffTracker
- type ParseResult
- type Parser
- func (p *Parser) AppendExternal(l *line.LogLine)
- func (p *Parser) LastLine() *line.LogLine
- func (p *Parser) LineAt(idx int) *line.LogLine
- func (p *Parser) LineCount() int
- func (p *Parser) Lines() []*line.LogLine
- func (p *Parser) Parse(raw string, fromStderr bool) ParseResult
- func (p *Parser) ReleaseOldLines(keepN int)
- func (p *Parser) Search(query string, startIdx int) int
- func (p *Parser) SearchReverse(query string, startIdx int) int
- type TableTracker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
Buffer is a ring buffer of recent lines for multi-line construct detection.
func (*Buffer) AllocGroupID ¶
AllocGroupID returns a new unique group ID.
func (*Buffer) DetectMultiLineJSON ¶
DetectMultiLineJSON scans backward from the most recently pushed line to detect a complete multi-line JSON construct. Returns the indices into the global lines slice that should be reparsed, or nil.
type DiffTracker ¶
type DiffTracker struct {
State DiffState
GroupID int
StartIndex int
Indent string // leading whitespace from the @@ hunk line
}
DiffTracker tracks diff state across lines.
func NewDiffTracker ¶
func NewDiffTracker() *DiffTracker
NewDiffTracker creates a new diff state tracker.
func (*DiffTracker) Feed ¶
Feed processes a line through the diff state machine. Returns the DiffMeta if the line is part of a diff block, nil otherwise.
func (*DiffTracker) InDiffBlock ¶
func (dt *DiffTracker) InDiffBlock() bool
InDiffBlock returns true if we're currently inside a confirmed diff block.
type ParseResult ¶
ParseResult contains the parsed line and any reparse indices.
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser orchestrates all detectors.
func (*Parser) AppendExternal ¶
AppendExternal appends a pre-built LogLine to the parser's internal slice without running detectors. The ingestor uses this for synthesized lines (e.g. coalesced ffmpeg progress entries) so that parser.allLines and the store remain index-aligned — reparseIndices and Search both depend on that invariant. The line is pushed into the lookback buffer too, so the multi-line JSON detector doesn't underrun when the next raw line arrives.
func (*Parser) Parse ¶
func (p *Parser) Parse(raw string, fromStderr bool) ParseResult
Parse processes a raw line and returns a ParseResult.
func (*Parser) ReleaseOldLines ¶
ReleaseOldLines nils out all but the last keepN entries in allLines, allowing the GC to reclaim LogLine objects that the store has offloaded to disk. The slice length and indices are preserved so that reparseIndices returned by DetectMultiLineJSON remain valid.
type TableTracker ¶
type TableTracker struct {
// contains filtered or unexported fields
}
TableTracker detects aligned column tables across consecutive lines.
func NewTableTracker ¶
func NewTableTracker() *TableTracker
NewTableTracker creates a new table tracker.
func (*TableTracker) Feed ¶
func (tt *TableTracker) Feed(raw string, tabGaps []line.TabGap, lineIdx int, buf *Buffer, allLines []*line.LogLine) *line.TableMeta
Feed checks if the current line forms a table with previous lines. Returns table metadata if it matches, nil otherwise. When tabGaps is non-empty, those positions are used as authoritative column boundaries (tabs are unambiguous column delimiters); otherwise we fall back to detecting ≥2-space gaps.
func (*TableTracker) GroupID ¶
func (tt *TableTracker) GroupID() int
GroupID returns the current group ID.