Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseFilter ¶
func ParseFilter(messageType proto.Message, filterString string, query *firestore.Query) (*firestore.Query, error)
ParseFilter accepts a filtering.Request, which is an interface representing List method Request messages that have a GetFilter method which returns the filter specified in the request.
Types ¶
type FilterParser ¶
type FilterParser struct {
// contains filtered or unexported fields
}
func New ¶
func New(filter filtering.Filter) *FilterParser
New instantiate a new FilterParser for the given filter
func (*FilterParser) Parse ¶
func (p *FilterParser) Parse() (interface{}, map[string]interface{}, error)
func (*FilterParser) Transpile ¶
func (p *FilterParser) Transpile(query *firestore.Query, expression interface{}, params map[string]interface{}) (*firestore.Query, error)
Transpile takes in an AIP filter string and converts it to a firestore query
expression is a map and takes the structure map[LHS:interface{} OP:string RHS:interface{}]
Example:
map[string]interface{}{"LHS":"name" "OP":"=" "RHS":"param_0"}
params is a map and takes the structure map[param_${index}: interface{}]
Example:
map[string]interface{}{"param_0":"example name"}
Click to show internal directories.
Click to hide internal directories.