gdqb

package module
v0.0.0-...-f2a7c50 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2022 License: MIT Imports: 7 Imported by: 0

README

go-dgraph-qb

Dgraph query builder [WIP]

Allows building DQL queries and query result parsers while making use of go static schecks

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Indent string = "  "

Functions

func ComposeArgs

func ComposeArgs(args []Argument, minified bool) (lines []string, summary build.BuildSummary, err error)

func ComposeDirs

func ComposeDirs(dirs []Directive, minified bool) (lines []string, summary build.BuildSummary, err error)

func ComposeNamedArgs

func ComposeNamedArgs(args []NamedArgument, minified bool) (lines []string, summary build.BuildSummary, err error)

func ComposePreds

func ComposePreds(preds []Predicate, minified bool) (lines []string, summary build.BuildSummary, err error)

func Indentate

func Indentate(lines []string) []string

Types

type A

type A struct {
	Value interface{}
	Type  dqlt.DataType
}

func (A) ComposeArgument

func (a A) ComposeArgument(minified bool) (lines []string, summary build.BuildSummary, err error)

type Argument

type Argument interface {
	ComposeArgument(minified bool) ([]string, build.BuildSummary, error)
}

type D

type D struct {
	Type dqld.DirectiveType
	Args []Argument
}

func (*D) ComposeDirective

func (d *D) ComposeDirective(minified bool) (lines []string, summary build.BuildSummary, err error)

type Directive

type Directive interface {
	ComposeDirective(minified bool) ([]string, build.BuildSummary, error)
}

type F

type F struct {
	Args []Argument
	Type dqlf.FunctionType
}

type Function

type Function interface {
	ComposeFunction(minified bool) ([]string, build.BuildSummary, error)
}

type NA

type NA struct {
	A
	Name string
}

func (NA) ComposeNamedArgument

func (na NA) ComposeNamedArgument(minified bool) (lines []string, summary build.BuildSummary, err error)

type NamedArgument

type NamedArgument interface {
	Argument
	ComposeNamedArgument(minified bool) ([]string, build.BuildSummary, error)
}

type P

type P struct {
	Name  string
	Alias string
}

func (*P) ComposePredicate

func (p *P) ComposePredicate(minified bool) (lines []string, summary build.BuildSummary, err error)

type PN

type PN struct {
	P
	Dirs  []Directive
	Preds []Predicate
}

func (*PN) ComposePredicate

func (pn *PN) ComposePredicate(minified bool) (lines []string, summary build.BuildSummary, err error)

type Predicate

type Predicate interface {
	ComposePredicate(minified bool) ([]string, build.BuildSummary, error)
}

type Q

type Q struct {
	Name  string
	Args  []NamedArgument
	Dirs  []Directive
	Preds []Predicate
}

func (*Q) ComposeQuery

func (q *Q) ComposeQuery(minified bool) (lines []string, summary build.BuildSummary, err error)

type Query

type Query interface {
	ComposeQuery(minified bool) ([]string, build.BuildSummary, error)
}

type V

type V struct{}

type Variable

type Variable interface {
	ComposeVariable(minified bool) ([]string, build.BuildSummary, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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