Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetTemplate ¶
func InitReservedValues ¶
func InitReservedValues(reservedFuncValues []string)
func ReadAllTemplateFiles ¶
func ReadAllTemplateFiles()
Types ¶
type Field ¶
type Field struct {
Parent *Struct
InputAST *ast.Field
InputTypesVar *types.Var
ParentField *Field
ChildField *Field
Name string
Type string
StructTag string
MapKeyType string
OwnType types.Type
ResolvedType types.Type
IsBaseModelDerivative bool
IsBuiltIn bool
IsEmbedded bool
IsReference bool
IsMap bool
IsPointer bool
IsSlice bool
IsResolvable bool
References *ResolverFieldReferences
}
func (*Field) BuildResolverMethod ¶
func (*Field) CreateChildField ¶
func (f *Field) CreateChildField()
********** SECTION Child Field ********** //
func (*Field) CreateStubResolvableFields ¶
********** SECTION Resolvable Field ********** //
func (*Field) MutateResolvableFieldType ¶
func (f *Field) MutateResolvableFieldType()
type Import ¶
type Import struct {
SourceFile string
InputAST *ast.ImportSpec
Alias string
Path string
}
type Package ¶
type Package struct {
IgnoredUserFiles []string
IgnoredGeneratedFiles []string
InputUser *packages.Package
InputGenerated *packages.Package
InputGeneratedLines map[string][]string
// Struct-related Values
CustomTypes map[string]*CustomType
Structs map[string]*Struct // Key: Struct name
StructMethods map[string][]*Func // Key: Struct name, Value: map[FuncName]*Func
// Others, key: filename
Funcs map[string][]*Func
Imports map[string][]*Import
Interfaces map[string][]*Interface
Values map[string][]*Value
}
func (*Package) GeneratePackageFiles ¶
func (p *Package) GeneratePackageFiles() map[string]*PackageFile
type PackageFile ¶
type PackageFile struct {
Filename string
PackageName string
FileContents []string
CustomTypes []*CustomType
Structs []*Struct
Functions []*Func
ConstValues []*Value
Imports []*Import
Interfaces []*Interface
VarValues []*Value
}
func (*PackageFile) Init ¶
func (p *PackageFile) Init()
func (*PackageFile) Sort ¶
func (p *PackageFile) Sort()
func (*PackageFile) WriteToFile ¶
func (p *PackageFile) WriteToFile(cfg *config.OutputConfig)
type ResolverFieldReferences ¶
type Struct ¶
type Struct struct {
Parent *Package
SourceFile string
InputAST *ast.StructType
InputType *types.Struct
ParsedMethods []*Func
// Sorted collection of methods
CollectionNameMethod *Func
HookMethods []*Func // Source file will be set to struct's source file
DatabaseMethods []*Func // Source file will be set to struct's source file
UserDefinedMethods []*Func // Retain source file for user defined methods
ResolverMethods []*Func // Source file will be set to struct's source file
Name string
Generated bool
IsCollection bool
EmbeddedFields []*Field
Fields []*Field
ResolverFields []*Field
}
func (*Struct) InitResolverFieldsAndMethods ¶
func (s *Struct) InitResolverFieldsAndMethods()
Source Files
¶
Click to show internal directories.
Click to hide internal directories.