Documentation ¶
Index ¶
- Variables
- func Diff(ctx context.Context, s cadata.Store, leftIt, rightIt Iterator, span Span, ...) error
- func ForEach(ctx context.Context, it Iterator, fn func(ent Entry) error) error
- func KeyAfter(x []byte) []byte
- func PrefixEnd(prefix []byte) []byte
- type DiffFn
- type Entry
- type Iterator
- type Literal
- type Merger
- type Span
Constants ¶
This section is empty.
Variables ¶
View Source
var EOS = fmt.Errorf("end of stream")
EOS signals the end of a stream
Functions ¶
func Diff ¶
func Diff(ctx context.Context, s cadata.Store, leftIt, rightIt Iterator, span Span, fn DiffFn) error
Diff calls fn with all the keys and values that are different between the two Iterators
Types ¶
type Iterator ¶
type Iterator interface { Next(ctx context.Context, ent *Entry) error Seek(ctx context.Context, gteq []byte) error Peek(ctx context.Context, ent *Entry) error }
Iterator iterates over entries
e.g.
if err := it.Seek(ctx, key); err != nil { return err }
var ent Entry
for err := it.Next(ctx, &ent); err != EOS; err = it.Next(ctx, &ent) { if err != nil { return err } // use ent here. ent will be valid until the next call to it.Next }
type Literal ¶ added in v0.0.2
type Literal struct {
// contains filtered or unexported fields
}
Literal is a stream literal, satisfying the Iterator interface. It can be constructed with a slice using NewLiteral
func NewLiteral ¶ added in v0.0.2
type Span ¶
type Span = state.ByteSpan
A span of keys [Begin, End) If you want to include a specific end key, use the KeyAfter function. nil is interpretted as no bound, not as a 0 length key. This behaviour is only releveant for End.
func PrefixSpan ¶
PrefixSpan returns a Span that includes all keys with prefix p
func SingleItemSpan ¶
Click to show internal directories.
Click to hide internal directories.