Documentation
¶
Overview ¶
Package normalize provides normalizers that convert raw source bytes into structured core.Record values ready for storage.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CSV ¶
type CSV struct {
// contains filtered or unexported fields
}
CSV normalizer converts CSV rows into structured records.
func NewCSVWithConfig ¶
NewCSVWithConfig creates a CSV normalizer with explicit configuration.
type CSVConfig ¶
type CSVConfig struct {
Delimiter rune // field delimiter (default: ',')
HasHeaders bool // first row contains column names
ColumnNames []string // explicit column names (overrides headers)
TrimSpace bool // trim whitespace from fields
}
CSVConfig defines CSV parsing behavior.
func DefaultCSVConfig ¶
func DefaultCSVConfig() CSVConfig
DefaultCSVConfig returns standard CSV parsing defaults.
type LineJSON ¶
type LineJSON struct{}
LineJSON is a normalizer that wraps each raw line in a minimal JSON record with a "line" payload field. It is the default normalizer for interactive captures.
type Normalizer ¶
type Normalizer interface {
Init(run *core.Run) error
Ingest(raw []byte) ([]core.Record, error)
Close() error
}
Normalizer converts raw source bytes into one or more structured Records. Implementations are stateful: Init is called once at the start of a run, Ingest is called per frame, and Close is called when the source is exhausted.
type Raw ¶
type Raw struct {
// contains filtered or unexported fields
}
Raw normalizer converts raw text lines into records. This is useful for log files, plain text data, or any unstructured content.
func NewRawWithConfig ¶
NewRawWithConfig creates a raw normalizer with explicit configuration.
type RawConfig ¶
type RawConfig struct {
RecordType string // record type to assign (default: "raw")
TrimSpace bool // trim whitespace from lines
SkipEmpty bool // skip empty lines
PreserveRaw bool // include raw line in payload
SplitOnLines bool // split on newlines (default: true)
}
RawConfig defines raw text parsing behavior.
func DefaultRawConfig ¶
func DefaultRawConfig() RawConfig
DefaultRawConfig returns standard raw parsing defaults.