parser

package
v10.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

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

Functions

func GetModuleImportName

func GetModuleImportName(moduleName string) string

func GetModuleImportPath

func GetModuleImportPath(dir, modulePath, moduleName string) string

func GetModuleMainFilePath

func GetModuleMainFilePath(moduleName string) (string, error)

func GetModuleWireFilePath

func GetModuleWireFilePath(moduleName string) (string, error)

func GetRootImportPath

func GetRootImportPath(dir string) string

func GetStructAPIName

func GetStructAPIName(structName string) string

func GetStructBIZName

func GetStructBIZName(structName string) string

func GetStructDALName

func GetStructDALName(structName string) string

func GetStructRouterGroupName

func GetStructRouterGroupName(structName string) string

func GetStructRouterVarName

func GetStructRouterVarName(structName string) string

func GetUtilImportPath

func GetUtilImportPath(dir, modulePath string) string

func ModifyModsFile

func ModifyModsFile(ctx context.Context, args BasicArgs) ([]byte, error)

func ModifyModuleMainFile

func ModifyModuleMainFile(ctx context.Context, args BasicArgs) ([]byte, error)

func ModifyModuleWireFile

func ModifyModuleWireFile(ctx context.Context, args BasicArgs) ([]byte, error)

func ParseFilePathFromTpl

func ParseFilePathFromTpl(moduleName, structName string, tpl string) (string, error)

Types

type AstFlag

type AstFlag int
const (
	AstFlagGen AstFlag = 1 << iota
	AstFlagRem
)

func (AstFlag) String

func (f AstFlag) String() string

type BasicArgs

type BasicArgs struct {
	Dir              string
	ModuleName       string
	ModulePath       string
	StructName       string
	GenPackages      []string
	Flag             AstFlag
	FillRouterPrefix bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL