internal

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2022 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const InterfaceName = "Queryable"
View Source
const ProjectName = "goquery"

Variables

This section is empty.

Functions

func WriteBase

func WriteBase(c *Context, goFilePath string)

Types

type Addable

type Addable interface {
	String() string
	Args() []any
}

type Context

type Context struct {
	FileSet *token.FileSet
	AstFile *ast.File

	PackageName string

	Data map[string]map[token.Position]QueryData // EntityName(type Arg) -> caller -> query

	TypeInfo *types.Info
}

func (*Context) ParseFile

func (c *Context) ParseFile(filePath string) error

func (*Context) Visit

func (c *Context) Visit(node ast.Node) (w ast.Visitor)

type Expression

type Expression struct{ ast.Expr }

func (Expression) Args

func (e Expression) Args() []any

func (Expression) String

func (e Expression) String() string

type GoQueryPackage

type GoQueryPackage struct{}

type Neg added in v0.1.1

type Neg struct {
	Addable
}

func (Neg) String added in v0.1.1

func (n Neg) String() string

type Not

type Not struct {
	Addable
}

func (Not) String

func (n Not) String() string

type Parens

type Parens struct {
	Addable
}

func (Parens) String

func (p Parens) String() string

type QueryData

type QueryData struct {
	Query string
	Args  []string
}

type Simple

type Simple struct {
	StringVal string
	Arg       []any
}

func NewColumn

func NewColumn(name string) *Simple

func NewSimple

func NewSimple(val string, args ...any) *Simple

func (Simple) Args

func (s Simple) Args() []any

func (Simple) String

func (s Simple) String() string

type StringsPackage

type StringsPackage struct{}

type TimePackage

type TimePackage struct{}

type TimeType

type TimeType struct{}

type Wrapper

type Wrapper struct {
	Addable
	StringF func(a Addable) string
	ArgsF   func(a Addable) []any
}

Wrapper takes an addable and wraps it.

For example if string representation of Addable should be concatenated with something else like: `Addable.String()` to `'%' || Addable.String() || '%'".

Wrapper defined above would look like this:

Wrapper{
	Addable: addable,
	StringF: func(a Addable) string {
		return `'%' || ` + a.String() + ` || '%'`
	}
}

func (Wrapper) Args

func (w Wrapper) Args() []any

func (Wrapper) String

func (w Wrapper) String() string

Jump to

Keyboard shortcuts

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