mirror of
https://github.com/mjl-/mox.git
synced 2025-07-13 00:54:38 +03:00
update to latest bstore
This commit is contained in:
25
vendor/github.com/mjl-/bstore/query.go
generated
vendored
25
vendor/github.com/mjl-/bstore/query.go
generated
vendored
@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"iter"
|
||||
"reflect"
|
||||
"slices"
|
||||
|
||||
@ -1233,3 +1234,27 @@ func (q *Query[T]) ForEach(fn func(value T) error) (rerr error) {
|
||||
return fn(v)
|
||||
})
|
||||
}
|
||||
|
||||
// All returns an iterator over all selected records.
|
||||
//
|
||||
// All automatically respositions the cursor when data is changed while iterating.
|
||||
// Changes to data aren't necessarily reflected in the yielded values. This can
|
||||
// happen when a sort order isn't executed using an index: All gathers and sorts (a
|
||||
// subset of) values before yielding them and does not reapply filtering and does
|
||||
// not necessarily yield the updated values.
|
||||
func (q *Query[T]) All() iter.Seq2[T, error] {
|
||||
return func(yield func(T, error) bool) {
|
||||
var stopped bool
|
||||
err := q.ForEach(func(v T) error {
|
||||
if !yield(v, nil) {
|
||||
stopped = true
|
||||
return StopForEach
|
||||
}
|
||||
return nil
|
||||
})
|
||||
if !stopped && err != nil {
|
||||
var zero T
|
||||
yield(zero, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
4
vendor/modules.txt
vendored
4
vendor/modules.txt
vendored
@ -16,8 +16,8 @@ github.com/mjl-/adns/internal/singleflight
|
||||
# github.com/mjl-/autocert v0.0.0-20250321204043-abab2b936e31
|
||||
## explicit; go 1.20
|
||||
github.com/mjl-/autocert
|
||||
# github.com/mjl-/bstore v0.0.8
|
||||
## explicit; go 1.22
|
||||
# github.com/mjl-/bstore v0.0.9
|
||||
## explicit; go 1.23.0
|
||||
github.com/mjl-/bstore
|
||||
# github.com/mjl-/flate v0.0.0-20250221133712-6372d09eb978
|
||||
## explicit; go 1.21
|
||||
|
Reference in New Issue
Block a user