Merge pull request #2920 from nspcc-dev/fix-seek-doc

core: adjust the documentation of SeekRange's Prefix field
This commit is contained in:
Roman Khimov 2023-02-18 23:18:39 +03:00 committed by GitHub
commit d54418bad0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -49,7 +49,9 @@ const (
// SeekRange represents options for Store.Seek operation. // SeekRange represents options for Store.Seek operation.
type SeekRange struct { type SeekRange struct {
// Prefix denotes the Seek's lookup key. // Prefix denotes the Seek's lookup key.
// Empty Prefix is not supported. // If used directly with MemCachedStore's or MemoryStore's Seek, SeekAsync or
// SeekGC empty Prefix is not supported due to internal MemoryStore cache
// architecture; otherwise empty prefix can be used safely.
Prefix []byte Prefix []byte
// Start denotes value appended to the Prefix to start Seek from. // Start denotes value appended to the Prefix to start Seek from.
// Seeking starting from some key includes this key to the result; // Seeking starting from some key includes this key to the result;
@ -57,7 +59,7 @@ type SeekRange struct {
// Start may be empty. Empty Start means seeking through all keys in // Start may be empty. Empty Start means seeking through all keys in
// the DB with matching Prefix. // the DB with matching Prefix.
// Empty Prefix and empty Start can be combined, which means seeking // Empty Prefix and empty Start can be combined, which means seeking
// through all keys in the DB. // through all keys in the DB, but see the Prefix's comment.
Start []byte Start []byte
// Backwards denotes whether Seek direction should be reversed, i.e. // Backwards denotes whether Seek direction should be reversed, i.e.
// whether seeking should be performed in a descending way. // whether seeking should be performed in a descending way.