Documentation ¶
Index ¶
- Constants
- Variables
- func GetModuleImportName(moduleName string) string
- func GetModuleImportPath(dir, modulePath, moduleName string) string
- func GetModuleMainFilePath(moduleName string) (string, error)
- func GetModuleWireFilePath(moduleName string) (string, error)
- func GetRootImportPath(dir string) string
- func GetStructAPIName(structName string) string
- func GetStructBIZName(structName string) string
- func GetStructDALName(structName string) string
- func GetStructRouterGroupName(structName string) string
- func GetStructRouterVarName(structName string) string
- func GetUtilImportPath(dir, modulePath string) string
- func ModifyModsFile(ctx context.Context, args BasicArgs) ([]byte, error)
- func ModifyModuleMainFile(ctx context.Context, args BasicArgs) ([]byte, error)
- func ModifyModuleWireFile(ctx context.Context, args BasicArgs) ([]byte, error)
- func ParseFilePathFromTpl(moduleName, structName string, tpl string) (string, error)
- type AstFlag
- type BasicArgs
Constants ¶
View Source
const ( FileForMods = "mods.go" FileForModuleMain = "{{lower .ModuleName}}/main.go" FileForModuleWire = "{{lower .ModuleName}}/wire.go" FileForModuleAPI = "{{lower .ModuleName}}/api/{{lowerUnderline .StructName}}.api.go" FileForModuleBiz = "{{lower .ModuleName}}/biz/{{lowerUnderline .StructName}}.biz.go" FileForModuleDAL = "{{lower .ModuleName}}/dal/{{lowerUnderline .StructName}}.dal.go" FileForModuleSchema = "{{lower .ModuleName}}/schema/{{lowerUnderline .StructName}}.go" )
View Source
const ( StructNamingAPI = "API" StructNamingBIZ = "BIZ" StructNamingDAL = "DAL" )
View Source
const ( StructPackageAPI = "api" StructPackageBIZ = "biz" StructPackageDAL = "dal" StructPackageSchema = "schema" )
Variables ¶
View Source
var StructPackageTplPaths = map[string]string{ StructPackageAPI: FileForModuleAPI, StructPackageBIZ: FileForModuleBiz, StructPackageDAL: FileForModuleDAL, StructPackageSchema: FileForModuleSchema, }
View Source
var StructPackages = []string{ StructPackageSchema, StructPackageDAL, StructPackageBIZ, StructPackageAPI, }
Functions ¶
func GetModuleImportName ¶
func GetModuleImportPath ¶
func GetModuleMainFilePath ¶
func GetModuleWireFilePath ¶
func GetRootImportPath ¶
func GetStructAPIName ¶
func GetStructBIZName ¶
func GetStructDALName ¶
func GetStructRouterVarName ¶
func GetUtilImportPath ¶
func ModifyModuleMainFile ¶
func ModifyModuleWireFile ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.