Documentation
¶
Index ¶
- func ExecuteTemplate[T any](name string, fileTemplate string, om T) string
- func GetFile(file ...string) string
- func GetImports(filePath string) ([]string, error)
- func NewCSGenBuilderForFile(name string, pkg string) *strings.Builder
- func ProfileNode(node ast.Node)
- func WriteGeneratedGoFile(name string, contents string) error
- type Field
- type Function
- type Interface
- type Struct
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecuteTemplate ¶
ExecuteTemplate executes a template against a given object and return the output as a string
func GetImports ¶
GetImports returns all of the imports in a given file
func NewCSGenBuilderForFile ¶
NewCSGenBuilderForFile returns a string buider with a common header for generated files
func ProfileNode ¶
ProfileNode get details about an unknown node based on its actual type
func WriteGeneratedGoFile ¶
WriteGeneratedGoFile create a text file with the passed in name and contents
Types ¶
type Field ¶
type Field struct {
Name string
Type string
TagString string
IsPrimitive bool
IsPointer bool
IsSlice bool
IsPublic bool
}
Field a struct that represents a single field within a struct abstraction
func GetVariables ¶
GetVariables returns a list of all variable definitions in a given file
type Function ¶
type Function struct {
Name string
Receiver *string
Arguments []Field
Returns []Field
IsPublic bool
}
Function a struct that represents a single function abstraction
func GetFunctions ¶
GetFunctions returns all of the functions in a given file
type Interface ¶
Interface a struct that represents a single interface abstraction
func GetInterfaces ¶
GetInterfaces get a list of all declared interfaces in a given file
type Struct ¶
Struct a struct that abstracts a golang struct
func GetStructs ¶
GetStructs return a list of all structs in a given file
