v0.0.303
Some checks failed
Build Docker and Deploy / Run goext test-suite (push) Failing after 1m35s

This commit is contained in:
Mike Schwörer 2023-11-08 19:01:15 +01:00
parent 7413ea045d
commit 45031b05cf
Signed by: Mikescher
GPG Key ID: D3C7172E0A70F8CF
2 changed files with 20 additions and 2 deletions

View File

@ -1,5 +1,5 @@
package goext
const GoextVersion = "0.0.302"
const GoextVersion = "0.0.303"
const GoextVersionTimestamp = "2023-11-08T18:53:02+0100"
const GoextVersionTimestamp = "2023-11-08T19:01:15+0100"

View File

@ -9,3 +9,21 @@ type Filter interface {
FilterQuery() mongo.Pipeline
Pagination() (string, ct.SortDirection)
}
type dynamicFilter struct {
pipeline mongo.Pipeline
sortField string
sortDir ct.SortDirection
}
func (d dynamicFilter) FilterQuery() mongo.Pipeline {
return d.pipeline
}
func (d dynamicFilter) Pagination() (string, ct.SortDirection) {
return d.sortField, d.sortDir
}
func CreateFilter(pipeline mongo.Pipeline, sortField string, sortdir ct.SortDirection) Filter {
return dynamicFilter{pipeline: pipeline, sortField: sortField, sortDir: sortdir}
}