Documentation ¶
Index ¶
- type Lexer
- type ManualAstMod
- func (m *ManualAstMod) AppendFieldToSelectionSet(fieldRef, setRef int)
- func (m *ManualAstMod) DeleteFieldFromSelectionSet(fieldRef, setRef int)
- func (m *ManualAstMod) MergeArgIntoFieldArguments(argRef, fieldRef int)
- func (m *ManualAstMod) PutArgument(argument document.Argument) int
- func (m *ManualAstMod) PutArgumentSet(set document.ArgumentSet) int
- func (m *ManualAstMod) PutField(field document.Field) int
- func (m *ManualAstMod) PutLiteralBytes(literal []byte) (byteSliceRef document.ByteSliceReference, ref int, err error)
- func (m *ManualAstMod) PutLiteralString(literal string) (byteSliceRef document.ByteSliceReference, ref int, err error)
- func (m *ManualAstMod) PutValue(value document.Value) int
- func (m *ManualAstMod) SetMutationTypeName(name document.ByteSliceReference)
- func (m *ManualAstMod) SetQueryTypeName(name document.ByteSliceReference)
- func (m *ManualAstMod) SetSubscriptionTypeName(name document.ByteSliceReference)
- type Option
- type Options
- type ParsedDefinitions
- type Parser
- func (p *Parser) ByteSlice(reference document.ByteSliceReference) document.ByteSlice
- func (p *Parser) CachedByteSlice(i int) document.ByteSlice
- func (p *Parser) EnumValueDefinition(ref int) document.EnumValueDefinition
- func (p *Parser) ExtendTypeSystemDefinition(input []byte) (err error)
- func (p *Parser) FieldDefinition(ref int) document.FieldDefinition
- func (p *Parser) IndexPoolGet() []int
- func (p *Parser) InitDirectiveSet(set *document.DirectiveSet)
- func (p *Parser) InputValueDefinition(ref int) document.InputValueDefinition
- func (p *Parser) ParseExecutableDefinition(input []byte) (err error)
- func (p *Parser) ParseIntrospectionResponse(response *introspection.Response) (err error)
- func (p *Parser) ParseTypeSystemDefinition(input []byte) (err error)
- func (p *Parser) TextPosition() position.Position
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Lexer ¶
type Lexer interface { SetTypeSystemInput(input []byte) error ExtendTypeSystemInput(input []byte) error ResetTypeSystemInput() SetExecutableInput(input []byte) error AppendBytes(input []byte) (err error) Read() (tok token.Token) Peek(ignoreWhitespace bool) keyword.Keyword ByteSlice(reference document.ByteSliceReference) document.ByteSlice TextPosition() position.Position }
Lexer is the interface used by the Parser to lex tokens
type ManualAstMod ¶ added in v1.2.0
type ManualAstMod struct {
// contains filtered or unexported fields
}
ManualAstMod keeps functions to manually modify the parsed ast
func NewManualAstMod ¶ added in v1.2.0
func NewManualAstMod(p *Parser) *ManualAstMod
func (*ManualAstMod) AppendFieldToSelectionSet ¶ added in v1.2.0
func (m *ManualAstMod) AppendFieldToSelectionSet(fieldRef, setRef int)
func (*ManualAstMod) DeleteFieldFromSelectionSet ¶ added in v1.2.0
func (m *ManualAstMod) DeleteFieldFromSelectionSet(fieldRef, setRef int)
func (*ManualAstMod) MergeArgIntoFieldArguments ¶ added in v1.3.0
func (m *ManualAstMod) MergeArgIntoFieldArguments(argRef, fieldRef int)
func (*ManualAstMod) PutArgument ¶ added in v1.3.0
func (m *ManualAstMod) PutArgument(argument document.Argument) int
func (*ManualAstMod) PutArgumentSet ¶ added in v1.3.0
func (m *ManualAstMod) PutArgumentSet(set document.ArgumentSet) int
func (*ManualAstMod) PutField ¶ added in v1.2.0
func (m *ManualAstMod) PutField(field document.Field) int
func (*ManualAstMod) PutLiteralBytes ¶ added in v1.3.0
func (m *ManualAstMod) PutLiteralBytes(literal []byte) (byteSliceRef document.ByteSliceReference, ref int, err error)
PutLiteralBytes appends a literal to the end of the lexer input storage before appending the lexer will read forward until EOF by doing this we make sure there's no unexpected content at the end of the input this step is necessary because clients like curl end a request by appending a newline ('\n') the parser does not expect a newLine at the end of the input so we have to read over it
func (*ManualAstMod) PutLiteralString ¶ added in v1.3.0
func (m *ManualAstMod) PutLiteralString(literal string) (byteSliceRef document.ByteSliceReference, ref int, err error)
func (*ManualAstMod) PutValue ¶ added in v1.3.0
func (m *ManualAstMod) PutValue(value document.Value) int
func (*ManualAstMod) SetMutationTypeName ¶ added in v1.3.0
func (m *ManualAstMod) SetMutationTypeName(name document.ByteSliceReference)
func (*ManualAstMod) SetQueryTypeName ¶ added in v1.3.0
func (m *ManualAstMod) SetQueryTypeName(name document.ByteSliceReference)
func (*ManualAstMod) SetSubscriptionTypeName ¶ added in v1.3.0
func (m *ManualAstMod) SetSubscriptionTypeName(name document.ByteSliceReference)
type ParsedDefinitions ¶
type ParsedDefinitions struct { TypeSystemDefinition document.TypeSystemDefinition ExecutableDefinition document.ExecutableDefinition OperationDefinitions document.OperationDefinitions FragmentDefinitions document.FragmentDefinitions VariableDefinitions document.VariableDefinitions Fields document.Fields InlineFragments document.InlineFragments FragmentSpreads document.FragmentSpreads Arguments document.Arguments ArgumentSets []document.ArgumentSet Directives document.Directives DirectiveSets []document.DirectiveSet EnumTypeDefinitions []document.EnumTypeDefinition ArgumentsDefinitions document.ArgumentsDefinitions EnumValuesDefinitions []document.EnumValueDefinition FieldDefinitions []document.FieldDefinition InputValueDefinitions []document.InputValueDefinition InputObjectTypeDefinitions document.InputObjectTypeDefinitions DirectiveDefinitions document.DirectiveDefinitions InterfaceTypeDefinitions document.InterfaceTypeDefinitions ObjectTypeDefinitions document.ObjectTypeDefinitions ScalarTypeDefinitions document.ScalarTypeDefinitions UnionTypeDefinitions document.UnionTypeDefinitions InputFieldsDefinitions []document.InputFieldsDefinition Values []document.Value ListValues []document.ListValue ObjectValues []document.ObjectValue ObjectFields document.ObjectFields Types document.Types SelectionSets []document.SelectionSet ByteSliceReferences []document.ByteSliceReference Integers []int32 Floats []float32 Booleans [2]bool }
ParsedDefinitions contains all parsed definitions to avoid deeply nested data structures while parsing
type Parser ¶
type Parser struct { ParsedDefinitions ParsedDefinitions // contains filtered or unexported fields }
Parser holds the lexer and a buffer for writing literals
func (*Parser) ByteSlice ¶
func (p *Parser) ByteSlice(reference document.ByteSliceReference) document.ByteSlice
func (*Parser) EnumValueDefinition ¶ added in v1.5.0
func (p *Parser) EnumValueDefinition(ref int) document.EnumValueDefinition
func (*Parser) ExtendTypeSystemDefinition ¶ added in v1.6.0
func (*Parser) FieldDefinition ¶ added in v1.5.0
func (p *Parser) FieldDefinition(ref int) document.FieldDefinition
func (*Parser) IndexPoolGet ¶ added in v1.4.0
func (*Parser) InitDirectiveSet ¶
func (p *Parser) InitDirectiveSet(set *document.DirectiveSet)
func (*Parser) InputValueDefinition ¶ added in v1.5.0
func (p *Parser) InputValueDefinition(ref int) document.InputValueDefinition
func (*Parser) ParseExecutableDefinition ¶
ParseExecutableDefinition parses an ExecutableDefinition from an io.Reader
func (*Parser) ParseIntrospectionResponse ¶ added in v1.3.0
func (p *Parser) ParseIntrospectionResponse(response *introspection.Response) (err error)
func (*Parser) ParseTypeSystemDefinition ¶
ParseTypeSystemDefinition parses a TypeSystemDefinition from an io.Reader
func (*Parser) TextPosition ¶
Source Files ¶
- arguments_parser.go
- argumentsdefinition_parser.go
- bool_value_parser.go
- byteslice_parser.go
- defaultvalue_parser.go
- directivedefinition_parser.go
- directives_parser.go
- enumtypedefinition_parser.go
- enumvaluesdefinition_parser.go
- executabledefinition_parser.go
- field_parser.go
- fieldsdefinition_parser.go
- float_value_parser.go
- fragmentdefinition_parser.go
- fragmentspread_parser.go
- implementsinterfaces_parser.go
- inlinefragment_parser.go
- inputfieldsdefinition_parser.go
- inputobjecttypedefinition_parser.go
- inputvaluedefinitions_parser.go
- int_value_parser.go
- interfacetypedefinition_parser.go
- list_value_parser.go
- manual_ast_mod.go
- object_value_parser.go
- objecttypedefinition_parser.go
- operationdefinition_parser.go
- parser.go
- parser_introspection.go
- scalartypedefinition_parser.go
- schemadefinition_parser.go
- selectionset_parser.go
- type_parser.go
- typesystemdefinition_parser.go
- uniontypedefinition_parser.go
- value_parser.go
- variabledefinitions_parser.go