ast

package
v0.0.0-...-72fbe86 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Code generated by tools/listgen DO NOT EDIT!

Index

Constants

This section is empty.

Variables

View Source
var NamesByDirectiveLocations = map[DirectiveLocation]string{
	DirectiveLocationKindQuery:                "QUERY",
	DirectiveLocationKindMutation:             "MUTATION",
	DirectiveLocationKindSubscription:         "SUBSCRIPTION",
	DirectiveLocationKindField:                "FIELD",
	DirectiveLocationKindFragmentDefinition:   "FRAGMENT_DEFINITION",
	DirectiveLocationKindFragmentSpread:       "FRAGMENT_SPREAD",
	DirectiveLocationKindInlineFragment:       "INLINE_FRAGMENT",
	DirectiveLocationKindVariableDefinition:   "VARIABLE_DEFINITION",
	DirectiveLocationKindSchema:               "SCHEMA",
	DirectiveLocationKindScalar:               "SCALAR",
	DirectiveLocationKindObject:               "OBJECT",
	DirectiveLocationKindFieldDefinition:      "FIELD_DEFINITION",
	DirectiveLocationKindArgumentDefinition:   "ARGUMENT_DEFINITION",
	DirectiveLocationKindInterface:            "INTERFACE",
	DirectiveLocationKindUnion:                "UNION",
	DirectiveLocationKindEnum:                 "ENUM",
	DirectiveLocationKindEnumValue:            "ENUM_VALUE",
	DirectiveLocationKindInputObject:          "INPUT_OBJECT",
	DirectiveLocationKindInputFieldDefinition: "INPUT_FIELD_DEFINITION",
}

Functions

func Dump

func Dump(doc Document)

Dump ...

func Fdump

func Fdump(w io.Writer, doc Document)

Fdump ...

func IsEnumTypeDefinition

func IsEnumTypeDefinition(def *TypeDefinition) bool

IsEnumTypeDefinition ...

func IsEnumTypeExtension

func IsEnumTypeExtension(def *TypeExtension) bool

IsEnumTypeExtension ...

func IsInputObjectTypeDefinition

func IsInputObjectTypeDefinition(def *TypeDefinition) bool

IsInputObjectTypeDefinition ...

func IsInputObjectTypeExtension

func IsInputObjectTypeExtension(def *TypeExtension) bool

IsInputObjectTypeExtension ...

func IsInterfaceTypeDefinition

func IsInterfaceTypeDefinition(def *TypeDefinition) bool

IsInterfaceTypeDefinition ...

func IsInterfaceTypeExtension

func IsInterfaceTypeExtension(def *TypeExtension) bool

IsInterfaceTypeExtension ...

func IsObjectTypeDefinition

func IsObjectTypeDefinition(def *TypeDefinition) bool

IsObjectTypeDefinition ...

func IsObjectTypeExtension

func IsObjectTypeExtension(def *TypeExtension) bool

IsObjectTypeExtension ...

func IsScalarTypeDefinition

func IsScalarTypeDefinition(def *TypeDefinition) bool

IsScalarTypeDefinition ...

func IsScalarTypeExtension

func IsScalarTypeExtension(def *TypeExtension) bool

IsScalarTypeExtension ...

func IsUnionTypeDefinition

func IsUnionTypeDefinition(def *TypeDefinition) bool

IsUnionTypeDefinition ...

func IsUnionTypeExtension

func IsUnionTypeExtension(def *TypeExtension) bool

IsUnionTypeExtension ...

func Sdump

func Sdump(doc Document) string

Sdump prints the given AST document as a GraphQL document string, allowing the parser to be easily validated against some given input. In fact, if formatted the same, the output of this function should match the input query given to the parser to produce the AST.

Types

type Argument

type Argument struct {
	Name  string
	Value Value
}

Argument :

type Arguments

type Arguments struct {
	Data Argument
	// contains filtered or unexported fields
}

Arguments is a linked list that contains Argument values.

func ArgumentsFromSlice

func ArgumentsFromSlice(sl []Argument) *Arguments

ArgumentsFromSlice returns a Arguments list from a slice of Argument.

func (*Arguments) Add

func (as *Arguments) Add(data Argument) *Arguments

Add appends a Argument to this linked list and returns this new head.

func (*Arguments) ForEach

func (as *Arguments) ForEach(fn func(a Argument, i int))

ForEach applies the given map function to each item in this linked list.

func (*Arguments) Generator

func (as *Arguments) Generator() ArgumentsGenerator

Generator returns a "Generator" type for this list, allowing for much more efficient iteration over items within this linked list than using ForEach, though ForEach may still be more convenient, because ForEach is a high order function, it's slower.

func (*Arguments) Insert

func (as *Arguments) Insert(a Argument, pos int) *Arguments

Insert places the Argument in the position given by pos. The method will insert at top if pos is greater than or equal to list length. The method will insert at bottom if the pos is less than 0.

func (*Arguments) Join

func (as *Arguments) Join(otherList *Arguments)

Join attaches the tail of the receiver list "as" to the head of the otherList.

func (*Arguments) Len

func (as *Arguments) Len() int

Len returns the length of this linked list.

func (*Arguments) Reverse

func (as *Arguments) Reverse() *Arguments

Reverse reverses this linked list of Argument. Usually when the linked list is being constructed the result will be last-to-first, so we'll want to reverse it to get it in the "right" order.

type ArgumentsGenerator

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

ArgumentsGenerator is a type used to iterate efficiently over Arguments. @wg:ignore

func (*ArgumentsGenerator) Next

func (g *ArgumentsGenerator) Next() (Argument, int)

Next returns the current value, and it's index in the list, and sets up the next value to be returned.

func (*ArgumentsGenerator) Reset

func (g *ArgumentsGenerator) Reset()

Reset returns this generator to it's initial state, allowing it to be used again to iterate over this linked list.

type Definition

type Definition struct {
	Location             Location
	ExecutableDefinition *ExecutableDefinition
	TypeSystemDefinition *TypeSystemDefinition
	TypeSystemExtension  *TypeSystemExtension
	Kind                 DefinitionKind
}

type DefinitionKind

type DefinitionKind int8
const (
	// @wg:field ExecutableDefinition
	DefinitionKindExecutable DefinitionKind = iota
	// @wg:field TypeSystemDefinition
	DefinitionKindTypeSystem
	// @wg:field TypeSystemExtension
	DefinitionKindTypeSystemExtension
)

func (DefinitionKind) String

func (k DefinitionKind) String() string

type Definitions

type Definitions struct {
	Data Definition
	// contains filtered or unexported fields
}

Definitions is a linked list that contains Definition values.

func DefinitionsFromSlice

func DefinitionsFromSlice(sl []Definition) *Definitions

DefinitionsFromSlice returns a Definitions list from a slice of Definition.

func (*Definitions) Add

func (ds *Definitions) Add(data Definition) *Definitions

Add appends a Definition to this linked list and returns this new head.

func (*Definitions) ForEach

func (ds *Definitions) ForEach(fn func(d Definition, i int))

ForEach applies the given map function to each item in this linked list.

func (*Definitions) Generator

func (ds *Definitions) Generator() DefinitionsGenerator

Generator returns a "Generator" type for this list, allowing for much more efficient iteration over items within this linked list than using ForEach, though ForEach may still be more convenient, because ForEach is a high order function, it's slower.

func (*Definitions) Insert

func (ds *Definitions) Insert(d Definition, pos int) *Definitions

Insert places the Definition in the position given by pos. The method will insert at top if pos is greater than or equal to list length. The method will insert at bottom if the pos is less than 0.

func (*Definitions) Join

func (ds *Definitions) Join(otherList *Definitions)

Join attaches the tail of the receiver list "ds" to the head of the otherList.

func (*Definitions) Len

func (ds *Definitions) Len() int

Len returns the length of this linked list.

func (*Definitions) Reverse

func (ds *Definitions) Reverse() *Definitions

Reverse reverses this linked list of Definition. Usually when the linked list is being constructed the result will be last-to-first, so we'll want to reverse it to get it in the "right" order.

type DefinitionsGenerator

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

DefinitionsGenerator is a type used to iterate efficiently over Definitions. @wg:ignore

func (*DefinitionsGenerator) Next

func (g *DefinitionsGenerator) Next() (Definition, int)

Next returns the current value, and it's index in the list, and sets up the next value to be returned.

func (*DefinitionsGenerator) Reset

func (g *DefinitionsGenerator) Reset()

Reset returns this generator to it's initial state, allowing it to be used again to iterate over this linked list.

type Directive

type Directive struct {
	Name      string
	Arguments *Arguments
	Location  DirectiveLocation
}

Directive :

type DirectiveDefinition

type DirectiveDefinition struct {
	Description         string
	Name                string
	ArgumentsDefinition *InputValueDefinitions
	DirectiveLocations  DirectiveLocation
}

type DirectiveLocation

type DirectiveLocation int32
const (
	DirectiveLocationKindQuery DirectiveLocation = 1 << iota
	DirectiveLocationKindMutation
	DirectiveLocationKindSubscription
	DirectiveLocationKindField
	DirectiveLocationKindFragmentDefinition
	DirectiveLocationKindFragmentSpread
	DirectiveLocationKindInlineFragment
	DirectiveLocationKindVariableDefinition
	DirectiveLocationKindSchema
	DirectiveLocationKindScalar
	DirectiveLocationKindObject
	DirectiveLocationKindFieldDefinition
	DirectiveLocationKindArgumentDefinition
	DirectiveLocationKindInterface
	DirectiveLocationKindUnion
	DirectiveLocationKindEnum
	DirectiveLocationKindEnumValue
	DirectiveLocationKindInputObject
	DirectiveLocationKindInputFieldDefinition
)

func (DirectiveLocation) String

func (l DirectiveLocation) String() string

type Directives

type Directives struct {
	Data Directive
	// contains filtered or unexported fields
}

Directives is a linked list that contains Directive values.

func DirectivesFromSlice

func DirectivesFromSlice(sl []Directive) *Directives

DirectivesFromSlice returns a Directives list from a slice of Directive.

func (*Directives) Add

func (ds *Directives) Add(data Directive) *Directives

Add appends a Directive to this linked list and returns this new head.

func (*Directives) ForEach

func (ds *Directives) ForEach(fn func(d Directive, i int))

ForEach applies the given map function to each item in this linked list.

func (*Directives) Generator

func (ds *Directives) Generator() DirectivesGenerator

Generator returns a "Generator" type for this list, allowing for much more efficient iteration over items within this linked list than using ForEach, though ForEach may still be more convenient, because ForEach is a high order function, it's slower.

func (*Directives) Insert

func (ds *Directives) Insert(d Directive, pos int) *Directives

Insert places the Directive in the position given by pos. The method will insert at top if pos is greater than or equal to list length. The method will insert at bottom if the pos is less than 0.

func (*Directives) Join

func (ds *Directives) Join(otherList *Directives)

Join attaches the tail of the receiver list "ds" to the head of the otherList.

func (*Directives) Len

func (ds *Directives) Len() int

Len returns the length of this linked list.

func (*Directives) Reverse

func (ds *Directives) Reverse() *Directives

Reverse reverses this linked list of Directive. Usually when the linked list is being constructed the result will be last-to-first, so we'll want to reverse it to get it in the "right" order.

type DirectivesGenerator

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

DirectivesGenerator is a type used to iterate efficiently over Directives. @wg:ignore

func (*DirectivesGenerator) Next

func (g *DirectivesGenerator) Next() (Directive, int)

Next returns the current value, and it's index in the list, and sets up the next value to be returned.

func (*DirectivesGenerator) Reset

func (g *DirectivesGenerator) Reset()

Reset returns this generator to it's initial state, allowing it to be used again to iterate over this linked list.

type Document

type Document struct {
	Definitions          *Definitions
	OperationDefinitions int32
	FragmentDefinitions  int32
	DirectiveDefinitions int32
	SchemaDefinitions    int32
	TypeDefinitions      int32
	SchemaExtensions     int32
	TypeExtensions       int32
}

type EnumValueDefinition

type EnumValueDefinition struct {
	Description string
	Directives  *Directives
	EnumValue   string // Name but not true or false or null.
}

type EnumValueDefinitions

type EnumValueDefinitions struct {
	Data EnumValueDefinition
	// contains filtered or unexported fields
}

EnumValueDefinitions is a linked list that contains EnumValueDefinition values.

func EnumValueDefinitionsFromSlice

func EnumValueDefinitionsFromSlice(sl []EnumValueDefinition) *EnumValueDefinitions

EnumValueDefinitionsFromSlice returns a EnumValueDefinitions list from a slice of EnumValueDefinition.

func (*EnumValueDefinitions) Add

Add appends a EnumValueDefinition to this linked list and returns this new head.

func (*EnumValueDefinitions) ForEach

func (evds *EnumValueDefinitions) ForEach(fn func(evd EnumValueDefinition, i int))

ForEach applies the given map function to each item in this linked list.

func (*EnumValueDefinitions) Generator

Generator returns a "Generator" type for this list, allowing for much more efficient iteration over items within this linked list than using ForEach, though ForEach may still be more convenient, because ForEach is a high order function, it's slower.

func (*EnumValueDefinitions) Insert

Insert places the EnumValueDefinition in the position given by pos. The method will insert at top if pos is greater than or equal to list length. The method will insert at bottom if the pos is less than 0.

func (*EnumValueDefinitions) Join

func (evds *EnumValueDefinitions) Join(otherList *EnumValueDefinitions)

Join attaches the tail of the receiver list "evds" to the head of the otherList.

func (*EnumValueDefinitions) Len

func (evds *EnumValueDefinitions) Len() int

Len returns the length of this linked list.

func (*EnumValueDefinitions) Reverse

func (evds *EnumValueDefinitions) Reverse() *EnumValueDefinitions

Reverse reverses this linked list of EnumValueDefinition. Usually when the linked list is being constructed the result will be last-to-first, so we'll want to reverse it to get it in the "right" order.

type EnumValueDefinitionsGenerator

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

EnumValueDefinitionsGenerator is a type used to iterate efficiently over EnumValueDefinitions. @wg:ignore

func (*EnumValueDefinitionsGenerator) Next

Next returns the current value, and it's index in the list, and sets up the next value to be returned.

func (*EnumValueDefinitionsGenerator) Reset

func (g *EnumValueDefinitionsGenerator) Reset()

Reset returns this generator to it's initial state, allowing it to be used again to iterate over this linked list.

type ExecutableDefinition

type ExecutableDefinition struct {
	FragmentDefinition  *FragmentDefinition
	OperationDefinition *OperationDefinition
	Kind                ExecutableDefinitionKind
}

func (ExecutableDefinition) String

func (def ExecutableDefinition) String() string

type ExecutableDefinitionKind

type ExecutableDefinitionKind int8
const (
	// @wg:field OperationDefinition
	ExecutableDefinitionKindOperation ExecutableDefinitionKind = iota
	// @wg:field FragmentDefinition
	ExecutableDefinitionKindFragment
)

func (ExecutableDefinitionKind) String

func (k ExecutableDefinitionKind) String() string

type FieldDefinition

type FieldDefinition struct {
	Description         string
	Name                string
	ArgumentsDefinition *InputValueDefinitions
	Type                Type
	Directives          *Directives
}

type FieldDefinitions

type FieldDefinitions struct {
	Data FieldDefinition
	// contains filtered or unexported fields
}

FieldDefinitions is a linked list that contains FieldDefinition values.

func FieldDefinitionsFromSlice

func FieldDefinitionsFromSlice(sl []FieldDefinition) *FieldDefinitions

FieldDefinitionsFromSlice returns a FieldDefinitions list from a slice of FieldDefinition.

func (*FieldDefinitions) Add

Add appends a FieldDefinition to this linked list and returns this new head.

func (*FieldDefinitions) ForEach

func (fds *FieldDefinitions) ForEach(fn func(fd FieldDefinition, i int))

ForEach applies the given map function to each item in this linked list.

func (*FieldDefinitions) Generator

Generator returns a "Generator" type for this list, allowing for much more efficient iteration over items within this linked list than using ForEach, though ForEach may still be more convenient, because ForEach is a high order function, it's slower.

func (*FieldDefinitions) Insert

func (fds *FieldDefinitions) Insert(fd FieldDefinition, pos int) *FieldDefinitions

Insert places the FieldDefinition in the position given by pos. The method will insert at top if pos is greater than or equal to list length. The method will insert at bottom if the pos is less than 0.

func (*FieldDefinitions) Join

func (fds *FieldDefinitions) Join(otherList *FieldDefinitions)

Join attaches the tail of the receiver list "fds" to the head of the otherList.

func (*FieldDefinitions) Len

func (fds *FieldDefinitions) Len() int

Len returns the length of this linked list.

func (*FieldDefinitions) Reverse

func (fds *FieldDefinitions) Reverse() *FieldDefinitions

Reverse reverses this linked list of FieldDefinition. Usually when the linked list is being constructed the result will be last-to-first, so we'll want to reverse it to get it in the "right" order.

type FieldDefinitionsGenerator

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

FieldDefinitionsGenerator is a type used to iterate efficiently over FieldDefinitions. @wg:ignore

func (*FieldDefinitionsGenerator) Next

Next returns the current value, and it's index in the list, and sets up the next value to be returned.

func (*FieldDefinitionsGenerator) Reset

func (g *FieldDefinitionsGenerator) Reset()

Reset returns this generator to it's initial state, allowing it to be used again to iterate over this linked list.

type FragmentDefinition

type FragmentDefinition struct {
	Name          string
	TypeCondition *TypeCondition
	Directives    *Directives
	SelectionSet  *Selections
}

type InputValueDefinition

type InputValueDefinition struct {
	Description  string
	Name         string
	Type         Type
	Directives   *Directives
	DefaultValue *Value
}

type InputValueDefinitions

type InputValueDefinitions struct {
	Data InputValueDefinition
	// contains filtered or unexported fields
}

InputValueDefinitions is a linked list that contains InputValueDefinition values.

func InputValueDefinitionsFromSlice

func InputValueDefinitionsFromSlice(sl []InputValueDefinition) *InputValueDefinitions

InputValueDefinitionsFromSlice returns a InputValueDefinitions list from a slice of InputValueDefinition.

func (*InputValueDefinitions) Add

Add appends a InputValueDefinition to this linked list and returns this new head.

func (*InputValueDefinitions) ForEach

func (ivds *InputValueDefinitions) ForEach(fn func(ivd InputValueDefinition, i int))

ForEach applies the given map function to each item in this linked list.

func (*InputValueDefinitions) Generator

Generator returns a "Generator" type for this list, allowing for much more efficient iteration over items within this linked list than using ForEach, though ForEach may still be more convenient, because ForEach is a high order function, it's slower.

func (*InputValueDefinitions) Insert

Insert places the InputValueDefinition in the position given by pos. The method will insert at top if pos is greater than or equal to list length. The method will insert at bottom if the pos is less than 0.

func (*InputValueDefinitions) Join

func (ivds *InputValueDefinitions) Join(otherList *InputValueDefinitions)

Join attaches the tail of the receiver list "ivds" to the head of the otherList.

func (*InputValueDefinitions) Len

func (ivds *InputValueDefinitions) Len() int

Len returns the length of this linked list.

func (*InputValueDefinitions) Reverse

Reverse reverses this linked list of InputValueDefinition. Usually when the linked list is being constructed the result will be last-to-first, so we'll want to reverse it to get it in the "right" order.

type InputValueDefinitionsGenerator

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

InputValueDefinitionsGenerator is a type used to iterate efficiently over InputValueDefinitions. @wg:ignore

func (*InputValueDefinitionsGenerator) Next

Next returns the current value, and it's index in the list, and sets up the next value to be returned.

func (*InputValueDefinitionsGenerator) Reset

func (g *InputValueDefinitionsGenerator) Reset()

Reset returns this generator to it's initial state, allowing it to be used again to iterate over this linked list.

type Location

type Location struct {
	Line   int
	Column int
}

Location contains location information about where an AST type is in a document.

type Locations

type Locations struct {
	Data Location
	// contains filtered or unexported fields
}

Locations is a linked list that contains Location values.

func LocationsFromSlice

func LocationsFromSlice(sl []Location) *Locations

LocationsFromSlice returns a Locations list from a slice of Location.

func (*Locations) Add

func (ls *Locations) Add(data Location) *Locations

Add appends a Location to this linked list and returns this new head.

func (*Locations) ForEach

func (ls *Locations) ForEach(fn func(l Location, i int))

ForEach applies the given map function to each item in this linked list.

func (*Locations) Generator

func (ls *Locations) Generator() LocationsGenerator

Generator returns a "Generator" type for this list, allowing for much more efficient iteration over items within this linked list than using ForEach, though ForEach may still be more convenient, because ForEach is a high order function, it's slower.

func (*Locations) Insert

func (ls *Locations) Insert(l Location, pos int) *Locations

Insert places the Location in the position given by pos. The method will insert at top if pos is greater than or equal to list length. The method will insert at bottom if the pos is less than 0.

func (*Locations) Join

func (ls *Locations) Join(otherList *Locations)

Join attaches the tail of the receiver list "ls" to the head of the otherList.

func (*Locations) Len

func (ls *Locations) Len() int

Len returns the length of this linked list.

func (*Locations) Reverse

func (ls *Locations) Reverse() *Locations

Reverse reverses this linked list of Location. Usually when the linked list is being constructed the result will be last-to-first, so we'll want to reverse it to get it in the "right" order.

type LocationsGenerator

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

LocationsGenerator is a type used to iterate efficiently over Locations. @wg:ignore

func (*LocationsGenerator) Next

func (g *LocationsGenerator) Next() (Location, int)

Next returns the current value, and it's index in the list, and sets up the next value to be returned.

func (*LocationsGenerator) Reset

func (g *LocationsGenerator) Reset()

Reset returns this generator to it's initial state, allowing it to be used again to iterate over this linked list.

type ObjectField

type ObjectField struct {
	Name  string
	Value Value
}

type OperationDefinition

type OperationDefinition struct {
	Name                string
	VariableDefinitions *VariableDefinitions
	Directives          *Directives
	SelectionSet        *Selections
	Kind                OperationDefinitionKind
}

type OperationDefinitionKind

type OperationDefinitionKind int8
const (
	OperationDefinitionKindQuery OperationDefinitionKind = iota
	OperationDefinitionKindMutation
	OperationDefinitionKindSubscription
)

@wg:field self

func (OperationDefinitionKind) String

func (t OperationDefinitionKind) String() string

type OperationTypeDefinition

type OperationTypeDefinition struct {
	NamedType     Type
	OperationType OperationDefinitionKind
}

type OperationTypeDefinitions

type OperationTypeDefinitions struct {
	Data OperationTypeDefinition
	// contains filtered or unexported fields
}

OperationTypeDefinitions is a linked list that contains OperationTypeDefinition values.

func OperationTypeDefinitionsFromSlice

func OperationTypeDefinitionsFromSlice(sl []OperationTypeDefinition) *OperationTypeDefinitions

OperationTypeDefinitionsFromSlice returns a OperationTypeDefinitions list from a slice of OperationTypeDefinition.

func (*OperationTypeDefinitions) Add

Add appends a OperationTypeDefinition to this linked list and returns this new head.

func (*OperationTypeDefinitions) ForEach

func (otds *OperationTypeDefinitions) ForEach(fn func(otd OperationTypeDefinition, i int))

ForEach applies the given map function to each item in this linked list.

func (*OperationTypeDefinitions) Generator

Generator returns a "Generator" type for this list, allowing for much more efficient iteration over items within this linked list than using ForEach, though ForEach may still be more convenient, because ForEach is a high order function, it's slower.

func (*OperationTypeDefinitions) Insert

Insert places the OperationTypeDefinition in the position given by pos. The method will insert at top if pos is greater than or equal to list length. The method will insert at bottom if the pos is less than 0.

func (*OperationTypeDefinitions) Join

func (otds *OperationTypeDefinitions) Join(otherList *OperationTypeDefinitions)

Join attaches the tail of the receiver list "otds" to the head of the otherList.

func (*OperationTypeDefinitions) Len

func (otds *OperationTypeDefinitions) Len() int

Len returns the length of this linked list.

func (*OperationTypeDefinitions) Reverse

Reverse reverses this linked list of OperationTypeDefinition. Usually when the linked list is being constructed the result will be last-to-first, so we'll want to reverse it to get it in the "right" order.

type OperationTypeDefinitionsGenerator

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

OperationTypeDefinitionsGenerator is a type used to iterate efficiently over OperationTypeDefinitions. @wg:ignore

func (*OperationTypeDefinitionsGenerator) Next

Next returns the current value, and it's index in the list, and sets up the next value to be returned.

func (*OperationTypeDefinitionsGenerator) Reset

Reset returns this generator to it's initial state, allowing it to be used again to iterate over this linked list.

type PathNode

type PathNode struct {
	Kind   PathNodeKind
	String string
	Int    int
}

PathNode is an individual part of the path.

func NewIntPathNode

func NewIntPathNode(i int) PathNode

NewIntPathNode returns a new PathNode with the given int as it's value.

func NewStringPathNode

func NewStringPathNode(s string) PathNode

NewStringPathNode returns a new PathNode with the given string as it's value.

type PathNodeKind

type PathNodeKind uint8

PathNodeKind an enum type that defines the type of data stored in a PathNode.

const (
	PathNodeKindString PathNodeKind = iota
	PathNodeKindInt
)

@wg:field self

type PathNodes

type PathNodes struct {
	Data PathNode
	// contains filtered or unexported fields
}

PathNodes is a linked list that contains PathNode values.

func PathNodesFromSlice

func PathNodesFromSlice(sl []PathNode) *PathNodes

PathNodesFromSlice returns a PathNodes list from a slice of PathNode.

func (*PathNodes) Add

func (pns *PathNodes) Add(data PathNode) *PathNodes

Add appends a PathNode to this linked list and returns this new head.

func (*PathNodes) ForEach

func (pns *PathNodes) ForEach(fn func(pn PathNode, i int))

ForEach applies the given map function to each item in this linked list.

func (*PathNodes) Generator

func (pns *PathNodes) Generator() PathNodesGenerator

Generator returns a "Generator" type for this list, allowing for much more efficient iteration over items within this linked list than using ForEach, though ForEach may still be more convenient, because ForEach is a high order function, it's slower.

func (*PathNodes) Insert

func (pns *PathNodes) Insert(pn PathNode, pos int) *PathNodes

Insert places the PathNode in the position given by pos. The method will insert at top if pos is greater than or equal to list length. The method will insert at bottom if the pos is less than 0.

func (*PathNodes) Join

func (pns *PathNodes) Join(otherList *PathNodes)

Join attaches the tail of the receiver list "pns" to the head of the otherList.

func (*PathNodes) Len

func (pns *PathNodes) Len() int

Len returns the length of this linked list.

func (*PathNodes) Reverse

func (pns *PathNodes) Reverse() *PathNodes

Reverse reverses this linked list of PathNode. Usually when the linked list is being constructed the result will be last-to-first, so we'll want to reverse it to get it in the "right" order.

type PathNodesGenerator

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

PathNodesGenerator is a type used to iterate efficiently over PathNodes. @wg:ignore

func (*PathNodesGenerator) Next

func (g *PathNodesGenerator) Next() (PathNode, int)

Next returns the current value, and it's index in the list, and sets up the next value to be returned.

func (*PathNodesGenerator) Reset

func (g *PathNodesGenerator) Reset()

Reset returns this generator to it's initial state, allowing it to be used again to iterate over this linked list.

type SchemaDefinition

type SchemaDefinition struct {
	Directives               *Directives
	OperationTypeDefinitions *OperationTypeDefinitions
}

type SchemaExtension

type SchemaExtension struct {
	Directives               *Directives
	OperationTypeDefinitions *OperationTypeDefinitions
}

3.2.2 Schema Extension

type Selection

type Selection struct {
	Name  string // but not "on"
	Alias string
	// @wg:on_kinds InlineFragmentSelection
	TypeCondition *TypeCondition
	Arguments     *Arguments
	Directives    *Directives
	SelectionSet  *Selections
	Path          *PathNodes
	Kind          SelectionKind
}

type SelectionKind

type SelectionKind int8
const (
	SelectionKindField SelectionKind = iota
	SelectionKindFragmentSpread
	SelectionKindInlineFragment
)

@wg:field self

func (SelectionKind) String

func (k SelectionKind) String() string

type Selections

type Selections struct {
	Data Selection
	// contains filtered or unexported fields
}

Selections is a linked list that contains Selection values.

func SelectionsFromSlice

func SelectionsFromSlice(sl []Selection) *Selections

SelectionsFromSlice returns a Selections list from a slice of Selection.

func (*Selections) Add

func (ss *Selections) Add(data Selection) *Selections

Add appends a Selection to this linked list and returns this new head.

func (*Selections) ForEach

func (ss *Selections) ForEach(fn func(s Selection, i int))

ForEach applies the given map function to each item in this linked list.

func (*Selections) Generator

func (ss *Selections) Generator() SelectionsGenerator

Generator returns a "Generator" type for this list, allowing for much more efficient iteration over items within this linked list than using ForEach, though ForEach may still be more convenient, because ForEach is a high order function, it's slower.

func (*Selections) Insert

func (ss *Selections) Insert(s Selection, pos int) *Selections

Insert places the Selection in the position given by pos. The method will insert at top if pos is greater than or equal to list length. The method will insert at bottom if the pos is less than 0.

func (*Selections) Join

func (ss *Selections) Join(otherList *Selections)

Join attaches the tail of the receiver list "ss" to the head of the otherList.

func (*Selections) Len

func (ss *Selections) Len() int

Len returns the length of this linked list.

func (*Selections) Reverse

func (ss *Selections) Reverse() *Selections

Reverse reverses this linked list of Selection. Usually when the linked list is being constructed the result will be last-to-first, so we'll want to reverse it to get it in the "right" order.

type SelectionsGenerator

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

SelectionsGenerator is a type used to iterate efficiently over Selections. @wg:ignore

func (*SelectionsGenerator) Next

func (g *SelectionsGenerator) Next() (Selection, int)

Next returns the current value, and it's index in the list, and sets up the next value to be returned.

func (*SelectionsGenerator) Reset

func (g *SelectionsGenerator) Reset()

Reset returns this generator to it's initial state, allowing it to be used again to iterate over this linked list.

type Type

type Type struct {
	NamedType   string
	ListType    *Type
	NonNullable bool
	Kind        TypeKind
}

func (Type) String

func (t Type) String() string

type TypeCondition

type TypeCondition struct {
	NamedType Type // Only allow "TypeKindNamed" kind NamedType.
}

type TypeDefinition

type TypeDefinition struct {
	Description           string
	Name                  string
	ImplementsInterface   *Types // Only allow "TypeKindNamed" kind NamedType.
	Directives            *Directives
	FieldsDefinition      *FieldDefinitions
	UnionMemberTypes      *Types // Only allow "TypeKindNamed" kind NamedType.
	EnumValuesDefinition  *EnumValueDefinitions
	InputFieldsDefinition *InputValueDefinitions
	Kind                  TypeDefinitionKind
}

func (TypeDefinition) EnumValueDefinitionByName

func (d TypeDefinition) EnumValueDefinitionByName(valueName string) (EnumValueDefinition, bool)

EnumValueDefinitionByName ...

func (TypeDefinition) FieldDefinitionByName

func (d TypeDefinition) FieldDefinitionByName(fieldName string) (FieldDefinition, bool)

FieldDefinitionByName ...

type TypeDefinitionKind

type TypeDefinitionKind int8
const (
	TypeDefinitionKindScalar TypeDefinitionKind = iota
	TypeDefinitionKindObject
	TypeDefinitionKindInterface
	TypeDefinitionKindUnion
	TypeDefinitionKindEnum
	TypeDefinitionKindInputObject
)

@wg:field self

func (TypeDefinitionKind) String

func (k TypeDefinitionKind) String() string

String ...

type TypeExtension

type TypeExtension struct {
	Directives            *Directives
	ImplementsInterface   *Types // Only allow "TypeKindNamed" kind NamedType.
	FieldsDefinition      *FieldDefinitions
	UnionMemberTypes      *Types // Only allow "TypeKindNamed" kind NamedType.
	EnumValuesDefinition  *EnumValueDefinitions
	InputFieldsDefinition *InputValueDefinitions
	Name                  string
	Kind                  TypeExtensionKind
}

type TypeExtensionKind

type TypeExtensionKind int8
const (
	TypeExtensionKindScalar TypeExtensionKind = iota
	TypeExtensionKindObject
	TypeExtensionKindInterface
	TypeExtensionKindUnion
	TypeExtensionKindEnum
	TypeExtensionKindInputObject
)

3.4.3 Type Extensions @wg:field self

type TypeKind

type TypeKind int8
const (
	TypeKindNamed TypeKind = iota
	TypeKindList
)

@wg:field self

func (TypeKind) String

func (k TypeKind) String() string

type TypeSystemDefinition

type TypeSystemDefinition struct {
	SchemaDefinition    *SchemaDefinition
	TypeDefinition      *TypeDefinition
	DirectiveDefinition *DirectiveDefinition
	Kind                TypeSystemDefinitionKind
}

type TypeSystemDefinitionKind

type TypeSystemDefinitionKind int8
const (
	// @wg:field SchemaDefinition
	TypeSystemDefinitionKindSchema TypeSystemDefinitionKind = iota
	// @wg:field TypeDefinition
	TypeSystemDefinitionKindType
	// @wg:field DirectiveDefinition
	TypeSystemDefinitionKindDirective
)

func (TypeSystemDefinitionKind) String

func (k TypeSystemDefinitionKind) String() string

type TypeSystemExtension

type TypeSystemExtension struct {
	SchemaExtension *SchemaExtension
	TypeExtension   *TypeExtension
	Kind            TypeSystemExtensionKind
}

type TypeSystemExtensionKind

type TypeSystemExtensionKind uint8
const (
	// @wg:field SchemaExtension
	TypeSystemExtensionKindSchema TypeSystemExtensionKind = iota
	// @wg:field TypeExtension
	TypeSystemExtensionKindType
)

3.1 Type System Extensions

type Types

type Types struct {
	Data Type
	// contains filtered or unexported fields
}

Types is a linked list that contains Type values.

func TypesFromSlice

func TypesFromSlice(sl []Type) *Types

TypesFromSlice returns a Types list from a slice of Type.

func (*Types) Add

func (ts *Types) Add(data Type) *Types

Add appends a Type to this linked list and returns this new head.

func (*Types) ForEach

func (ts *Types) ForEach(fn func(t Type, i int))

ForEach applies the given map function to each item in this linked list.

func (*Types) Generator

func (ts *Types) Generator() TypesGenerator

Generator returns a "Generator" type for this list, allowing for much more efficient iteration over items within this linked list than using ForEach, though ForEach may still be more convenient, because ForEach is a high order function, it's slower.

func (*Types) Insert

func (ts *Types) Insert(t Type, pos int) *Types

Insert places the Type in the position given by pos. The method will insert at top if pos is greater than or equal to list length. The method will insert at bottom if the pos is less than 0.

func (*Types) Join

func (ts *Types) Join(otherList *Types)

Join attaches the tail of the receiver list "ts" to the head of the otherList.

func (*Types) Len

func (ts *Types) Len() int

Len returns the length of this linked list.

func (*Types) Reverse

func (ts *Types) Reverse() *Types

Reverse reverses this linked list of Type. Usually when the linked list is being constructed the result will be last-to-first, so we'll want to reverse it to get it in the "right" order.

type TypesGenerator

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

TypesGenerator is a type used to iterate efficiently over Types. @wg:ignore

func (*TypesGenerator) Next

func (g *TypesGenerator) Next() (Type, int)

Next returns the current value, and it's index in the list, and sets up the next value to be returned.

func (*TypesGenerator) Reset

func (g *TypesGenerator) Reset()

Reset returns this generator to it's initial state, allowing it to be used again to iterate over this linked list.

type Value

type Value struct {
	IntValue   int
	FloatValue float64
	// StringValue covers variables and enums, enums are names, but not `true`, `false`, or `null`.
	StringValue string
	// @wg:on_kinds ListValue
	ListValue []Value
	// @wg:on_kinds ObjectValue
	ObjectValue  []ObjectField
	BooleanValue bool
	Kind         ValueKind
}

type ValueKind

type ValueKind int8
const (
	ValueKindVariable ValueKind = iota
	ValueKindInt
	ValueKindFloat
	ValueKindString
	ValueKindBoolean
	ValueKindNull
	ValueKindEnum
	ValueKindList
	ValueKindObject
)

Value : @wg:field self

func (ValueKind) String

func (k ValueKind) String() string

type VariableDefinition

type VariableDefinition struct {
	Name         string
	Type         Type
	DefaultValue *Value
}

type VariableDefinitions

type VariableDefinitions struct {
	Data VariableDefinition
	// contains filtered or unexported fields
}

VariableDefinitions is a linked list that contains VariableDefinition values.

func VariableDefinitionsFromSlice

func VariableDefinitionsFromSlice(sl []VariableDefinition) *VariableDefinitions

VariableDefinitionsFromSlice returns a VariableDefinitions list from a slice of VariableDefinition.

func (*VariableDefinitions) Add

Add appends a VariableDefinition to this linked list and returns this new head.

func (*VariableDefinitions) ForEach

func (vds *VariableDefinitions) ForEach(fn func(vd VariableDefinition, i int))

ForEach applies the given map function to each item in this linked list.

func (*VariableDefinitions) Generator

Generator returns a "Generator" type for this list, allowing for much more efficient iteration over items within this linked list than using ForEach, though ForEach may still be more convenient, because ForEach is a high order function, it's slower.

func (*VariableDefinitions) Insert

Insert places the VariableDefinition in the position given by pos. The method will insert at top if pos is greater than or equal to list length. The method will insert at bottom if the pos is less than 0.

func (*VariableDefinitions) Join

func (vds *VariableDefinitions) Join(otherList *VariableDefinitions)

Join attaches the tail of the receiver list "vds" to the head of the otherList.

func (*VariableDefinitions) Len

func (vds *VariableDefinitions) Len() int

Len returns the length of this linked list.

func (*VariableDefinitions) Reverse

func (vds *VariableDefinitions) Reverse() *VariableDefinitions

Reverse reverses this linked list of VariableDefinition. Usually when the linked list is being constructed the result will be last-to-first, so we'll want to reverse it to get it in the "right" order.

type VariableDefinitionsGenerator

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

VariableDefinitionsGenerator is a type used to iterate efficiently over VariableDefinitions. @wg:ignore

func (*VariableDefinitionsGenerator) Next

Next returns the current value, and it's index in the list, and sets up the next value to be returned.

func (*VariableDefinitionsGenerator) Reset

func (g *VariableDefinitionsGenerator) Reset()

Reset returns this generator to it's initial state, allowing it to be used again to iterate over this linked list.

Jump to

Keyboard shortcuts

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