Documentation
¶
Overview ¶
Package runner wraps goawk: parse a source program, execute it against a set of input files, and stream both stdout output and structured trace events to a callback.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Event ¶
type Event struct {
Kind string `json:"kind"`
// stdout/stderr/error
Data string `json:"data,omitempty"`
// record
Filename string `json:"filename,omitempty"`
FNR int `json:"fnr,omitempty"`
NR int `json:"nr,omitempty"`
Line string `json:"line,omitempty"`
// pattern / action-start / action-end. Block is intentionally not
// omitempty because block 0 is a valid (and common) value.
Block int `json:"block"`
Matched bool `json:"matched,omitempty"`
// done
Code int `json:"code,omitempty"`
}
Event is emitted by Run. Kind names match the wire protocol and the trace-hook hooks in goawkviz:
"stdout" — a line written by the awk program "stderr" — a line written to error output "record" — a new input record entered the pipeline "pattern" — a pattern-action block's pattern was evaluated "action-start" — an action whose pattern matched began executing "action-end" — that action finished executing "done" — execution finished, Code is the exit status "error" — execution aborted, Data is the error message
Click to show internal directories.
Click to hide internal directories.