gminparsers

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseOutputAttrs

func ParseOutputAttrs(attrs string, attrMap map[string]string) (string, error)

ParseOutputAttrs validates attributes string and formats it for Get and List calls

func ParseQuery

func ParseQuery(query string, qAttrMap map[string]string) (string, error)

ParseQuery validates query string and formats it for queries in list calls

Types

type OutputAttrParser

type OutputAttrParser struct {
	// contains filtered or unexported fields
}

OutputAttrParser represents a parser of get and list attribute strings

func NewOutputAttrParser

func NewOutputAttrParser(buf *bytes.Buffer) *OutputAttrParser

NewOutputAttrParser returns a new instance of OutputAttrParser

func (*OutputAttrParser) Parse

func (oap *OutputAttrParser) Parse(attrMap map[string]string) (*OutputAttrStr, error)

Parse is the entry point for the parser

type OutputAttrScanner

type OutputAttrScanner struct {
	// contains filtered or unexported fields
}

OutputAttrScanner represents a lexical scanner for get and list attribute strings

func NewOutputAttrScanner

func NewOutputAttrScanner(buf *bytes.Buffer) *OutputAttrScanner

NewOutputAttrScanner returns a new instance of OutputAttrScanner

func (*OutputAttrScanner) Scan

func (oas *OutputAttrScanner) Scan() (Token, string)

Scan returns the next token and literal value from OutputAttrScanner

type OutputAttrStr

type OutputAttrStr struct {
	Fields []string
}

OutputAttrStr is a struct to hold list of output attribute string parts

type QueryParser

type QueryParser struct {
	// contains filtered or unexported fields
}

QueryParser represents a parser of query strings

func NewQueryParser

func NewQueryParser(buf *bytes.Buffer) *QueryParser

NewQueryParser returns a new instance of QueryParser

func (*QueryParser) Parse

func (qp *QueryParser) Parse(qAttrMap map[string]string) (*QueryStr, error)

Parse is the entry point for the QueryParser

type QueryScanner

type QueryScanner struct {
	// contains filtered or unexported fields
}

QueryScanner represents a lexical scanner for query strings

func NewQueryScanner

func NewQueryScanner(buf *bytes.Buffer) *QueryScanner

NewQueryScanner returns a new instance of QueryScanner

func (*QueryScanner) Scan

func (qs *QueryScanner) Scan() (Token, string)

Scan returns the next token and literal value from QueryScanner

type QueryStr

type QueryStr struct {
	Parts []string
}

QueryStr is a struct to hold list of query string parts

type Scanner

type Scanner struct {
	// contains filtered or unexported fields
}

Scanner represents a lexical scanner

type Token

type Token int

Token represents a lexical token.

const (

	// ILLEGAL is an illegal character
	ILLEGAL Token = iota
	// EOS is end of string
	EOS
	// WS is whitespace
	WS

	//IDENT is field name
	IDENT

	// ASTERISK IS *
	ASTERISK
	// BSLASH is \
	BSLASH
	// CLOSEBRACK is )
	CLOSEBRACK
	// CLOSESQBRACK is ]
	CLOSESQBRACK
	// COLON is :
	COLON
	// COMMA is ,
	COMMA
	// EQUALS is =
	EQUALS
	// FSLASH is /
	FSLASH
	// GT is >
	GT
	// LT is <
	LT
	// OP is an operator
	OP
	// OPENBRACK is (
	OPENBRACK
	// OPENSQBRACK is [
	OPENSQBRACK
	// SINGLEQUOTE is '
	SINGLEQUOTE
	// TILDE is ~
	TILDE
	// UNDERSCORE is _
	UNDERSCORE
	// VALUE is query or input attribute value
	VALUE
)

Jump to

Keyboard shortcuts

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