inator

package
v0.0.0-...-1edc35d Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Search(
	jsonObjects []string,
	excludeModules []string,
	excludeFilenames []string,
	errorKeywords []string,
) <-chan *LogStatement

Types

type AnalyzeResult

type AnalyzeResult struct {
	NumHitTotal     int64
	NumMissedTotal  int64
	PercentHitTotal float64
	NumInfoHit      map[int]int64
	NumInfoMissed   map[int]int64
	PercentInfoHit  map[int]float64
	NumWarnHit      int64
	NumWarnMissed   int64
	PercentWarnHit  float64
	NumErrorHit     map[int]int64
	NumErrorMissed  map[int]int64
	PercentErrorHit map[int]float64
	NumFatalHit     int64
	NumFatalMissed  int64
	PercentFatalHit float64
}

func AnalyzeMatches

func AnalyzeMatches(sm SearchMap, results Matches) AnalyzeResult

type LogStatement

type LogStatement struct {
	SourceFile   string   `json:"sourceFile"`
	LineNumber   int      `json:"lineNumber"`
	Severity     Severity `json:"severity"`
	Verbosity    *int     `json:"verbosity,omitempty"`
	FormatString string   `json:"formatString,omitempty"`
}

func (LogStatement) Fingerprint

func (s LogStatement) Fingerprint() string

func (LogStatement) ShortSourceFile

func (s LogStatement) ShortSourceFile() string

type MatchEntry

type MatchEntry struct {
	Log  *LogStatement
	Hits []ParsedLog
}

func SortMatches

func SortMatches(results Matches) []MatchEntry

Sorts matches by number of hits

type MatchOption

type MatchOption func(*MatchOptions)

func WithJSONField

func WithJSONField(field string) MatchOption

type MatchOptions

type MatchOptions struct {
	// contains filtered or unexported fields
}

func (*MatchOptions) Apply

func (o *MatchOptions) Apply(opts ...MatchOption)

type MatchResults

type MatchResults struct {
	Matched       []Matches
	NotMatched    []Matches
	NumMatched    int64
	NumNotMatched int64
}

func Match

func Match(sm SearchMap, archive string, opts ...MatchOption) (MatchResults, error)

type MatchedAndNotMatchedLogs

type MatchedAndNotMatchedLogs struct {
	Matched    Matches
	NotMatched Matches
}

type Matches

type Matches = map[*LogStatement]*[]ParsedLog

func AggregateResults

func AggregateResults(results []Matches) Matches

func FindMissed

func FindMissed(sm SearchMap, aggregated Matches) Matches

type ParsedLog

type ParsedLog struct {
	SourceFile string `json:"sourceFile"`
	LineNumber int    `json:"lineNumber"`
	Severity   int32  `json:"severity"`
	Message    string `json:"message"`
}

func ParseLine

func ParseLine(line []byte) (ls ParsedLog, ok bool)

func (ParsedLog) Fingerprint

func (s ParsedLog) Fingerprint() string

type SearchList

type SearchList []*LogStatement

func LoadSearchList

func LoadSearchList(filename string) (SearchList, error)

func (SearchList) GenerateSearchMap

func (s SearchList) GenerateSearchMap() (sm SearchMap, collisions map[string][]*LogStatement)

type SearchMap

type SearchMap map[string]*LogStatement

type Severity

type Severity int32
const (
	SeverityInfo Severity = iota
	SeverityWarning
	SeverityError
	SeverityFatal
)

func (Severity) String

func (s Severity) String() string

Jump to

Keyboard shortcuts

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