parser

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Any

type Any interface{}

type Arr

type Arr []Generator

func (*Arr) Add

func (arr *Arr) Add(g Generator) Generator

func (Arr) Do

func (arr Arr) Do() Any

func (Arr) Merge

func (arr Arr) Merge(g Generator) Generator

type Generator

type Generator interface {
	Do() Any
	Merge(Generator) Generator
}

func ParseReader

func ParseReader(reader io.Reader) ([]Generator, error)

func ParseString

func ParseString(input string) ([]Generator, error)

Parse accepts an input string and the list and types of valid fields and returns either a matcher expression if the query is valid, or else an error

func ParseTextLines

func ParseTextLines(lines []string) ([]Generator, error)

type Obj

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

func NewObj

func NewObj() Obj

func (Obj) Add

func (obj Obj) Add(field string, value Generator) Obj

func (Obj) Do

func (obj Obj) Do() Any

func (Obj) Merge

func (obj Obj) Merge(g Generator) Generator

type ParseError

type ParseError struct {
	// The original query
	Input string
	// The position where the parsing fails
	Pos int
	// The error message
	Message string
}

ParseError is returned if the input cannot be successfuly parsed

func (ParseError) Error

func (e ParseError) Error() string

type Value

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

func (Value) Do

func (v Value) Do() Any

func (Value) Merge

func (v Value) Merge(g Generator) Generator

Jump to

Keyboard shortcuts

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