parser

package
v0.0.0-...-02f112a Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2016 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IncludeAny

func IncludeAny(str string, toInclude []string) bool

Types

type ParsedLine

type ParsedLine struct {
	Timestamp int64
	Level     string
	Hostname  string
	Service   string
	State     string
	CheckType string
	Try       int
	Comment   string
}

+gen

func ParseLine

func ParseLine(line string, hosts []string) ParsedLine

func ParseLineHostAlert

func ParseLineHostAlert(preParsed ParsedLineGeneric) ParsedLine

func ParseLineServiceAlert

func ParseLineServiceAlert(preParsed ParsedLineGeneric) ParsedLine

type ParsedLineGeneric

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

func ParseLineGeneric

func ParseLineGeneric(line string, hosts []string) ParsedLineGeneric

type ParsedLines

type ParsedLines []ParsedLine

ParsedLines is a slice of type ParsedLine. Use it where you would use []ParsedLine.

func ParseLog

func ParseLog(r io.Reader, hosts []string) ParsedLines

func (ParsedLines) All

func (rcv ParsedLines) All(fn func(ParsedLine) bool) bool

All verifies that all elements of ParsedLines return true for the passed func. See: http://clipperhouse.github.io/gen/#All

func (ParsedLines) Any

func (rcv ParsedLines) Any(fn func(ParsedLine) bool) bool

Any verifies that one or more elements of ParsedLines return true for the passed func. See: http://clipperhouse.github.io/gen/#Any

func (ParsedLines) Count

func (rcv ParsedLines) Count(fn func(ParsedLine) bool) (result int)

Count gives the number elements of ParsedLines that return true for the passed func. See: http://clipperhouse.github.io/gen/#Count

func (ParsedLines) Distinct

func (rcv ParsedLines) Distinct() (result ParsedLines)

Distinct returns a new ParsedLines slice whose elements are unique. See: http://clipperhouse.github.io/gen/#Distinct

func (ParsedLines) DistinctBy

func (rcv ParsedLines) DistinctBy(equal func(ParsedLine, ParsedLine) bool) (result ParsedLines)

DistinctBy returns a new ParsedLines slice whose elements are unique, where equality is defined by a passed func. See: http://clipperhouse.github.io/gen/#DistinctBy

func (ParsedLines) Each

func (rcv ParsedLines) Each(fn func(ParsedLine))

Each iterates over ParsedLines and executes the passed func against each element. See: http://clipperhouse.github.io/gen/#Each

func (ParsedLines) First

func (rcv ParsedLines) First(fn func(ParsedLine) bool) (result ParsedLine, err error)

First returns the first element that returns true for the passed func. Returns error if no elements return true. See: http://clipperhouse.github.io/gen/#First

func (ParsedLines) IsSortedBy

func (rcv ParsedLines) IsSortedBy(less func(ParsedLine, ParsedLine) bool) bool

IsSortedBy reports whether an instance of ParsedLines is sorted, using the pass func to define ‘less’. See: http://clipperhouse.github.io/gen/#SortBy

func (ParsedLines) IsSortedByDesc

func (rcv ParsedLines) IsSortedByDesc(less func(ParsedLine, ParsedLine) bool) bool

IsSortedDesc reports whether an instance of ParsedLines is sorted in descending order, using the pass func to define ‘less’. See: http://clipperhouse.github.io/gen/#SortBy

func (ParsedLines) MaxBy

func (rcv ParsedLines) MaxBy(less func(ParsedLine, ParsedLine) bool) (result ParsedLine, err error)

MaxBy returns an element of ParsedLines containing the maximum value, when compared to other elements using a passed func defining ‘less’. In the case of multiple items being equally maximal, the last such element is returned. Returns error if no elements. See: http://clipperhouse.github.io/gen/#MaxBy

func (ParsedLines) MinBy

func (rcv ParsedLines) MinBy(less func(ParsedLine, ParsedLine) bool) (result ParsedLine, err error)

MinBy returns an element of ParsedLines containing the minimum value, when compared to other elements using a passed func defining ‘less’. In the case of multiple items being equally minimal, the first such element is returned. Returns error if no elements. See: http://clipperhouse.github.io/gen/#MinBy

func (ParsedLines) Single

func (rcv ParsedLines) Single(fn func(ParsedLine) bool) (result ParsedLine, err error)

Single returns exactly one element of ParsedLines that returns true for the passed func. Returns error if no or multiple elements return true. See: http://clipperhouse.github.io/gen/#Single

func (ParsedLines) SortBy

func (rcv ParsedLines) SortBy(less func(ParsedLine, ParsedLine) bool) ParsedLines

SortBy returns a new ordered ParsedLines slice, determined by a func defining ‘less’. See: http://clipperhouse.github.io/gen/#SortBy

func (ParsedLines) SortByDesc

func (rcv ParsedLines) SortByDesc(less func(ParsedLine, ParsedLine) bool) ParsedLines

SortByDesc returns a new, descending-ordered ParsedLines slice, determined by a func defining ‘less’. See: http://clipperhouse.github.io/gen/#SortBy

func (ParsedLines) Where

func (rcv ParsedLines) Where(fn func(ParsedLine) bool) (result ParsedLines)

Where returns a new ParsedLines slice whose elements return true for func. See: http://clipperhouse.github.io/gen/#Where

Jump to

Keyboard shortcuts

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