Documentation ¶
Index ¶
- Variables
- func NewIsRemote(e sql.Expression) sql.Expression
- func NewIsTag(e sql.Expression) sql.Expression
- func NewIsVendor(filePath sql.Expression) sql.Expression
- func NewLOC(args ...sql.Expression) (sql.Expression, error)
- func NewLanguage(args ...sql.Expression) (sql.Expression, error)
- func NewUAST(args ...sql.Expression) (sql.Expression, error)
- func NewUASTChildren(uast sql.Expression) sql.Expression
- func NewUASTExtract(uast, key sql.Expression) sql.Expression
- func NewUASTMode(mode, blob, lang sql.Expression) sql.Expression
- func NewUASTXPath(uast, xpath sql.Expression) sql.Expression
- type IsRemote
- type IsTag
- type IsVendor
- type LOC
- func (f *LOC) Children() []sql.Expression
- func (f *LOC) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (f *LOC) IsNullable() bool
- func (f *LOC) Resolved() bool
- func (f *LOC) String() string
- func (f *LOC) TransformUp(fn sql.TransformExprFunc) (sql.Expression, error)
- func (LOC) Type() sql.Type
- type Language
- func (f *Language) Children() []sql.Expression
- func (f *Language) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (f *Language) IsNullable() bool
- func (f *Language) Resolved() bool
- func (f *Language) String() string
- func (f *Language) TransformUp(fn sql.TransformExprFunc) (sql.Expression, error)
- func (Language) Type() sql.Type
- type UAST
- func (u UAST) Children() []sql.Expression
- func (u UAST) Eval(ctx *sql.Context, row sql.Row) (out interface{}, err error)
- func (u UAST) IsNullable() bool
- func (u UAST) Resolved() bool
- func (u *UAST) String() string
- func (u *UAST) TransformUp(fn sql.TransformExprFunc) (sql.Expression, error)
- func (u UAST) Type() sql.Type
- type UASTChildren
- type UASTExtract
- type UASTMode
- func (u UASTMode) Children() []sql.Expression
- func (u UASTMode) Eval(ctx *sql.Context, row sql.Row) (out interface{}, err error)
- func (u UASTMode) IsNullable() bool
- func (u UASTMode) Resolved() bool
- func (u *UASTMode) String() string
- func (u *UASTMode) TransformUp(fn sql.TransformExprFunc) (sql.Expression, error)
- func (u UASTMode) Type() sql.Type
- type UASTXPath
Constants ¶
This section is empty.
Variables ¶
var ( // ErrParseBlob is returned when the blob can't be parsed with bblfsh. ErrParseBlob = errors.NewKind("unable to parse the given blob using bblfsh: %s") // ErrUnmarshalUAST is returned when an error arises unmarshaling UASTs. ErrUnmarshalUAST = errors.NewKind("error unmarshaling UAST: %s") // ErrMarshalUAST is returned when an error arises marshaling UASTs. ErrMarshalUAST = errors.NewKind("error marshaling uast node: %s") )
var Functions = []sql.Function{ sql.Function1{Name: "is_tag", Fn: NewIsTag}, sql.Function1{Name: "is_remote", Fn: NewIsRemote}, sql.FunctionN{Name: "language", Fn: NewLanguage}, sql.FunctionN{Name: "loc", Fn: NewLOC}, sql.FunctionN{Name: "uast", Fn: NewUAST}, sql.Function3{Name: "uast_mode", Fn: NewUASTMode}, sql.Function2{Name: "uast_xpath", Fn: NewUASTXPath}, sql.Function2{Name: "uast_extract", Fn: NewUASTExtract}, sql.Function1{Name: "uast_children", Fn: NewUASTChildren}, sql.Function1{Name: "is_vendor", Fn: NewIsVendor}, }
Functions for gitbase queries.
Functions ¶
func NewIsRemote ¶
func NewIsRemote(e sql.Expression) sql.Expression
NewIsRemote creates a new IsRemote function.
func NewIsTag ¶
func NewIsTag(e sql.Expression) sql.Expression
NewIsTag creates a new IsTag function.
func NewIsVendor ¶ added in v0.20.0
func NewIsVendor(filePath sql.Expression) sql.Expression
NewIsVendor creates a new IsVendor function.
func NewLOC ¶ added in v0.20.0
func NewLOC(args ...sql.Expression) (sql.Expression, error)
NewLOC creates a new LOC UDF.
func NewLanguage ¶ added in v0.11.0
func NewLanguage(args ...sql.Expression) (sql.Expression, error)
NewLanguage creates a new Language UDF.
func NewUAST ¶ added in v0.11.0
func NewUAST(args ...sql.Expression) (sql.Expression, error)
NewUAST creates a new UAST UDF.
func NewUASTChildren ¶ added in v0.17.0
func NewUASTChildren(uast sql.Expression) sql.Expression
NewUASTChildren creates a new UASTExtract UDF.
func NewUASTExtract ¶ added in v0.17.0
func NewUASTExtract(uast, key sql.Expression) sql.Expression
NewUASTExtract creates a new UASTExtract UDF.
func NewUASTMode ¶ added in v0.16.0
func NewUASTMode(mode, blob, lang sql.Expression) sql.Expression
NewUASTMode creates a new UASTMode UDF.
func NewUASTXPath ¶ added in v0.11.0
func NewUASTXPath(uast, xpath sql.Expression) sql.Expression
NewUASTXPath creates a new UASTXPath UDF.
Types ¶
type IsRemote ¶
type IsRemote struct {
expression.UnaryExpression
}
IsRemote checks the given string is a remote reference.
func (IsRemote) TransformUp ¶
func (f IsRemote) TransformUp(fn sql.TransformExprFunc) (sql.Expression, error)
TransformUp implements the Expression interface.
type IsTag ¶
type IsTag struct {
expression.UnaryExpression
}
IsTag checks the given string is a tag name.
func (IsTag) TransformUp ¶
func (f IsTag) TransformUp(fn sql.TransformExprFunc) (sql.Expression, error)
TransformUp implements the Expression interface.
type IsVendor ¶ added in v0.20.0
type IsVendor struct {
expression.UnaryExpression
}
IsVendor reports whether files are vendored or not.
func (*IsVendor) TransformUp ¶ added in v0.20.0
func (v *IsVendor) TransformUp(f sql.TransformExprFunc) (sql.Expression, error)
TransformUp implements the sql.Expression interface.
type LOC ¶ added in v0.20.0
type LOC struct { Left sql.Expression Right sql.Expression }
func (*LOC) Children ¶ added in v0.20.0
func (f *LOC) Children() []sql.Expression
Children implements the Expression interface.
func (*LOC) IsNullable ¶ added in v0.20.0
IsNullable implements the Expression interface.
func (*LOC) TransformUp ¶ added in v0.20.0
func (f *LOC) TransformUp(fn sql.TransformExprFunc) (sql.Expression, error)
TransformUp implements the Expression interface.
type Language ¶ added in v0.11.0
type Language struct { Left sql.Expression Right sql.Expression }
Language gets the language of a file given its path and the optional content of the file.
func (*Language) Children ¶ added in v0.11.0
func (f *Language) Children() []sql.Expression
Children implements the Expression interface.
func (*Language) IsNullable ¶ added in v0.11.0
IsNullable implements the Expression interface.
func (*Language) TransformUp ¶ added in v0.11.0
func (f *Language) TransformUp(fn sql.TransformExprFunc) (sql.Expression, error)
TransformUp implements the Expression interface.
type UAST ¶ added in v0.11.0
type UAST struct {
// contains filtered or unexported fields
}
UAST returns an array of UAST nodes as blobs.
func (UAST) Children ¶ added in v0.11.0
func (u UAST) Children() []sql.Expression
Children implements the Expression interface.
func (UAST) IsNullable ¶ added in v0.11.0
func (u UAST) IsNullable() bool
IsNullable implements the Expression interface.
func (UAST) Resolved ¶ added in v0.11.0
func (u UAST) Resolved() bool
Resolved implements the Expression interface.
func (*UAST) TransformUp ¶ added in v0.11.0
func (u *UAST) TransformUp(fn sql.TransformExprFunc) (sql.Expression, error)
TransformUp implements the Expression interface.
type UASTChildren ¶ added in v0.17.0
type UASTChildren struct {
expression.UnaryExpression
}
UASTChildren returns children from UAST nodes.
func (*UASTChildren) String ¶ added in v0.17.0
func (u *UASTChildren) String() string
String implements the fmt.Stringer interface.
func (*UASTChildren) TransformUp ¶ added in v0.17.0
func (u *UASTChildren) TransformUp(f sql.TransformExprFunc) (sql.Expression, error)
TransformUp implements the sql.Expression interface.
func (*UASTChildren) Type ¶ added in v0.17.0
func (u *UASTChildren) Type() sql.Type
Type implements the sql.Expression interface.
type UASTExtract ¶ added in v0.17.0
type UASTExtract struct {
expression.BinaryExpression
}
UASTExtract extracts keys from an UAST.
func (*UASTExtract) String ¶ added in v0.17.0
func (u *UASTExtract) String() string
String implements the fmt.Stringer interface.
func (*UASTExtract) TransformUp ¶ added in v0.17.0
func (u *UASTExtract) TransformUp(f sql.TransformExprFunc) (sql.Expression, error)
TransformUp implements the sql.Expression interface.
func (*UASTExtract) Type ¶ added in v0.17.0
func (u *UASTExtract) Type() sql.Type
Type implements the sql.Expression interface.
type UASTMode ¶ added in v0.16.0
type UASTMode struct {
// contains filtered or unexported fields
}
UASTMode returns an array of UAST nodes as blobs.
func (UASTMode) Children ¶ added in v0.16.0
func (u UASTMode) Children() []sql.Expression
Children implements the Expression interface.
func (UASTMode) IsNullable ¶ added in v0.16.0
func (u UASTMode) IsNullable() bool
IsNullable implements the Expression interface.
func (UASTMode) Resolved ¶ added in v0.16.0
func (u UASTMode) Resolved() bool
Resolved implements the Expression interface.
func (*UASTMode) TransformUp ¶ added in v0.16.0
func (u *UASTMode) TransformUp(fn sql.TransformExprFunc) (sql.Expression, error)
TransformUp implements the Expression interface.
type UASTXPath ¶ added in v0.11.0
type UASTXPath struct {
expression.BinaryExpression
}
UASTXPath performs an XPath query over the given UAST nodes.
func (UASTXPath) TransformUp ¶ added in v0.11.0
func (f UASTXPath) TransformUp(fn sql.TransformExprFunc) (sql.Expression, error)
TransformUp implements the Expression interface.