v0.0.562 bf
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 2m4s
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 2m4s
This commit is contained in:
parent
be9b9e8ccf
commit
4d606d3131
@ -1,5 +1,5 @@
|
|||||||
package goext
|
package goext
|
||||||
|
|
||||||
const GoextVersion = "0.0.561"
|
const GoextVersion = "0.0.562"
|
||||||
|
|
||||||
const GoextVersionTimestamp = "2025-01-29T11:02:41+0100"
|
const GoextVersionTimestamp = "2025-01-29T11:24:20+0100"
|
||||||
|
@ -114,7 +114,7 @@ func (c *Coll[TData]) FindIterateFunc(ctx context.Context, filter bson.M, fn fun
|
|||||||
func (c *Coll[TData]) FindIterate(ctx context.Context, filter bson.M, opts ...*options.FindOptions) iter.Seq2[TData, error] {
|
func (c *Coll[TData]) FindIterate(ctx context.Context, filter bson.M, opts ...*options.FindOptions) iter.Seq2[TData, error] {
|
||||||
cursor, err := c.createFindQuery(ctx, filter, opts...)
|
cursor, err := c.createFindQuery(ctx, filter, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return langext.IterSingleValueSeq2[TData, error](nil, exerr.Wrap(err, "").Build())
|
return langext.IterSingleValueSeq2[TData, error](*new(TData), exerr.Wrap(err, "").Build())
|
||||||
}
|
}
|
||||||
|
|
||||||
return func(yield func(TData, error) bool) {
|
return func(yield func(TData, error) bool) {
|
||||||
@ -123,7 +123,7 @@ func (c *Coll[TData]) FindIterate(ctx context.Context, filter bson.M, opts ...*o
|
|||||||
for cursor.Next(ctx) {
|
for cursor.Next(ctx) {
|
||||||
v, err := c.decodeSingle(ctx, cursor)
|
v, err := c.decodeSingle(ctx, cursor)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if !yield(nil, err) {
|
if !yield(*new(TData), err) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
continue
|
continue
|
||||||
|
@ -76,15 +76,15 @@ func (c *Coll[TData]) ListIterate(ctx context.Context, filter ct.Filter, pageSiz
|
|||||||
if ctks, ok := inTok.(ct.CTKeySort); ok {
|
if ctks, ok := inTok.(ct.CTKeySort); ok {
|
||||||
_, _, _, _, cursor, err = c.createKSListQuery(ctx, filter, pageSize, ctks)
|
_, _, _, _, cursor, err = c.createKSListQuery(ctx, filter, pageSize, ctks)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return langext.IterSingleValueSeq2[TData, error](nil, exerr.Wrap(err, "").Build())
|
return langext.IterSingleValueSeq2[TData, error](*new(TData), exerr.Wrap(err, "").Build())
|
||||||
}
|
}
|
||||||
} else if ctpag, ok := inTok.(ct.CTPaginated); ok {
|
} else if ctpag, ok := inTok.(ct.CTPaginated); ok {
|
||||||
_, cursor, err = c.createPaginatedListQuery(ctx, filter, pageSize, ctpag)
|
_, cursor, err = c.createPaginatedListQuery(ctx, filter, pageSize, ctpag)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return langext.IterSingleValueSeq2[TData, error](nil, exerr.Wrap(err, "").Build())
|
return langext.IterSingleValueSeq2[TData, error](*new(TData), exerr.Wrap(err, "").Build())
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return langext.IterSingleValueSeq2[TData, error](nil, exerr.New(exerr.TypeCursorTokenDecode, "unknown ct type").Any("token", inTok).Type("tokenType", inTok).Build())
|
return langext.IterSingleValueSeq2[TData, error](*new(TData), exerr.New(exerr.TypeCursorTokenDecode, "unknown ct type").Any("token", inTok).Type("tokenType", inTok).Build())
|
||||||
}
|
}
|
||||||
|
|
||||||
return func(yield func(TData, error) bool) {
|
return func(yield func(TData, error) bool) {
|
||||||
@ -93,7 +93,7 @@ func (c *Coll[TData]) ListIterate(ctx context.Context, filter ct.Filter, pageSiz
|
|||||||
for cursor.Next(ctx) {
|
for cursor.Next(ctx) {
|
||||||
v, err := c.decodeSingle(ctx, cursor)
|
v, err := c.decodeSingle(ctx, cursor)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if !yield(nil, err) {
|
if !yield(*new(TData), err) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
continue
|
continue
|
||||||
|
@ -87,7 +87,7 @@ func (c *Coll[TData]) PaginateIterateFunc(ctx context.Context, filter pag.MongoF
|
|||||||
func (c *Coll[TData]) PaginateIterate(ctx context.Context, filter pag.MongoFilter, page int, limit *int) iter.Seq2[TData, error] {
|
func (c *Coll[TData]) PaginateIterate(ctx context.Context, filter pag.MongoFilter, page int, limit *int) iter.Seq2[TData, error] {
|
||||||
page, cursor, _, err := c.createPaginatedQuery(ctx, filter, page, limit)
|
page, cursor, _, err := c.createPaginatedQuery(ctx, filter, page, limit)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return langext.IterSingleValueSeq2[TData, error](nil, exerr.Wrap(err, "").Build())
|
return langext.IterSingleValueSeq2[TData, error](*new(TData), exerr.Wrap(err, "").Build())
|
||||||
}
|
}
|
||||||
|
|
||||||
return func(yield func(TData, error) bool) {
|
return func(yield func(TData, error) bool) {
|
||||||
@ -96,7 +96,7 @@ func (c *Coll[TData]) PaginateIterate(ctx context.Context, filter pag.MongoFilte
|
|||||||
for cursor.Next(ctx) {
|
for cursor.Next(ctx) {
|
||||||
v, err := c.decodeSingle(ctx, cursor)
|
v, err := c.decodeSingle(ctx, cursor)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if !yield(nil, err) {
|
if !yield(*new(TData), err) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
continue
|
continue
|
||||||
|
Loading…
x
Reference in New Issue
Block a user