Documentation
¶
Index ¶
Constants ¶
View Source
const ( // DefaultMaxBytes is 500KB; this is typically 250 to 500 lines. DefaultMaxBytes = 500000 // DefaultInterval will flush every 10 seconds. DefaultInterval = 10 * time.Second )
Variables ¶
View Source
var ( // ErrLineTooLong is the error returned when reading a line that exceeds MaxLineLength. ErrLineTooLong = errors.New("batcher: line too long") )
Functions ¶
Types ¶
type Batcher ¶
type Batcher struct {
MaxFlushBytes int // MaxFlushBytes is the maximum number of bytes to buffer before flushing
MaxFlushInterval time.Duration // MaxFlushInterval is the maximum amount of time to wait before flushing
MaxLineLength int // MaxLineLength specifies the maximum length of a single line
Service platform.WriteService // Service receives batches flushed from Batcher.
}
Batcher batches line protocol for sends to output.
Click to show internal directories.
Click to hide internal directories.