legacyparser

package
v0.52.2 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PARSER_MAX_THREADS = 16

Functions

func NewParserTaskFromParser

func NewParserTaskFromParser(taskId taskid.TaskImplementationID[struct{}], parser Parser, featureOrder int, isDefaultFeature bool, availableInspectionTypes []string, labelOpts ...coretask.LabelOpt) coretask.Task[struct{}]

NewParserTaskFromParser generates a coretask.Task that consumes array of LogEntities, grouping them by given log field key and call parse function concurrently.

Types

type Parser

type Parser interface {
	// GetParserName Returns it's own parser name. It must be unique by each instances.
	GetParserName() string

	// TargetLogType returns the log type which this parser should mainly parse and generate revisions or events for.
	TargetLogType() enum.LogType

	// Parse a log. Return an error to decide skip to parse the log and delegate later parsers.
	Parse(ctx context.Context, l *log.Log, cs *history.ChangeSet, builder *history.Builder) error

	// Description returns comprehensive description of the parser.
	// Parser tasks are registered as a `feature task` and the description is shown on the frontend.
	Description() string

	// LogTask returns the task Id generating []*log.Log
	LogTask() taskid.TaskReference[[]*log.Log]

	// Dependencies returns the list of task Ids excluding the log task
	Dependencies() []taskid.UntypedTaskReference

	// Grouper returns LogGrouper that groups logs into multiple sets. These sets are sorted individually and parsed in parallel, then merged later.
	Grouper() grouper.LogGrouper
}

Parser is common interfaces across all of log parsers in KHI

Jump to

Keyboard shortcuts

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