registry

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheControl

type CacheControl struct {
	MaxAge time.Duration
}

type Enum

type Enum struct {
	*descriptor.EnumDescriptorProto
	File   *File
	Outers []string
	Index  int
}

func (*Enum) EnumName

func (e *Enum) EnumName() string

type Field

type Field struct {
	*descriptor.FieldDescriptorProto
	Message      *Message
	FieldMessage *Message
	Enum         *Enum
	// GraphQL plugin options
	Dependence   *Message
	Description  string
	Nullable     *bool
	DefaultValue interface{}
	Inline       bool
	Name         string
	Exclude      bool
	External     string
}

func (*Field) FieldName

func (f *Field) FieldName() string

func (*Field) GetterExternalName

func (f *Field) GetterExternalName() string

func (*Field) GoDefaultValue

func (f *Field) GoDefaultValue() string

func (*Field) GoType

func (f *Field) GoType() string

func (*Field) IsDefaultValueBool

func (f *Field) IsDefaultValueBool() bool

func (*Field) IsDefaultValueNumber

func (f *Field) IsDefaultValueNumber() bool

func (*Field) IsDefaultValueString

func (f *Field) IsDefaultValueString() bool

func (*Field) IsEnumType

func (f *Field) IsEnumType() bool

func (*Field) IsExternal

func (f *Field) IsExternal() bool

func (*Field) IsMessageType

func (f *Field) IsMessageType() bool

func (*Field) IsNullable

func (f *Field) IsNullable() bool

func (*Field) ScalarType

func (f *Field) ScalarType() string

func (*Field) Variable

func (f *Field) Variable() string

type File

type File struct {
	*descriptor.FileDescriptorProto
	GoPkg    *GoPackage
	Messages []*Message
	Enums    []*Enum
	Services []*Service
}

type GoPackage

type GoPackage struct {
	Path  string
	Name  string
	Alias string
}

func (*GoPackage) HasStdLib

func (p *GoPackage) HasStdLib() bool

func (*GoPackage) String

func (p *GoPackage) String() string

type Message

type Message struct {
	*descriptor.DescriptorProto
	File   *File
	Outers []string
	Fields []*Field
	Index  int
	Type   string
	// GraphQL plugin options
	Object *Object
}

func (*Message) FieldName

func (m *Message) FieldName() string

func (*Message) GetGoTypeName

func (m *Message) GetGoTypeName() string

func (*Message) GetInlineSchemaTypeName

func (m *Message) GetInlineSchemaTypeName() string

func (*Message) GetSchemaTypeName

func (m *Message) GetSchemaTypeName() string

func (*Message) Inline

func (m *Message) Inline() bool

func (*Message) InlineFieldName

func (m *Message) InlineFieldName() string

func (*Message) IsObject

func (m *Message) IsObject() bool

func (*Message) MessageName

func (m *Message) MessageName() string

type Method

type Method struct {
	*descriptor.MethodDescriptorProto
	Service  *Service
	Request  *Message
	Response *Message
	// GraphQL plugin options
	Description  string
	Name         string
	Query        bool
	Mutation     bool
	Subscribe    bool
	Extend       bool
	Reference    bool
	CacheControl *CacheControl
	Field        string
}

func (*Method) FieldName

func (m *Method) FieldName() string

func (*Method) FullMethod

func (m *Method) FullMethod() string

func (*Method) GraphQLMethod

func (m *Method) GraphQLMethod() string

func (*Method) HasGraphQLMethod

func (m *Method) HasGraphQLMethod() bool

func (*Method) Variable

func (m *Method) Variable() string

type Object

type Object struct {
	Typename string
	Keys     []string
}

type Registry

type Registry struct {
	Messages   map[string]*Message
	Enums      map[string]*Enum
	Files      map[string]*File
	Pkgs       map[string]string
	ImportPath string
	Prefix     string
}

func New

func New() *Registry

func (*Registry) Apply

func (r *Registry) Apply(req *plugin.CodeGeneratorRequest) error

func (*Registry) LookupEnum

func (r *Registry) LookupEnum(location, name string) (*Enum, error)

func (*Registry) LookupFile

func (r *Registry) LookupFile(name string) (*File, error)

func (*Registry) LookupMsg

func (r *Registry) LookupMsg(location, name string) (*Message, error)

type Service

type Service struct {
	*descriptor.ServiceDescriptorProto
	File    *File
	Methods []*Method
}

func (*Service) PrivateServiceName

func (s *Service) PrivateServiceName() string

Jump to

Keyboard shortcuts

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