Documentation ¶
Index ¶
- func Overlap(param interface{}, key string, notEq bool) (r sq.Sqlizer, err error)
- func ParseFilterParam(params string, allowedColumns []string) (f sq.Sqlizer, err error)
- func ParseOrderParams(params string, allowedColumns []string) ([]string, error)
- type Filter
- type FilterClauses
- type Order
- type Parameter
- type QueryParser
- func (qp *QueryParser) IsAllowed(c string) bool
- func (qp *QueryParser) ParseFilter(f Filter) (r sq.Sqlizer, err error)
- func (qp *QueryParser) ParseFilterClauses(f FilterClauses) (d sq.Sqlizer, err error)
- func (qp *QueryParser) ParseOrder(s Order) (r string, err error)
- func (qp *QueryParser) ParseOrderClauses(s []Order) (r []string, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Overlap ¶
Overlap is used to check if two arrays overlap (SQL operator &&). But can also be used as the ANY operator in SQL to check if a string/number is in an array.
func ParseFilterParam ¶
Types ¶
type FilterClauses ¶
type FilterClauses struct { And []FilterClauses `json:"$and"` Or []FilterClauses `json:"$or"` Filter Filter `json:"$filter"` }
type QueryParser ¶
type QueryParser struct {
AllowedColumns []string
}
func NewParser ¶
func NewParser(allowedColumns []string) *QueryParser
func (*QueryParser) IsAllowed ¶
func (qp *QueryParser) IsAllowed(c string) bool
func (*QueryParser) ParseFilter ¶
func (qp *QueryParser) ParseFilter(f Filter) (r sq.Sqlizer, err error)
func (*QueryParser) ParseFilterClauses ¶
func (qp *QueryParser) ParseFilterClauses(f FilterClauses) (d sq.Sqlizer, err error)
func (*QueryParser) ParseOrder ¶
func (qp *QueryParser) ParseOrder(s Order) (r string, err error)
func (*QueryParser) ParseOrderClauses ¶
func (qp *QueryParser) ParseOrderClauses(s []Order) (r []string, err error)
Click to show internal directories.
Click to hide internal directories.