db: some comments in types.go
This commit is contained in:
parent
7f650cea86
commit
781f6c5d22
|
@ -54,10 +54,12 @@ type SetDeleter interface {
|
||||||
|
|
||||||
//----------------------------------------
|
//----------------------------------------
|
||||||
|
|
||||||
|
// BeginningKey is the smallest key.
|
||||||
func BeginningKey() []byte {
|
func BeginningKey() []byte {
|
||||||
return []byte{}
|
return []byte{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// EndingKey is the largest key.
|
||||||
func EndingKey() []byte {
|
func EndingKey() []byte {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -81,8 +83,8 @@ type Iterator interface {
|
||||||
// A domain of ([]byte{12, 13}, []byte{12, 14}) will iterate
|
// A domain of ([]byte{12, 13}, []byte{12, 14}) will iterate
|
||||||
// over anything with the prefix []byte{12, 13}.
|
// over anything with the prefix []byte{12, 13}.
|
||||||
//
|
//
|
||||||
// The smallest key is the empty byte array []byte{}.
|
// The smallest key is the empty byte array []byte{} - see BeginningKey().
|
||||||
// The largest key is the nil byte array []byte(nil).
|
// The largest key is the nil byte array []byte(nil) - see EndingKey().
|
||||||
Domain() (start []byte, end []byte)
|
Domain() (start []byte, end []byte)
|
||||||
|
|
||||||
// Valid returns whether the current position is valid.
|
// Valid returns whether the current position is valid.
|
||||||
|
@ -100,7 +102,7 @@ type Iterator interface {
|
||||||
// If Valid returns false, this method will panic.
|
// If Valid returns false, this method will panic.
|
||||||
Key() []byte
|
Key() []byte
|
||||||
|
|
||||||
// Value returns the key of the cursor.
|
// Value returns the value of the cursor.
|
||||||
//
|
//
|
||||||
// If Valid returns false, this method will panic.
|
// If Valid returns false, this method will panic.
|
||||||
Value() []byte
|
Value() []byte
|
||||||
|
|
Loading…
Reference in New Issue