readwriters

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

View Source
const NodeSize = shared.NodeSize
View Source
const OwnerReadWrite = 0o600

Variables

This section is empty.

Functions

This section is empty.

Types

type FileReadWriter

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

func NewFileReadWriter

func NewFileReadWriter(filename string, bufferSize int) (*FileReadWriter, error)

NewFileReadWriter creates a new file-based read-writer. The `bufferSize` controls the in-memory buffer of the underlying bufio.Writer.

func (*FileReadWriter) Append

func (rw *FileReadWriter) Append(p []byte) (n int, err error)

func (*FileReadWriter) Close

func (rw *FileReadWriter) Close() error

func (*FileReadWriter) Flush

func (rw *FileReadWriter) Flush() error

func (*FileReadWriter) ReadNext

func (rw *FileReadWriter) ReadNext() ([]byte, error)

func (*FileReadWriter) Seek

func (rw *FileReadWriter) Seek(index uint64) error

func (*FileReadWriter) Width

func (rw *FileReadWriter) Width() (uint64, error)

type SliceReadWriter

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

func (*SliceReadWriter) Append

func (s *SliceReadWriter) Append(p []byte) (n int, err error)

func (*SliceReadWriter) Close

func (s *SliceReadWriter) Close() error

func (*SliceReadWriter) Flush

func (s *SliceReadWriter) Flush() error

func (*SliceReadWriter) ReadNext

func (s *SliceReadWriter) ReadNext() ([]byte, error)

func (*SliceReadWriter) Seek

func (s *SliceReadWriter) Seek(index uint64) error

func (*SliceReadWriter) Width

func (s *SliceReadWriter) Width() (uint64, error)

Jump to

Keyboard shortcuts

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