[#794] fixed comment typos

This commit is contained in:
Jan Lauber
2022-10-17 19:17:44 +02:00
committed by GitHub
parent 6385c5e646
commit 9cbb2e750e
11 changed files with 15 additions and 13 deletions
+3 -2
View File
@@ -13,16 +13,17 @@ import (
"github.com/spf13/cast"
)
// FilterData is a filter expession string following the `fexpr` package grammar.
// FilterData is a filter expression string following the `fexpr` package grammar.
//
// Example:
//
// var filter FilterData = "id = null || (name = 'test' && status = true)"
// resolver := search.NewSimpleFieldResolver("id", "name", "status")
// expr, err := filter.BuildExpr(resolver)
type FilterData string
// parsedFilterData holds a cache with previously parsed filter data expressions
// (initialized with some prealocated empty data map)
// (initialized with some preallocated empty data map)
var parsedFilterData = store.New(make(map[string][]fexpr.ExprGroup, 50))
// BuildExpr parses the current filter data and returns a new db WHERE expression.
+2 -1
View File
@@ -46,6 +46,7 @@ type Provider struct {
// NewProvider creates and returns a new search provider.
//
// Example:
//
// baseQuery := db.Select("*").From("user")
// fieldResolver := search.NewSimpleFieldResolver("id", "name")
// models := []*YourDataStruct{}
@@ -241,7 +242,7 @@ func (s *Provider) Exec(items any) (*Result, error) {
}, nil
}
// ParseAndExec is a short conventient method to trigger both
// ParseAndExec is a short convenient method to trigger both
// `Parse()` and `Exec()` in a single call.
func (s *Provider) ParseAndExec(urlQuery string, modelsSlice any) (*Result, error) {
if err := s.Parse(urlQuery); err != nil {