Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertRecordValueToJsonStructure(pathes []PathExpression, row []value.Primary) (json.Structure, error)
- func ConvertTableValueToJsonStructure(ctx context.Context, fields []string, rows [][]value.Primary) (json.Structure, error)
- func ConvertToArray(array json.Array) []value.Primary
- func ConvertToTableValue(array json.Array) ([]string, [][]value.Primary, error)
- func ConvertToValue(structure json.Structure) value.Primary
- func EscapeIdentifier(s string) string
- func Extract(query QueryExpression, data json.Structure) (json.Structure, error)
- func LoadArray(queryString string, jsontext string) ([]value.Primary, error)
- func LoadTable(queryString string, jsontext string) ([]string, [][]value.Primary, json.EscapeType, error)
- func LoadValue(queryString string, jsontext string) (value.Primary, error)
- func NewPathSyntaxError(message string, token PathToken) error
- func NewQuerySyntaxError(message string, token QueryToken) error
- func ParseValueToStructure(val value.Primary) json.Structure
- type ArrayItem
- type Element
- type FieldExpr
- type ObjectPath
- type PathExpression
- type PathLexer
- type PathMap
- type PathScanner
- type PathSyntaxError
- type PathToken
- type QueryExpression
- type QueryLexer
- type QueryMap
- type QueryScanner
- type QuerySyntaxError
- type QueryToken
- type RowValueExpr
- type TableExpr
Constants ¶
View Source
const ( PathSeparator = '.' PathEscape = '\\' )
View Source
const AS = 57348
View Source
const AliasSpecifier = "AS"
View Source
const EOF = -1
View Source
const OBJECT_PATH = 57346
View Source
const PATH_IDENTIFIER = 57346
View Source
const PATH_INDEX = 57347
Variables ¶
View Source
var Path = NewPathMap()
View Source
var Query = NewQueryMap()
Functions ¶
func ConvertToTableValue ¶
func EscapeIdentifier ¶
func NewPathSyntaxError ¶
func NewQuerySyntaxError ¶
func NewQuerySyntaxError(message string, token QueryToken) error
Types ¶
type ArrayItem ¶
type ArrayItem struct { Index int Child QueryExpression }
func (ArrayItem) FieldLabel ¶
type Element ¶
type Element struct { Label string Child QueryExpression }
func (Element) FieldLabel ¶
type FieldExpr ¶
func (FieldExpr) FieldLabel ¶
type ObjectPath ¶
type ObjectPath struct { Name string Child PathExpression }
type PathExpression ¶
type PathExpression interface{}
func ParsePath ¶
func ParsePath(src string) (PathExpression, error)
func ParsePathes ¶
func ParsePathes(fields []string) ([]PathExpression, error)
type PathLexer ¶
type PathLexer struct { PathScanner // contains filtered or unexported fields }
type PathMap ¶
type PathMap struct {
// contains filtered or unexported fields
}
func NewPathMap ¶ added in v1.9.3
func NewPathMap() PathMap
type PathScanner ¶
type PathScanner struct {
// contains filtered or unexported fields
}
func (*PathScanner) Init ¶
func (s *PathScanner) Init(src string) *PathScanner
func (*PathScanner) Scan ¶
func (s *PathScanner) Scan() PathToken
type PathSyntaxError ¶
func (PathSyntaxError) Error ¶
func (e PathSyntaxError) Error() string
type QueryExpression ¶
type QueryExpression interface{}
func ParseQuery ¶
func ParseQuery(src string) (QueryExpression, error)
type QueryLexer ¶
type QueryLexer struct { QueryScanner // contains filtered or unexported fields }
func (*QueryLexer) Error ¶
func (l *QueryLexer) Error(e string)
func (*QueryLexer) Lex ¶
func (l *QueryLexer) Lex(lval *jqSymType) int
type QueryMap ¶
type QueryMap struct {
// contains filtered or unexported fields
}
func NewQueryMap ¶ added in v1.9.3
func NewQueryMap() QueryMap
type QueryScanner ¶
type QueryScanner struct {
// contains filtered or unexported fields
}
func (*QueryScanner) Init ¶
func (s *QueryScanner) Init(src string) *QueryScanner
func (*QueryScanner) Scan ¶
func (s *QueryScanner) Scan() (QueryToken, error)
type QuerySyntaxError ¶
func (QuerySyntaxError) Error ¶
func (e QuerySyntaxError) Error() string
type QueryToken ¶
type RowValueExpr ¶
type RowValueExpr struct {
Child QueryExpression
}
Click to show internal directories.
Click to hide internal directories.