Documentation
¶
Index ¶
- Constants
- func ParseExcelRange(s string) (x1 int, x2 *int, y1 int, y2 *int, err error)
- func ScanOptions(scanner OptScanner, maybeScanner MaybeOptScanner, dest interface{}) error
- type Assertion
- type Block
- type ColumnAssertion
- type Connection
- type Data
- type Declaration
- type Description
- type ForwardLexer
- type Global
- type GlobalAssertion
- type GlobalOption
- type HasN
- type Include
- type Item
- type JobScript
- type MaybeOptScanner
- type OptScanner
- type Option
- type OptionValue
- type Query
- type SourceSink
- type Test
- type Transform
- type UnparsedConnection
Constants ¶
const ( QUERY tokenType = iota TEST DESCRIPTION TRANSFORM FROM INTO EXTERN INCLUDE LPAREN RPAREN PAREN_BODY WITH EQUALS COMMA QUOTED_STRING NUMBER IDENTIFIER GLOBAL CONNECTION BLOCK AS EOF AFTER PLUGIN DECLARE USING PARAMETER CONSOLE SET EXEC DATA ASSERTIONS )
const MaxIncludeDepth = 8
MaxIncludeDepth is the maximum depth of includes that will be processed before an error is returned.
Variables ¶
This section is empty.
Functions ¶
func ParseExcelRange ¶
ParseExcelRange parses a range of the form 'A1:C4' with possible wildcards such as 'A1:*4'
func ScanOptions ¶
func ScanOptions(scanner OptScanner, maybeScanner MaybeOptScanner, dest interface{}) error
ScanOptions uses reflection with the "aql" struct tag to scan options. The tags are:
aql: "<case_insensitive_option_name>" aql: "<case_insensitive_option_name>, optional"
Types ¶
type Assertion ¶
type Assertion struct {
Global *GlobalAssertion `"IT " @@`
Column *ColumnAssertion `| "COLUMN " @@`
}
type ColumnAssertion ¶
type Connection ¶
type Data ¶
type Data struct {
Name string `DATA @QUOTED_STRING`
Extern *string `[EXTERN @QUOTED_STRING]`
Content string `['(' @PAREN_BODY ')']`
Destinations []SourceSink `[INTO @@ {"," @@}]`
Options []Option `[WITH '(' @@ {"," @@} ')' ]`
}
type ForwardLexer ¶
type ForwardLexer struct {
// contains filtered or unexported fields
}
func (*ForwardLexer) Next ¶
func (f *ForwardLexer) Next() lexer.Token
func (*ForwardLexer) Peek ¶
func (f *ForwardLexer) Peek() lexer.Token
type Global ¶
type GlobalAssertion ¶
type GlobalOption ¶
type GlobalOption struct {
Key string `SET @IDENT '='`
Value *OptionValue `@@`
}
type HasN ¶
type Item ¶
type JobScript ¶
type JobScript struct {
Description *Description `[@@]`
Queries []Query `{QUERY @@`
Data []Data `| @@`
Declarations []Declaration `| @@`
Connections []UnparsedConnection `| @@`
Includes []Include `| @@ `
Tests []Test `| @@ `
Execs []Query `|EXEC @@ `
Globals []Global `| @@ `
GlobalOptions []GlobalOption `| @@ `
Transforms []Transform ` | @@ }`
}
func ParseFile ¶
ParseFile parses an AQL file into a JobScript struct.
func ParseString ¶
ParseString parses an AQL string into a JobScript struct.
func (*JobScript) EvaluateParametrizedContent ¶
func (*JobScript) EvaluateParametrizedExtern ¶
func (*JobScript) ParseConnections ¶
func (b *JobScript) ParseConnections() ([]Connection, error)
type MaybeOptScanner ¶
func MaybeOptionScanner ¶
func MaybeOptionScanner(blockName, namespace string, scope ...[]Option) MaybeOptScanner
type OptScanner ¶
func OptionScanner ¶
func OptionScanner(blockName, namespace string, scope ...[]Option) OptScanner
type Option ¶
type Option struct {
Key string `@IDENT '='`
Value *OptionValue `@@`
}
func FindOption ¶
FindOption traverses the slice of options and returns the one whose key matches the needle. The search is case-insensitive. The second argument indicates whether the needle was found or not.
func FindOverridableOption ¶
FindOverridableOption searches for the needle in the option hierarchy, in the order that they are given, first looking for the namespaced option and then the generic. The first found option is returned. For example: Looking for SHEET option given QUERY options and CONN options, connection 'ExcelA', would be accomplished with FindOverridableOption("SHEET", "ExcelA", query.Options, conn.Options)
func StrToOpts ¶
StrToOpts converts an option string of the form Key1:Val1,Key2:Val2 into a slice of Options.
func (Option) String ¶
String returns the option value as a string. The boolean return parameter will be true if the option was a string and false otherwise.
type OptionValue ¶
type Query ¶
type Query struct {
Name string `@QUOTED_STRING`
Extern *string `[EXTERN @QUOTED_STRING]`
Sources []SourceSink `FROM @@ { "," @@ }`
Content string `['(' @PAREN_BODY ')' ]`
Parameters []string `[USING PARAMETER @IDENT { "," @IDENT }]`
Destinations []SourceSink `[INTO @@ { "," @@ } ]`
Options []Option `[WITH '(' @@ {"," @@ } ')' ]`
Dependencies []string `[AFTER @IDENT {"," @IDENT }]`
}
type SourceSink ¶
type Test ¶
type Transform ¶
type Transform struct {
Plugin bool `TRANSFORM [@PLUGIN]`
Name string `@QUOTED_STRING`
Extern *string `[EXTERN @QUOTED_STRING]`
Sources []*SourceSink `FROM @@ {"," @@}`
Content string `['(' @PAREN_BODY ')']`
Destinations []SourceSink `[INTO @@ {"," @@}]`
Options []Option `[WITH '(' @@ {"," @@ } ')' ]`
Dependencies []string `[AFTER @IDENT {"," @IDENT }]`
}
Source Files
¶
- assertions.go
- lexer.go
- parser.go