kvfile_compress

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildCompressReader

func BuildCompressReader(rd ReadSeekerAt) (*kvfile.Reader, func(), error)

BuildCompressReader reads key/value pairs from the compressed reader. Uses seekable zstd compression. Returns a function to call to release the zstd reader.

func UseCompressedWriter

func UseCompressedWriter(writer io.Writer, cb func(writer io.Writer) error) error

UseCompressedWriter builds a compressed writer and closes it after the callback returns.

func WriteCompress

func WriteCompress(writer io.Writer, keys [][]byte, writeValue func(wr io.Writer, key []byte) (uint64, error)) error

WriteCompress writes the given key/value pairs to the store in writer. Uses seekable zstd compression.

Serializes and writes the key/value pairs. Note: keys will be sorted by key. Note: keys must not contain duplicate keys. writeValue should write the given value to the writer returning the number of bytes written.

Types

type ReadSeekerAt

type ReadSeekerAt interface {
	io.ReadSeeker
	io.ReaderAt
}

ReadSeekerAt is the interface BuildCompressReader accepts.

Jump to

Keyboard shortcuts

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