package
0.0.7
Repository: https://github.com/xmidt-org/interpreter.git
Documentation: pkg.go.dev

# Functions

CurrentCycleParser returns an EventsParser that takes in a list of events and returns a sorted subset of that list which includes all of the events with the boot-time of the current cycle sorted from newest to oldest by birthdate.
CurrentSessionFinder returns a function to find an event that is deemed valid by the Validator passed in with the boot-time of the current event.
DefaultComparator is a Comparator that always returns false and nil.
DefaultCycleParser runs each event in the history through the comparator and returns the entire history if no errors are found.
DefaultCycleValidator is a CycleValidator that always returns true and nil.
DuplicateEventComparator returns a ComparatorFunc to check and see if newEvent is a duplicate.
EventOrderValidator returns a CycleValidatorFunc that validates that there exists, within the history of events, particular events in the proper order.
LastCycleParser returns an EventsParser that takes in a list of events and returns a sorted subset of that list which includes all of the events with the boot-time of the previous cycle sorted from newest to oldest by birthdate.
LastCycleToCurrentParser returns an EventsParser that takes in a list of events and returns a sorted subset of that list.
LastSessionFinder returns a function to find an event that is deemed valid by the Validator passed in with the boot-time of the previous session.
MetadataValidator takes in a slice of metadata keys and returns a CycleValidatorFunc that validates that events in the slice have the same values for the keys passed in.
OlderBootTimeComparator returns a ComparatorFunc to check and see if newEvent's boot-time is less than the baseEvent's boot-time.
RebootParser returns an EventsParser that takes in a list of events and returns a sorted subset of that list containing events that are relevant to the latest reboot.
RebootToCurrentParser returns an EventsParser that takes in a list of events and returns a sorted subset of that list containing events that are relevant to the latest reboot.
SessionOfflineValidator returns a CycleValidatorFunc that validates that all sessions in the slice (except for the most recent session) have an offline event.
SessionOnlineValidator returns a CycleValidatorFunc that validates that all sessions in the slice (determined by sessionIDs) have an online event.
TransactionUUIDValidator returns a CycleValidatorFunc that validates that all events in the slice have different TransactionUUIDs.
TrueRebootValidator returns a CycleValidatorFunc that validates that the latest online event is the result of a true reboot, meaning that it has a boot-time that is different from the event that precedes it.

# Variables

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

ComparatorErr is used when an error is found with a trigger event when comparing it to a another event in the history of events.
CycleValidationErr is an error returned by validators for list of events.
EventFinderErr is an error used by EventFinder.

# Interfaces

Comparator compares two events and returns true if the condition has been matched.
CycleValidator validates a list of events.

# Type aliases

ComparatorFunc is a function that compares two events.
Comparators are a list of objects that implement the Comparator interface.
CycleValidatorFunc is a function type that takes in a slice of events and returns whether the slice of events is valid or not.
CycleValidators are a list of objects that implement the CycleValidator interface.
EventsParserFunc is a function that returns the relevant events from a slice of events.
FinderFunc is a function type that takes in a slice of events and the current event and returns an Event from the slice.