Documentation
¶
Index ¶
- Constants
- Variables
- func ConvertToArray(array Array) []value.Primary
- func ConvertToTableValue(array Array) ([]string, [][]value.Primary, error)
- func ConvertToValue(structure Structure) value.Primary
- func EncodeRune(r rune) []byte
- func Escape(s string) string
- func EscapeAll(s string) string
- func EscapeIdentifier(s string) string
- func EscapeWithHexDigits(s string) string
- func LoadArray(queryString string, json string) ([]value.Primary, error)
- func LoadTable(queryString string, json string) ([]string, [][]value.Primary, error)
- func LoadValue(queryString string, json string) (value.Primary, error)
- func NewPathSyntaxError(message string, token PathToken) error
- func NewQuerySyntaxError(message string, token QueryToken) error
- func NewSyntaxError(message string, token Token) error
- func Quote(s string) string
- func Unescape(s string) string
- type Array
- type ArrayItem
- type Boolean
- type Decoder
- type Element
- type Encoder
- type EscapeType
- type FieldExpr
- type Lexer
- type Null
- type Number
- type Object
- type ObjectMember
- 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 Scanner
- type String
- type Structure
- func ConvertRecordValueToJsonStructure(pathes []PathExpression, row []value.Primary) (Structure, error)
- func ConvertTableValueToJsonStructure(fields []string, rows [][]value.Primary) (Structure, error)
- func Extract(query QueryExpression, data Structure) (Structure, error)
- func ParseJson(src string) (Structure, error)
- func ParseValueToStructure(val value.Primary) Structure
- type SyntaxError
- type TableExpr
- type Token
Constants ¶
View Source
const ( BeginArray = '[' BeginObject = '{' EndArray = ']' EndObject = '}' NameSeparator = ':' ValueSeparator = ',' QuotationMark = '"' EscapeMark = '\\' )
View Source
const ( FalseValue = "false" TrueValue = "true" NullValue = "null" )
View Source
const ( PathSeparator = '.' PathEscape = '\\' )
View Source
const AS = 57348
View Source
const AliasSpecifier = "AS"
View Source
const BOOLEAN = 57348
View Source
const EOF = -1
View Source
const IndentSpaces = 2
View Source
const NULL = 57349
View Source
const NUMBER = 57346
View Source
const OBJECT_PATH = 57346
View Source
const PATH_IDENTIFIER = 57346
View Source
const PATH_INDEX = 57347
View Source
const STRING = 57347
Variables ¶
View Source
var Path = PathMap{}
View Source
var Query = QueryMap{}
View Source
var WhiteSpaces = []rune{
32,
9,
10,
13,
}
Functions ¶
func ConvertToArray ¶
func ConvertToTableValue ¶
func ConvertToValue ¶
func EncodeRune ¶
func EscapeIdentifier ¶
func EscapeWithHexDigits ¶
func NewPathSyntaxError ¶
func NewQuerySyntaxError ¶
func NewQuerySyntaxError(message string, token QueryToken) error
func NewSyntaxError ¶
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 Encoder ¶
type Encoder struct { EscapeType EscapeType PrettyPrint bool LineBreak cmd.LineBreak // contains filtered or unexported fields }
func NewEncoder ¶
func NewEncoder() *Encoder
type EscapeType ¶
type EscapeType int
const ( Backslash EscapeType = 0 HexDigits EscapeType = 1 AllWithHexDigits EscapeType = 2 )
type FieldExpr ¶
func (FieldExpr) FieldLabel ¶
type Object ¶
type Object struct {
Members []ObjectMember
}
type ObjectMember ¶
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 map[string]PathExpression
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 map[string]QueryExpression
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
}
type Structure ¶
type Structure interface {
String() string
}
func ConvertRecordValueToJsonStructure ¶
func ConvertRecordValueToJsonStructure(pathes []PathExpression, row []value.Primary) (Structure, error)
func ParseValueToStructure ¶
type SyntaxError ¶
func (SyntaxError) Error ¶
func (e SyntaxError) Error() string
Click to show internal directories.
Click to hide internal directories.