eventlog

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attribute

type Attribute struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type Attributes

type Attributes []Attribute

type LogFinder

type LogFinder interface {
	// return empty slice if there is no match
	FindFromLogs(logs LogResults) MatchedResults
	FindFromAttrs(attrs Attributes) MatchedResults
}

func NewLogFinder

func NewLogFinder(rule Rule) (LogFinder, error)

type LogResult

type LogResult struct {
	Type       LogType    `json:"type"`
	Attributes Attributes `json:"attributes"`
}

type LogResults

type LogResults []LogResult

type LogType

type LogType string
const (
	//TODO add if need more
	Message      LogType = "message"
	WasmType     LogType = "wasm"
	TransferType LogType = "transfer"
)

type MatchedItem

type MatchedItem struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type MatchedResult

type MatchedResult []MatchedItem

type MatchedResults

type MatchedResults []MatchedResult

type Rule

type Rule struct {
	Type  LogType
	Items []RuleItem
	Until string
}

func NewRule

func NewRule(logType LogType, items RuleItems, until string) (Rule, error)

type RuleItem

type RuleItem struct {
	Key    string
	Filter interface{}
}

Target receives string, func(v string) bool or nil

func (*RuleItem) Match

func (r *RuleItem) Match(a Attribute) bool

type RuleItems

type RuleItems []RuleItem

Jump to

Keyboard shortcuts

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