Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AstFileAccessor ¶
type AstFileAccessor func() (*AstFileSource, error)
func AstFromFile ¶
func AstFromFile(sourceFilePath string) AstFileAccessor
AstFromFile Creates an AstFileAccessor object for the given Golang source file.
func AstFromSource ¶
func AstFromSource(code []byte) AstFileAccessor
AstFromSource Creates an AstFileAccessor object for the given source code.
type AstFileSource ¶ added in v0.10.0
type AstFileVisitor ¶
type AstFileVisitor interface {
AstVisitor
VisitComment(comment *ast.Comment)
VisitFile(file *ast.File)
VisitImport(importSpec *ast.ImportSpec)
VisitInterfaceType(name string, interfaceType *ast.InterfaceType)
VisitFuncType(name string, funcType *ast.FuncType)
VisitStructType(name string, structType *ast.StructType)
Model() (*Model, error)
}
func NewFileVisitor ¶
func NewFileVisitor() AstFileVisitor
type AstTypeSpecWalker ¶
type AstTypeSpecWalker interface {
WalkInterface(interfaceType *ast.InterfaceType)
WalkFunc(name string, funcSpec *ast.FuncType)
}
func NewTypeWalker ¶
func NewTypeWalker(typeVisitor AstTypeVisitor) AstTypeSpecWalker
NewTypeWalker Creates a new AstTypeSpecWalker object.
type AstTypeVisitor ¶
type AstVisitor ¶
type AstWalker ¶
func NewSyntaxWalker ¶
func NewSyntaxWalker(visitor AstVisitor) AstWalker
NewSyntaxWalker Creates a new AstWalker object.
type Comment ¶
type Comment struct {
SymbolInfo
Text string
}
type FuncType ¶
type FuncType struct {
SymbolInfo
Name string
Parameters []Parameter
Results []Parameter
}
type Interface ¶
type Interface struct {
SymbolInfo
Name string
Methods []Method
}
func InterfaceWithName ¶
func InterfaceWithName(name string, info SymbolInfo) Interface
type Method ¶
type Method struct {
SymbolInfo
Name string
Parameters []Parameter
Results []Parameter
}
type Model ¶
type Model struct {
Comments []Comment
Interfaces []Interface
FuncTypes []FuncType
PackageName string
Imports []string
}
Model The generator root model type.
type ModelConfigurationFunc ¶
type ModelConfigurationFunc func(m *Model)
type Parameter ¶
type Parameter struct {
Name string
Type *ParameterType
}
func CollectParametersFor ¶
func CollectResultFieldsFor ¶
func (Parameter) IsEllipsis ¶ added in v1.0.1
IsEllipsis determines if the parameter type is an ellipsis (`...`) parameter.
func (Parameter) MatchesType ¶
type ParameterType ¶ added in v0.10.0
Click to show internal directories.
Click to hide internal directories.