Documentation ¶
Index ¶
- Constants
- Variables
- func LoadASTcache(c *Cache_)
- type Cache_
- type Parser
- func (p *Parser) CheckSelfReference(directive ast.NameValue_, x *ast.Directive_)
- func (p *Parser) CheckUnionMembers(x *ast.Union_)
- func (p *Parser) ClearCache()
- func (p *Parser) Getperror() []error
- func (p *Parser) Loc() *ast.Loc_
- func (p *Parser) ParseDirective(op string) ast.GQLTypeProvider
- func (p *Parser) ParseDocument(doc ...string) (api *ast.Document, errs []error)
- func (p *Parser) ParseEnumType(op string) ast.GQLTypeProvider
- func (p *Parser) ParseInputValueType(op string) ast.GQLTypeProvider
- func (p *Parser) ParseInterfaceType(op string) ast.GQLTypeProvider
- func (p *Parser) ParseObjectType(op string) ast.GQLTypeProvider
- func (p *Parser) ParseResponse() ast.InputValueProvider
- func (p *Parser) ParseScalar(op string) ast.GQLTypeProvider
- func (p *Parser) ParseSchema(op string) ast.GQLTypeProvider
- func (p *Parser) ParseStatement() ast.GQLTypeProvider
- func (p *Parser) ParseUnionType(op string) ast.GQLTypeProvider
Constants ¶
const ( Executable = 'E' TypeSystem = 'T' )
const (
FATAL int = 0
)
Error exit codes
Variables ¶
var ( // errors ErrNotCached error = errors.New("does not exist") ErrnotScalar error = errors.New("scalars are not permitted for FetchAST") ErrnoName error = errors.New("No input name supplied to FetchAST") )
var TypeResolveErr = errors.New("")
TypeResolveErr used only to categorise the error not to provided extra information.
Functions ¶
func LoadASTcache ¶
func LoadASTcache(c *Cache_)
Types ¶
type Cache_ ¶
type Cache_ struct { sync.Mutex // Mutex protects whole cache. Channels protect individual cache entries. Cache map[string]*entry // cache holds any AST accessed by its name such as types, statements in a doc. // contains filtered or unexported fields }
func NewCache ¶
func NewCache() *Cache_
NewCache allocates a structure to hold the cached data with access methods.
func (*Cache_) CacheClear ¶
func (t *Cache_) CacheClear()
func (*Cache_) FetchAST ¶
func (t *Cache_) FetchAST(name ast.NameValue_) (ast.GQLTypeProvider, error)
FetchAST is a concurrency safe access method to the cache. Used when resolving nested abstract types for the type being created. When all validation checks are satisfieid the type in question is added to the cache. If entry not found in the cache searches dynamodb table for the type SDL statement.
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
func (*Parser) CheckSelfReference ¶
func (p *Parser) CheckSelfReference(directive ast.NameValue_, x *ast.Directive_)
func (*Parser) CheckUnionMembers ¶
func (*Parser) ClearCache ¶
func (p *Parser) ClearCache()
func (*Parser) ParseDirective ¶
func (p *Parser) ParseDirective(op string) ast.GQLTypeProvider
====================== Directive_ =============================== DirectiveDefinition
Descriptiono-pt directive @ Name ArgumentsDefinition-opt on DirectiveLocations
DirectiveLocations
| optDirectiveLocation
DirectiveLocations | DirectiveLocation DirectiveLocation
ExecutableDirectiveLocation TypeSystemDirectiveLocation
func (*Parser) ParseDocument ¶
func (*Parser) ParseEnumType ¶
func (p *Parser) ParseEnumType(op string) ast.GQLTypeProvider
EnumTypeDefinition
Description-opt enum Name Directives-opt EnumValueDefinition-opt
EnumValuesDefinition
{EnumValueDefinition-list}
EnumValueDefinition
Description-opt EnumValue Directives-opt
func (*Parser) ParseInputValueType ¶
func (p *Parser) ParseInputValueType(op string) ast.GQLTypeProvider
====================== Input =============================== InputObjectTypeDefinition
Description-opt input Name DirectivesConst-opt InputFieldsDefinition-opt
func (*Parser) ParseInterfaceType ¶
func (p *Parser) ParseInterfaceType(op string) ast.GQLTypeProvider
====================== Interface =========================== InterfaceTypeDefinition
Description-opt interface Name Directives-opt FieldsDefinition-opt
func (*Parser) ParseObjectType ¶
func (p *Parser) ParseObjectType(op string) ast.GQLTypeProvider
Description-opt TYPE Name ImplementsInterfaces-opt Directives-Const-opt FieldsDefinition-opt
{FieldDefinition-list} FieldDefinition: Description-opt Name ArgumentsDefinition- opt : Type Directives-Con
func (*Parser) ParseResponse ¶
func (p *Parser) ParseResponse() ast.InputValueProvider
ParseReponse - API for testing purposes only. Not part of normal processing.
func (*Parser) ParseScalar ¶
func (p *Parser) ParseScalar(op string) ast.GQLTypeProvider
====================== Scalar_ =============================== InputObjectTypeDefinition
Description-opt scalar Name DirectivesConst-opt
func (*Parser) ParseSchema ¶
func (p *Parser) ParseSchema(op string) ast.GQLTypeProvider
SchemaDefinition
schemaDirectivesConstopt{RootOperationTypeDefinitionlist}
RootOperationTypeDefinition
OperationType : NamedType
func (*Parser) ParseStatement ¶
func (p *Parser) ParseStatement() ast.GQLTypeProvider
parseStatement takes predefined parser routine and applies it to a valid statement
func (*Parser) ParseUnionType ¶
func (p *Parser) ParseUnionType(op string) ast.GQLTypeProvider
====================== Union =============================== UnionTypeDefinition
Descriptionopt union Name Directives-opt UnionMemberTypes-opt
UnionMemberTypes
=|-opt NamedType UnionMemberTypes | NamedType