v0.0.473 add ctx to wmo.FilterQuery|Sort|Pagination
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 1m23s
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 1m23s
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
package pagination
|
||||
|
||||
import (
|
||||
"context"
|
||||
"go.mongodb.org/mongo-driver/bson"
|
||||
"go.mongodb.org/mongo-driver/mongo"
|
||||
)
|
||||
|
||||
type MongoFilter interface {
|
||||
FilterQuery() mongo.Pipeline
|
||||
Sort() bson.D
|
||||
FilterQuery(ctx context.Context) mongo.Pipeline
|
||||
Sort(ctx context.Context) bson.D
|
||||
}
|
||||
|
||||
type dynamicFilter struct {
|
||||
@@ -15,11 +16,11 @@ type dynamicFilter struct {
|
||||
sort bson.D
|
||||
}
|
||||
|
||||
func (d dynamicFilter) FilterQuery() mongo.Pipeline {
|
||||
func (d dynamicFilter) FilterQuery(ctx context.Context) mongo.Pipeline {
|
||||
return d.pipeline
|
||||
}
|
||||
|
||||
func (d dynamicFilter) Sort() bson.D {
|
||||
func (d dynamicFilter) Sort(ctx context.Context) bson.D {
|
||||
return d.sort
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user