gqls

package
v0.0.0-...-c4be6ef Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FloatType    = newScalarType("Float")
	IntType      = newScalarType("Int")
	StringType   = newScalarType("String")
	BooleanType  = newScalarType("Boolean")
	IDType       = newScalarType("ID")
	DateTimeType = newScalarType("DateTime")
)

Functions

This section is empty.

Types

type Definable

type Definable interface {
	ProtoType
	DefinitionAST() (*ast.Definition, error)
}

type EnumType

type EnumType struct {
	Proto *protogen.Enum
}

func NewEnumType

func NewEnumType(proto *protogen.Enum) *EnumType

func (*EnumType) DefinitionAST

func (t *EnumType) DefinitionAST() (*ast.Definition, error)

func (*EnumType) GoIdent

func (t *EnumType) GoIdent() protogen.GoIdent

func (*EnumType) IsList

func (t *EnumType) IsList() bool

func (*EnumType) IsNullable

func (t *EnumType) IsNullable() bool

func (*EnumType) Name

func (t *EnumType) Name() string

func (*EnumType) ProtoDescriptor

func (t *EnumType) ProtoDescriptor() protoreflect.Descriptor

func (*EnumType) TypeAST

func (t *EnumType) TypeAST() *ast.Type

type InputObjectType

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

func NewInputObjectType

func NewInputObjectType(objType *ObjectType) *InputObjectType

func (*InputObjectType) DefinitionAST

func (t *InputObjectType) DefinitionAST() (*ast.Definition, error)

func (*InputObjectType) GoIdent

func (t *InputObjectType) GoIdent() protogen.GoIdent

func (*InputObjectType) IsList

func (t *InputObjectType) IsList() bool

func (*InputObjectType) IsNullable

func (t *InputObjectType) IsNullable() bool

func (*InputObjectType) Name

func (t *InputObjectType) Name() string

func (*InputObjectType) ProtoDescriptor

func (t *InputObjectType) ProtoDescriptor() protoreflect.Descriptor

func (*InputObjectType) TypeAST

func (t *InputObjectType) TypeAST() *ast.Type

type ModifiedType

type ModifiedType interface {
	Original() Type
}

type ObjectType

type ObjectType struct {
	Proto *protogen.Message
}

func (*ObjectType) DefinitionAST

func (t *ObjectType) DefinitionAST() (*ast.Definition, error)

func (*ObjectType) GoIdent

func (t *ObjectType) GoIdent() protogen.GoIdent

func (*ObjectType) IsList

func (t *ObjectType) IsList() bool

func (*ObjectType) IsNullable

func (t *ObjectType) IsNullable() bool

func (*ObjectType) Name

func (t *ObjectType) Name() string

func (*ObjectType) ProtoDescriptor

func (t *ObjectType) ProtoDescriptor() protoreflect.Descriptor

func (*ObjectType) TypeAST

func (t *ObjectType) TypeAST() *ast.Type

type ProtoType

type ProtoType interface {
	GoIdent() protogen.GoIdent
	ProtoDescriptor() protoreflect.Descriptor
}

type ScalarType

type ScalarType struct {
	ProtoName string
	GoName    string
	// contains filtered or unexported fields
}

func (*ScalarType) IsList

func (t *ScalarType) IsList() bool

func (*ScalarType) IsNullable

func (t *ScalarType) IsNullable() bool

func (*ScalarType) Name

func (t *ScalarType) Name() string

func (*ScalarType) TypeAST

func (t *ScalarType) TypeAST() *ast.Type

type Schema

type Schema struct {
	Types map[string]interface {
		Type
		Definable
	}
}

func BuildSchema

func BuildSchema(f *protogen.File) (*Schema, error)

func (*Schema) DocumentAST

func (s *Schema) DocumentAST() (*ast.SchemaDocument, error)

func (*Schema) Empty

func (s *Schema) Empty() bool

type SchemaAST

type SchemaAST struct {
	*Schema
}

func NewSchemaAST

func NewSchemaAST(s *Schema) *SchemaAST

func (*SchemaAST) Build

func (s *SchemaAST) Build() (*ast.SchemaDocument, error)

type SchemaBuilder

type SchemaBuilder struct {
	*Schema
	// contains filtered or unexported fields
}

func NewSchemaBuilder

func NewSchemaBuilder() *SchemaBuilder

func (*SchemaBuilder) AddType

func (b *SchemaBuilder) AddType(t Type) error

func (*SchemaBuilder) Build

func (b *SchemaBuilder) Build(f *protogen.File) (*Schema, error)

type Type

type Type interface {
	Name() string
	IsNullable() bool
	IsList() bool
	TypeAST() *ast.Type
}

func ListType

func ListType(el Type) Type

func NullableType

func NullableType(el Type) Type

func TypeFromProtoField

func TypeFromProtoField(f *protogen.Field) (Type, error)

func TypeFromProtoMessage

func TypeFromProtoMessage(m *protogen.Message) (Type, error)

func UnwrapType

func UnwrapType(t Type) Type

type UnionType

type UnionType struct {
	Proto *protogen.Oneof
}

func NewUnionType

func NewUnionType(proto *protogen.Oneof) *UnionType

func (*UnionType) DefinitionAST

func (t *UnionType) DefinitionAST() (*ast.Definition, error)

func (*UnionType) GoIdent

func (t *UnionType) GoIdent() protogen.GoIdent

func (*UnionType) IsList

func (t *UnionType) IsList() bool

func (*UnionType) IsNullable

func (t *UnionType) IsNullable() bool

func (*UnionType) Name

func (t *UnionType) Name() string

func (*UnionType) ProtoDescriptor

func (t *UnionType) ProtoDescriptor() protoreflect.Descriptor

func (*UnionType) TypeAST

func (t *UnionType) TypeAST() *ast.Type

type WrappedScalarType

type WrappedScalarType struct {
	*ScalarType
	Proto *protogen.Message
}

func (*WrappedScalarType) GoIdent

func (t *WrappedScalarType) GoIdent() protogen.GoIdent

func (*WrappedScalarType) ProtoDescriptor

func (t *WrappedScalarType) ProtoDescriptor() protoreflect.Descriptor

Jump to

Keyboard shortcuts

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