query

package
v0.2.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 24, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Operator

func Operator(query string) string

Operator identifies the operator passed in the query and matches to one from https://github.com/thedevsaddam/gojsonq/wiki/Queries#wherekey-op-val.

Types

type Query

type Query struct {
	JSONQ *gojsonq.JSONQ
	// contains filtered or unexported fields
}

Query holds information of queries to be executed.

func SetQuery

func SetQuery(data interface{}, query string) (*Query, error)

SetQuery processes the data into a format FromString of gojsonq understands and return finally processed query.

func (*Query) ConstructQuery

func (q *Query) ConstructQuery(query string)

ConstructQuery process the query in string to a format that is understood by gojsonq.

func (*Query) GetQueryKey

func (q *Query) GetQueryKey() string

GetQueryKey returns the key used for query if set.

func (*Query) GetQueryObject

func (q *Query) GetQueryObject() string

GetQueryObject returns the object used for query if set.

func (*Query) GetQueryOperator

func (q *Query) GetQueryOperator() string

GetQueryOperator returns the operator used for query if exists.

func (*Query) GetQueryType

func (q *Query) GetQueryType() string

GetQueryType returns the type of query set.

func (*Query) GetQueryValue

func (q *Query) GetQueryValue() string

GetQueryValue returns the value used for query if set.

func (*Query) Print

func (q *Query) Print() string

Print prints the Query object to string format, mostly used for debug message.

func (*Query) QueryGet

func (q *Query) QueryGet() interface{}

QueryGet returns response post the GET query.

func (*Query) QueryPluck

func (q *Query) QueryPluck() interface{}

QueryPluck returns response post the PLUCK query.

func (*Query) QuerySort

func (q *Query) QuerySort() interface{}

QuerySort returns response post the SORT query.

func (*Query) QueryWhere

func (q *Query) QueryWhere() interface{}

QueryWhere returns response post the WHERE query.

func (*Query) RunQuery

func (q *Query) RunQuery() interface{}

RunQuery identifies the query type based on the type set by ConstructQuery and return the result post applying the query.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL