Documentation
¶
Index ¶
- func ImplementsAllowedInterfaces(typ types.Type) bool
- func New() *cobra.Command
- func RenderSQLTemplate(tmpl string) (string, error)
- type ExtractedSQL
- type Field
- type File
- type ForNode
- type FuncNode
- type Generator
- type IfBranch
- type IfNode
- type Import
- type Interface
- type Method
- type Node
- type Param
- type Struct
- type TextNode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ImplementsAllowedInterfaces ¶
ImplementsAllowedInterfaces reports whether typ or *typ implements any allowed interface.
func RenderSQLTemplate ¶
RenderSQLTemplate parses the template string and returns Go code or an error.
Types ¶
type ExtractedSQL ¶
type Field ¶
type Field struct {
Name string
DBName string
GoType string
NamedGoType string
Tag string
// contains filtered or unexported fields
}
type File ¶
type File struct {
ToPackage string
Package string
PackagePath string
Imports []Import
Interfaces []Interface
Structs []Struct
Config *genconfig.Config
Generator *Generator
// contains filtered or unexported fields
}
func (File) UsedTypedAPI ¶
type Generator ¶
type Generator struct {
Typed bool
Files map[string]*File
// contains filtered or unexported fields
}
type Import ¶
func (Import) ImportPath ¶
ImportPath returns formatted import path string for template generation
type Method ¶
type Method struct {
Name string
Doc string
SQL ExtractedSQL
Params []Param
Result []Param
Interface Interface
}
func (Method) ParamsString ¶
ParamsString formats method parameters as a string for code generation
func (Method) ResultString ¶
ResultString formats method return values as a string for code generation
type Param ¶
func (Param) GoFullType ¶
GoFullType returns the complete Go type string for a parameter
Click to show internal directories.
Click to hide internal directories.