buffer

package
v3.35.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2023 License: Apache-2.0, Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileBuffer

type FileBuffer struct {
	// contains filtered or unexported fields
}

func NewFileBuffer

func NewFileBuffer(max int, temp string) *FileBuffer

NewFileBuffer returns a file buffer which will use an in-memory buffer, until `max` bytes have been written, at which point it will write the contents of memory to a file, and continue writing future data to the file. The file will be written to `temp` directory. The buffer fulfills the io.Reader and io.Writer interface

func (*FileBuffer) Close

func (fb *FileBuffer) Close() error

func (*FileBuffer) Len

func (fb *FileBuffer) Len() (int64, error)

func (*FileBuffer) NewReader

func (fb *FileBuffer) NewReader() (io.Reader, error)

func (*FileBuffer) Read

func (fb *FileBuffer) Read(p []byte) (n int, err error)

func (*FileBuffer) Reset

func (fb *FileBuffer) Reset() error

func (*FileBuffer) Write

func (fb *FileBuffer) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL