query

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2019 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConstIter

type ConstIter interface {
	Peek() interface{}
	IsEmpty() bool
}

type Field

type Field struct {
	Name    string
	Getter  func(interface{}) interface{}
	Matcher Matcher
}

func (Field) Parsers

func (f Field) Parsers() []pars.Parser

func (Field) TransformError

func (f Field) TransformError(err error) error

func (Field) TransformResult

func (f Field) TransformResult(v []interface{}) interface{}

type IntMatcher

type IntMatcher struct{}

func (IntMatcher) MatchEquals

func (i IntMatcher) MatchEquals(a interface{}, b interface{}) bool

func (IntMatcher) MatchGreaterThan

func (i IntMatcher) MatchGreaterThan(a interface{}, b interface{}) bool

func (IntMatcher) MatchGreaterThanOrEquals

func (i IntMatcher) MatchGreaterThanOrEquals(a interface{}, b interface{}) bool

func (IntMatcher) MatchLessThan

func (i IntMatcher) MatchLessThan(a interface{}, b interface{}) bool

func (IntMatcher) MatchLessThanOrEquals

func (i IntMatcher) MatchLessThanOrEquals(a interface{}, b interface{}) bool

func (IntMatcher) MatchLike

func (i IntMatcher) MatchLike(a interface{}, b interface{}) bool

func (IntMatcher) TransformValue

func (i IntMatcher) TransformValue(s string) (interface{}, error)

type Iter

type Iter interface {
	ConstIter
	Next()
}

type Matcher

type Matcher interface {
	MatchEquals(interface{}, interface{}) bool
	MatchLessThanOrEquals(interface{}, interface{}) bool
	MatchGreaterThanOrEquals(interface{}, interface{}) bool
	MatchLessThan(interface{}, interface{}) bool
	MatchGreaterThan(interface{}, interface{}) bool
	MatchLike(interface{}, interface{}) bool
	TransformValue(string) (interface{}, error)
}

type Processor

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

func NewProcessor

func NewProcessor(db Queryable) Processor

func (Processor) Build

func (p Processor) Build(query string) (*Query, error)

type Query

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

func (Query) Run

func (q Query) Run() []interface{}

type Queryable

type Queryable interface {
	Fields() []Field
	Iter() Iter
}

type SliceIter

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

func (SliceIter) IsEmpty

func (s SliceIter) IsEmpty() bool

func (*SliceIter) Next

func (s *SliceIter) Next()

func (SliceIter) Peek

func (s SliceIter) Peek() interface{}

type StringMatcher

type StringMatcher struct{}

func (StringMatcher) MatchEquals

func (s StringMatcher) MatchEquals(a interface{}, b interface{}) bool

func (StringMatcher) MatchGreaterThan

func (s StringMatcher) MatchGreaterThan(a interface{}, b interface{}) bool

func (StringMatcher) MatchGreaterThanOrEquals

func (s StringMatcher) MatchGreaterThanOrEquals(a interface{}, b interface{}) bool

func (StringMatcher) MatchLessThan

func (s StringMatcher) MatchLessThan(a interface{}, b interface{}) bool

func (StringMatcher) MatchLessThanOrEquals

func (s StringMatcher) MatchLessThanOrEquals(a interface{}, b interface{}) bool

func (StringMatcher) MatchLike

func (s StringMatcher) MatchLike(a interface{}, b interface{}) bool

func (StringMatcher) TransformValue

func (s StringMatcher) TransformValue(str string) (interface{}, error)

Jump to

Keyboard shortcuts

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