parser

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Select      = "$select"
	Top         = "$top"
	Skip        = "$skip"
	Count       = "$count"
	OrderBy     = "$orderby"
	InlineCount = "$inlinecount"
	Filter      = "$filter"
)

Odata keywords

Variables

This section is empty.

Functions

func ParseURLValues

func ParseURLValues(query url.Values) (map[string]interface{}, error)

ParseURLValues parses url values in odata format into a map of interfaces for the DB adapters to translate nolint :gocyclo

Types

type Function

type Function struct {
	Token string
	// The number of parameters this function accepts
	Params int
}

Function function structure

type Operator

type Operator struct {
	Token string
	// Whether the operator is left/right/or not associative
	Association int
	// The number of operands this operator operates on
	Operands int
	// Rank of precedence
	Precedence int
}

Operator operator structure

type OrderItem

type OrderItem struct {
	Field string
	Order string
}

OrderItem holds order key information

type ParseNode

type ParseNode struct {
	Token    *Token
	Parent   *ParseNode
	Children []*ParseNode
}

ParseNode parseNode structure

type Parser

type Parser struct {
	// Map from string inputs to operator types
	Operators map[string]*Operator
	// Map from string inputs to function types
	Functions map[string]*Function
}

Parser parser structure

type Token

type Token struct {
	Value interface{}
	Type  int
	// contains filtered or unexported fields
}

Token token structure

type TokenMatcher

type TokenMatcher struct {
	Pattern string
	Re      *regexp.Regexp
	Token   int
}

TokenMatcher token matcher structure

type Tokenizer

type Tokenizer struct {
	TokenMatchers  []*TokenMatcher
	IgnoreMatchers []*TokenMatcher
}

Tokenizer structure

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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