Documentation ¶
Index ¶
- Constants
- Variables
- func CrudGen(dataMetas DataMetas, destDir string, imports []string) error
- func GetPackageName(filePath string) (string, error)
- func GroupStructMetas(structMetas []*StructMeta) ([]*StructMeta, StructMetasMap, error)
- func RunCodeGen(sourceDir string, destDir string, imports []string) error
- type DataMeta
- type DataMetas
- type FieldMeta
- type StructMeta
- type StructMetasMap
Constants ¶
View Source
const DtoTemplate = `` /* 3135-byte string literal not displayed */
Variables ¶
View Source
var BlackList = []string{"Queries"}
Functions ¶
func GetPackageName ¶
GetPackageName reads a *.go file from the given file path and returns the package name
func GroupStructMetas ¶
func GroupStructMetas(structMetas []*StructMeta) ([]*StructMeta, StructMetasMap, error)
Types ¶
type DataMeta ¶
type DataMeta struct { Package string `json:"package"` DestPackage string `json:"dest_package"` Imports []string `json:"imports"` PlainModel StructMeta `json:"plain_model"` CreateModel StructMeta `json:"create_model"` UpdateModel StructMeta `json:"update_model"` }
func Map2DataMetas ¶
func Map2DataMetas(groupedStructMetaMap StructMetasMap) []*DataMeta
type StructMeta ¶
type StructMeta struct { Name string `json:"name"` FieldMetas []*FieldMeta `json:"field_meta"` Package string `json:"package"` }
func CollectStructMetas ¶
func CollectStructMetas(dir string) ([]*StructMeta, error)
type StructMetasMap ¶
type StructMetasMap = map[string][]*StructMeta
Click to show internal directories.
Click to hide internal directories.