Skip to content

Commit

Permalink
reorg the struct
Browse files Browse the repository at this point in the history
  • Loading branch information
ahrav committed Jan 18, 2024
1 parent 72a677c commit f4cc7f1
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pkg/writers/buffered_file_writer/bufferedfilewriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ var bufferPool = sync.Pool{

// BufferedFileWriter manages a buffer for writing data, flushing to a file when a threshold is exceeded.
type BufferedFileWriter struct {
threshold uint64 // Threshold for switching to file writing.
buf bytes.Buffer // Buffer for storing data under the threshold in memory.
filename string // Name of the temporary file.
file io.WriteCloser // File for storing data over the threshold.
size uint64 // Total size of the data written.
threshold uint64 // Threshold for switching to file writing.
size uint64 // Total size of the data written.

buf bytes.Buffer // Buffer for storing data under the threshold in memory.
filename string // Name of the temporary file.
file io.WriteCloser // File for storing data over the threshold.
}

// Option is a function that modifies a BufferedFileWriter.
Expand Down

0 comments on commit f4cc7f1

Please sign in to comment.