File tree 2 files changed +6
-2
lines changed
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 @@ -65,14 +65,18 @@ type Query struct {
65
65
Offset int // skip given number of results
66
66
KeysOnly bool // return only keys.
67
67
ReturnExpirations bool // return expirations (see TTLDatastore)
68
+ ReturnsSize bool // always return sizes. If not set, datastore impl can return
69
+ // // it anyway if it doesn't involve a performance cost. If KeysOnly
70
+ // // is not set, Size should always be set.
68
71
}
69
72
70
73
// Entry is a query result entry.
71
74
type Entry struct {
72
75
Key string // cant be ds.Key because circular imports ...!!!
73
- Size int // Might be zero if the datastore doesn't support listing the size with KeysOnly
74
76
Value []byte // Will be nil if KeysOnly has been passed.
75
77
Expiration time.Time // Entry expiration timestamp if requested and supported (see TTLDatastore).
78
+ Size int // Might be -1 if the datastore doesn't support listing the size with KeysOnly
79
+ // // or if ReturnsSizes is not set
76
80
}
77
81
78
82
// 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