Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IteratorOption ¶
type IteratorOption interface {
// ApplyKV applies option to the KV iterator. Implementation may wrap or replace the iterator.
ApplyKV(it kv.Iterator) kv.Iterator
// ApplyFlat option to the flat KV iterator. Implementation may wrap or replace the iterator.
ApplyFlat(it flat.Iterator) flat.Iterator
}
IteratorOption is an additional option that affects iterator behaviour.
Implementations in generic KV package should assert for an optimized version of option (via interface assertion), and fallback to generic implementation if the store doesn't support this option natively.
func WithPrefixFlat ¶
func WithPrefixFlat(pref flat.Key) IteratorOption
WithPrefixFlat returns IteratorOption that limits scanned key to a given binary prefix. Store implementations can optimize this by implementing flat.PrefixIterator.
func WithPrefixKV ¶
func WithPrefixKV(pref kv.Key) IteratorOption
WithPrefixKV returns IteratorOption that limits scanned key to a given binary prefix. Store implementations can optimize this by implementing kv.PrefixIterator.
type PrefixFlat ¶
PrefixFlat implements IteratorOption. See WithPrefixFlat.