Documentation
¶
Index ¶
Constants ¶
const ( NodeTypeText = "text" NodeTypeAnsi = "ansi" NodeTypeJSON = "json" NodeTypeString = "string" NodeTypeUUID = "uuid" NodeTypeTimestamp = "timestamp" NodeTypeURL = "url" NodeTypeNumber = "number" )
Node type constants
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Node ¶ added in v0.9.0
type Node struct {
Type string `json:"type"`
Content string `json:"content"`
Label string `json:"label,omitempty"`
Prev *Node `json:"-"`
Next *Node `json:"-"`
}
Node represents a fundamental unit of parsed log data in a doubly linked list
func ProcessLine ¶ added in v0.9.0
func (*Node) All ¶ added in v0.9.0
All returns an iterator that yields all nodes starting from this node
func (*Node) IsAnsiType ¶ added in v0.9.0
IsAnsiType returns true if the node is an ANSI type
func (*Node) IsStructuredType ¶ added in v0.9.0
IsStructuredType returns true if the node is a structured type (JSON, string, UUID, etc.)
func (*Node) IsTextType ¶ added in v0.9.0
IsTextType returns true if the node is a text type
type Position ¶ added in v0.9.0
Position represents the start and end positions of content in a string
func FindFirstAnsiEscape ¶ added in v0.9.0
FindFirstAnsiEscape finds the first ANSI escape sequence in the given string Returns nil if no ANSI escape is found, otherwise returns the position range
func FindFirstJSON ¶ added in v0.9.0
FindFirstJSON finds the first valid JSON object or array in the given string Returns nil if no valid JSON is found, otherwise returns the position range
func FindFirstURL ¶ added in v0.9.0
FindFirstURL finds the first HTTP/HTTPS URL in the given string Returns nil if no URL is found, otherwise returns the position range Applies heuristics to avoid including trailing punctuation
func FindFirstUUID ¶ added in v0.9.0
FindFirstUUID finds the first UUID in the given string Returns nil if no UUID is found, otherwise returns the position range