File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 8
8
dsq "github.com/ipfs/go-datastore/query"
9
9
)
10
10
11
- // Datastore implements a go-datatsore .
11
+ // Datastore implements a go-datastore .
12
12
type Datastore struct {
13
13
child ds.Batching
14
14
Original file line number Diff line number Diff line change @@ -66,6 +66,9 @@ type Query struct {
66
66
Offset int // skip given number of results
67
67
KeysOnly bool // return only keys.
68
68
ReturnExpirations bool // return expirations (see TTLDatastore)
69
+ ReturnsSize bool // always return sizes. If not set, datastore impl can return
70
+ // // it anyway if it doesn't involve a performance cost. If KeysOnly
71
+ // // is not set, Size should always be set.
69
72
}
70
73
71
74
// String returns a string represenation of the Query for debugging/validation
@@ -115,9 +118,10 @@ func (q Query) String() string {
115
118
// Entry is a query result entry.
116
119
type Entry struct {
117
120
Key string // cant be ds.Key because circular imports ...!!!
118
- Size int // Might be zero if the datastore doesn't support listing the size with KeysOnly
119
121
Value []byte // Will be nil if KeysOnly has been passed.
120
122
Expiration time.Time // Entry expiration timestamp if requested and supported (see TTLDatastore).
123
+ Size int // Might be -1 if the datastore doesn't support listing the size with KeysOnly
124
+ // // or if ReturnsSizes is not set
121
125
}
122
126
123
127
// Result is a special entry that includes an error, so that the client
You can’t perform that action at this time.
0 commit comments