common

package
v0.0.0-...-c4d1cd5 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2018 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Argument

type Argument struct {
	Name  Ident
	Value Literal
}

type ArgumentList

type ArgumentList []Argument

func ParseArguments

func ParseArguments(l *Lexer) ArgumentList

func (ArgumentList) Get

func (l ArgumentList) Get(name string) (Literal, bool)

func (ArgumentList) MustGet

func (l ArgumentList) MustGet(name string) Literal

type BasicLit

type BasicLit struct {
	Type rune
	Text string
	Loc  errors.Location
}

func (*BasicLit) Location

func (lit *BasicLit) Location() errors.Location

func (*BasicLit) String

func (lit *BasicLit) String() string

func (*BasicLit) Value

func (lit *BasicLit) Value(vars map[string]interface{}) interface{}

type Directive

type Directive struct {
	Name Ident
	Args ArgumentList
}

type DirectiveList

type DirectiveList []*Directive

func ParseDirectives

func ParseDirectives(l *Lexer) DirectiveList

func (DirectiveList) Get

func (l DirectiveList) Get(name string) *Directive

type Ident

type Ident struct {
	Name string
	Loc  errors.Location
}

type InputValue

type InputValue struct {
	Name    Ident
	Type    Type
	Default Literal
	Desc    string
	Loc     errors.Location
	TypeLoc errors.Location
}

http://facebook.github.io/graphql/draft/#InputValueDefinition

func ParseInputValue

func ParseInputValue(l *Lexer) *InputValue

type InputValueList

type InputValueList []*InputValue

func (InputValueList) Get

func (l InputValueList) Get(name string) *InputValue

type Lexer

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

func NewLexer

func NewLexer(s string) *Lexer

func (*Lexer) CatchSyntaxError

func (l *Lexer) CatchSyntaxError(f func()) (errRes *errors.QueryError)

func (*Lexer) Consume

func (l *Lexer) Consume()

Consume whitespace and tokens equivalent to whitespace (e.g. commas and comments).

Consumed comment characters will build the description for the next type or field encountered. The description is available from `DescComment()`, and will be reset every time `Consume()` is executed.

func (*Lexer) ConsumeIdent

func (l *Lexer) ConsumeIdent() string

func (*Lexer) ConsumeIdentWithLoc

func (l *Lexer) ConsumeIdentWithLoc() Ident

func (*Lexer) ConsumeKeyword

func (l *Lexer) ConsumeKeyword(keyword string)

func (*Lexer) ConsumeLiteral

func (l *Lexer) ConsumeLiteral() *BasicLit

func (*Lexer) ConsumeToken

func (l *Lexer) ConsumeToken(expected rune)

func (*Lexer) DescComment

func (l *Lexer) DescComment() string

func (*Lexer) Location

func (l *Lexer) Location() errors.Location

func (*Lexer) Peek

func (l *Lexer) Peek() rune

func (*Lexer) SyntaxError

func (l *Lexer) SyntaxError(message string)

type List

type List struct {
	OfType Type
}

func (*List) Kind

func (*List) Kind() string

func (*List) String

func (t *List) String() string

type ListLit

type ListLit struct {
	Entries []Literal
	Loc     errors.Location
}

func (*ListLit) Location

func (lit *ListLit) Location() errors.Location

func (*ListLit) String

func (lit *ListLit) String() string

func (*ListLit) Value

func (lit *ListLit) Value(vars map[string]interface{}) interface{}

type Literal

type Literal interface {
	Value(vars map[string]interface{}) interface{}
	String() string
	Location() errors.Location
}

func ParseLiteral

func ParseLiteral(l *Lexer, constOnly bool) Literal

type NonNull

type NonNull struct {
	OfType Type
}

func (*NonNull) Kind

func (*NonNull) Kind() string

func (*NonNull) String

func (t *NonNull) String() string

type NullLit

type NullLit struct {
	Loc errors.Location
}

func (*NullLit) Location

func (lit *NullLit) Location() errors.Location

func (*NullLit) String

func (lit *NullLit) String() string

func (*NullLit) Value

func (lit *NullLit) Value(vars map[string]interface{}) interface{}

type ObjectLit

type ObjectLit struct {
	Fields []*ObjectLitField
	Loc    errors.Location
}

func (*ObjectLit) Location

func (lit *ObjectLit) Location() errors.Location

func (*ObjectLit) String

func (lit *ObjectLit) String() string

func (*ObjectLit) Value

func (lit *ObjectLit) Value(vars map[string]interface{}) interface{}

type ObjectLitField

type ObjectLitField struct {
	Name  Ident
	Value Literal
}

type Resolver

type Resolver func(name string) Type

type Type

type Type interface {
	Kind() string
	String() string
}

func ParseType

func ParseType(l *Lexer) Type

func ResolveType

func ResolveType(t Type, resolver Resolver) (Type, *errors.QueryError)

type TypeName

type TypeName struct {
	Ident
}

func (*TypeName) Kind

func (*TypeName) Kind() string

func (*TypeName) String

func (*TypeName) String() string

type Variable

type Variable struct {
	Name string
	Loc  errors.Location
}

func (*Variable) Location

func (v *Variable) Location() errors.Location

func (Variable) String

func (v Variable) String() string

func (Variable) Value

func (v Variable) Value(vars map[string]interface{}) interface{}

Jump to

Keyboard shortcuts

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