db: some comments in types.go

This commit is contained in:
Ethan Buchman 2017-12-12 18:04:05 -05:00
parent 7f650cea86
commit 781f6c5d22
1 changed files with 5 additions and 3 deletions

View File

@ -54,10 +54,12 @@ type SetDeleter interface {
//----------------------------------------
// BeginningKey is the smallest key.
func BeginningKey() []byte {
return []byte{}
}
// EndingKey is the largest key.
func EndingKey() []byte {
return nil
}
@ -81,8 +83,8 @@ type Iterator interface {
// A domain of ([]byte{12, 13}, []byte{12, 14}) will iterate
// over anything with the prefix []byte{12, 13}.
//
// The smallest key is the empty byte array []byte{}.
// The largest key is the nil byte array []byte(nil).
// The smallest key is the empty byte array []byte{} - see BeginningKey().
// The largest key is the nil byte array []byte(nil) - see EndingKey().
Domain() (start []byte, end []byte)
// Valid returns whether the current position is valid.
@ -100,7 +102,7 @@ type Iterator interface {
// If Valid returns false, this method will panic.
Key() []byte
// Value returns the key of the cursor.
// Value returns the value of the cursor.
//
// If Valid returns false, this method will panic.
Value() []byte