Documentation
¶
Overview ¶
Package buffer provides an io.Writer as a 1:N on-disk buffer, publishing flushed files to a channel for processing.
Files may be flushed via interval, write count, or byte size.
All exported methods are thread-safe.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Buffer ¶
Buffer represents a 1:N on-disk buffer.
func New ¶
New buffer at `path`. The path given is used for the base of the filenames created, which append ".{pid}.{id}.{fid}".
type Config ¶
type Config struct { FlushWrites int64 // Flush after N writes, zero to disable FlushBytes int64 // Flush after N bytes, zero to disable FlushInterval time.Duration // Flush after duration, zero to disable BufferSize int // Buffer size for writes Queue chan *Flush // Queue of flushed files Verbosity int // Verbosity level, 0-3 Logger *log.Logger // Logger instance }
Config for disk buffer.
Click to show internal directories.
Click to hide internal directories.