Documentation
¶
Overview ¶
Package batcher provides batched event writing for Chronicle. Events are accumulated and flushed on size threshold, time interval, or shutdown.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Batcher ¶
type Batcher struct {
// contains filtered or unexported fields
}
Batcher accumulates events and flushes them in batches.
func (*Batcher) Add ¶
Add adds an event to the batch buffer. If the batch is full, it flushes immediately.
A failed flush leaves the events buffered so a later flush can retry, rather than dropping audit records because the store was briefly unavailable.
func (*Batcher) Flush ¶
Flush writes any buffered events. The buffer is only cleared once flushFn succeeds, so a failure can be retried without losing the batch.
Click to show internal directories.
Click to hide internal directories.