bitcask: github.com/prologic/bitcask/internal/data/codec Index | Files

package codec

import "github.com/prologic/bitcask/internal/data/codec"

Index

Package Files

decoder.go encoder.go

func DecodeEntry Uses

func DecodeEntry(b []byte, e *internal.Entry, maxKeySize uint32, maxValueSize uint64) error

DecodeEntry decodes a serialized entry

func IsCorruptedData Uses

func IsCorruptedData(err error) bool

IsCorruptedData indicates if the error correspondes to possible data corruption

type Decoder Uses

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

Decoder wraps an underlying io.Reader and allows you to stream Entry decodings on it.

func NewDecoder Uses

func NewDecoder(r io.Reader, maxKeySize uint32, maxValueSize uint64) *Decoder

NewDecoder creates a streaming Entry decoder.

func (*Decoder) Decode Uses

func (d *Decoder) Decode(v *internal.Entry) (int64, error)

Decode decodes the next Entry from the current stream

type Encoder Uses

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

Encoder wraps an underlying io.Writer and allows you to stream Entry encodings on it.

func NewEncoder Uses

func NewEncoder(w io.Writer) *Encoder

NewEncoder creates a streaming Entry encoder.

func (*Encoder) Encode Uses

func (e *Encoder) Encode(msg internal.Entry) (int64, error)

Encode takes any Entry and streams it to the underlying writer. Messages are framed with a key-length and value-length prefix.

Package codec imports 5 packages (graph) and is imported by 1 packages. Updated 2019-10-08. Refresh now. Tools for package owners.