Documentation ¶
Index ¶
- func IsGooglePackage(p PackageGetter) bool
- func PrefixEnum(name string) string
- func PrefixInput(name string) string
- func PrefixInterface(name string) string
- func PrefixType(name string) string
- type CommentType
- type Comments
- type DependType
- type Dependencies
- type Enum
- type EnumValue
- type Field
- func (f *Field) Comment() string
- func (f *Field) DefaultValue() string
- func (f *Field) FieldName() string
- func (f *Field) FieldType(rootPackage string) string
- func (f *Field) FieldTypeInput(rootPackage string) string
- func (f *Field) GraphqlGoType(rootPackage string, isInput bool) string
- func (f *Field) GraphqlType() string
- func (f *Field) IsOmit() bool
- func (f *Field) IsRepeated() bool
- func (f *Field) IsRequired() bool
- func (f *Field) IsResolve() bool
- func (f *Field) Label() descriptor.FieldDescriptorProto_Label
- func (f *Field) Name() string
- func (f *Field) ResolveSubField(services []*Service) *Query
- func (f *Field) SchemaInputType() string
- func (f *Field) SchemaType() string
- func (f *Field) Type() descriptor.FieldDescriptorProto_Type
- func (f *Field) TypeName() string
- type File
- type Message
- func (m *Message) Comment() string
- func (m *Message) Fields() []*Field
- func (m *Message) FullPath() string
- func (m *Message) Interfaces() (ifs []*Message)
- func (m *Message) Name() string
- func (m *Message) SingleName() string
- func (m *Message) StructName(ptr bool) string
- func (m *Message) TypeFields() []*Field
- func (m *Message) TypeName() string
- type Method
- type Mutation
- func (m *Mutation) Args() []*Field
- func (m *Mutation) InputName() string
- func (m *Mutation) InputType() string
- func (m *Mutation) IsCamel() bool
- func (m *Mutation) IsPluckRequest() bool
- func (m *Mutation) IsPluckResponse() bool
- func (m *Mutation) MutationName() string
- func (m *Mutation) MutationType() string
- func (m *Mutation) OutputName() string
- func (m *Mutation) Package() string
- func (m *Mutation) PluckRequest() []*Field
- func (m *Mutation) PluckResponse() []*Field
- func (m *Mutation) PluckResponseFieldName() string
- func (m *Mutation) Request() *graphql.GraphqlRequest
- func (m *Mutation) Response() *graphql.GraphqlResponse
- type Package
- type PackageGetter
- type Params
- type Query
- func (q *Query) Args() []*Field
- func (q *Query) InputType() string
- func (q *Query) IsCamel() bool
- func (q *Query) IsPluckRequest() bool
- func (q *Query) IsPluckResponse() bool
- func (q *Query) IsResolver() bool
- func (q *Query) OutputName() string
- func (q *Query) Package() string
- func (q *Query) PluckRequest() []*Field
- func (q *Query) PluckResponse() []*Field
- func (q *Query) PluckResponseFieldName() string
- func (q *Query) QueryName() string
- func (q *Query) QueryType() string
- func (q *Query) Request() *graphql.GraphqlRequest
- func (q *Query) Response() *graphql.GraphqlResponse
- func (q *Query) SchemaArgs() string
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsGooglePackage ¶
func IsGooglePackage(p PackageGetter) bool
func PrefixEnum ¶
PrefixEnum adds prefix to avoid conflicting name
func PrefixInput ¶
PrefixInput adds prefix to avoid conflicting name
func PrefixInterface ¶
PrefixInterface adds prefix to avoid conflicting name
func PrefixType ¶
PrefixType adds prefix to avoid conflicting name
Types ¶
type CommentType ¶
type CommentType int
CommentType indicates comment format.
const ( GraphqlComment CommentType = iota GoComment )
type DependType ¶
type DependType int
const ( DependTypeMessage DependType = iota DependTypeInput DependTypeEnum DependTypeInterface )
type Dependencies ¶
type Dependencies struct {
// contains filtered or unexported fields
}
func NewDependencies ¶
func NewDependencies() *Dependencies
func (*Dependencies) Depend ¶
func (d *Dependencies) Depend(t DependType, pkg string)
func (*Dependencies) GetDependendencies ¶
func (d *Dependencies) GetDependendencies() map[string][]string
func (*Dependencies) IsDepended ¶
func (d *Dependencies) IsDepended(t DependType, pkg string) bool
type Enum ¶
type Enum struct { *File *Dependencies // contains filtered or unexported fields }
Enum spec wraps EnumDescriptorProto with keeping file definition.
func NewEnum ¶
func NewEnum( d *descriptor.EnumDescriptorProto, f *File, prefix []string, paths ...int, ) *Enum
func (*Enum) SingleName ¶
type EnumValue ¶
type EnumValue struct { *File // contains filtered or unexported fields }
EnumValue spec wraps EnumValueDescriptorProto with keeping file definition.
func NewEnumValue ¶
func NewEnumValue( d *descriptor.EnumValueDescriptorProto, f *File, paths ...int, ) *EnumValue
type Field ¶
type Field struct { Option *graphql.GraphqlField *File DependType interface{} IsCyclic bool // contains filtered or unexported fields }
Field spec wraps FieldDescriptorProto with keeping file info
func NewField ¶
func NewField( d *descriptor.FieldDescriptorProto, f *File, isCamel bool, paths ...int, ) *Field
func (*Field) DefaultValue ¶
func (*Field) FieldTypeInput ¶
func (*Field) GraphqlGoType ¶
GraphqlGoType returns appropriate graphql-go type
func (*Field) GraphqlType ¶
GraphqlType returns appropriate GraphQL type
func (*Field) IsRepeated ¶
func (*Field) IsRequired ¶
func (*Field) Label ¶
func (f *Field) Label() descriptor.FieldDescriptorProto_Label
func (*Field) ResolveSubField ¶
func (*Field) SchemaInputType ¶
func (*Field) SchemaType ¶
func (*Field) Type ¶
func (f *Field) Type() descriptor.FieldDescriptorProto_Type
type File ¶
File spec wraps FileDescriptorProto and this spec will be passed in all other specs in order to get filename, package name, etc...
func NewFile ¶
func NewFile( d *descriptor.FileDescriptorProto, cv *plugin.Version, isCamel bool, ) *File
type Message ¶
type Message struct { *File *Dependencies PluckFields []*Field // contains filtered or unexported fields }
Message spec wraps DescriptorProto
func NewMessage ¶
func NewMessage( d *descriptor.DescriptorProto, f *File, prefix []string, isCamel bool, paths ...int, ) *Message
func (*Message) Interfaces ¶
func (*Message) SingleName ¶
func (*Message) StructName ¶
func (*Message) TypeFields ¶
type Method ¶
type Method struct { Service *Service Schema *graphql.GraphqlSchema *File // contains filtered or unexported fields }
Method spec wraps MethodDescriptorProto with GraphqlQuery and GraphqlMutation options.
func NewMethod ¶
func NewMethod( m *descriptor.MethodDescriptorProto, s *Service, paths ...int, ) *Method
func (*Method) ServiceName ¶
type Mutation ¶
type Mutation struct { *Method Input *Message Output *Message // contains filtered or unexported fields }
Mutation spec wraps MethodDescriptorProto.
func (*Mutation) IsPluckRequest ¶
func (*Mutation) IsPluckResponse ¶
func (*Mutation) MutationName ¶
func (*Mutation) MutationType ¶
func (*Mutation) OutputName ¶
func (*Mutation) PluckRequest ¶
func (*Mutation) PluckResponse ¶
func (*Mutation) PluckResponseFieldName ¶
func (*Mutation) Request ¶
func (m *Mutation) Request() *graphql.GraphqlRequest
func (*Mutation) Response ¶
func (m *Mutation) Response() *graphql.GraphqlResponse
type Package ¶
type Package struct { Name string CamelName string Path string GeneratedFilenamePrefix string FileName string }
func NewGoPackageFromString ¶
func NewGooglePackage ¶
func NewGooglePackage(m PackageGetter) *Package
func NewPackage ¶
func NewPackage(g PackageGetter) *Package
type PackageGetter ¶
type Params ¶
type Params struct { QueryOut string Excludes []*regexp.Regexp Verbose bool FieldCamelCase bool Paths string }
Params spec have plugin parameters
func (*Params) IsSourceRelative ¶
type Query ¶
type Query struct { *Method Input *Message Output *Message // contains filtered or unexported fields }
Query spec wraps MethodDescriptorProto.
func (*Query) IsPluckRequest ¶
func (*Query) IsPluckResponse ¶
func (*Query) IsResolver ¶
func (*Query) OutputName ¶
func (*Query) PluckRequest ¶
func (*Query) PluckResponse ¶
func (*Query) PluckResponseFieldName ¶
func (*Query) Request ¶
func (q *Query) Request() *graphql.GraphqlRequest
func (*Query) Response ¶
func (q *Query) Response() *graphql.GraphqlResponse
func (*Query) SchemaArgs ¶
type Service ¶
type Service struct { Option *graphql.GraphqlService *File Queries []*Query Mutations []*Mutation // contains filtered or unexported fields }
Service spec wraps ServiceDescriptorProto with GraphqlService option.
func NewService ¶
func NewService( d *descriptor.ServiceDescriptorProto, f *File, paths ...int, ) *Service