Documentation
¶
Overview ¶
Package sink defines where classified records go: stdout, files, review queues, downstream pipelines.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry struct {
Record domain.Record
Classification domain.Classification
}
Entry is one record/classification pair captured by InMemory.
type InMemory ¶
type InMemory struct {
// contains filtered or unexported fields
}
InMemory is a Sink that collects everything written to it, for tests and wiring examples.
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router is a Sink that dispatches each record to a per-category Sink, falling back to a default Sink for categories with no route. Because it is itself a Sink, the engine and the CLI use it unchanged.
func NewRouter ¶
NewRouter returns a Router that sends a record to the Sink mapped to its classification Category, or to fallback when no category matches. A nil route Sink drops records of that category; a nil fallback drops records with an unrouted category.
type Sink ¶
type Sink interface {
// Write delivers one classified record.
Write(ctx context.Context, r domain.Record, c domain.Classification) error
// Close flushes and releases underlying resources. Safe to call more
// than once.
Close() error
}
Sink consumes records together with their classification.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package jsonl implements sink.Sink as JSON Lines: one JSON object per classified record, the pipe-friendly lingua franca of log tooling.
|
Package jsonl implements sink.Sink as JSON Lines: one JSON object per classified record, the pipe-friendly lingua franca of log tooling. |