Documentation
¶
Overview ¶
Copyright © 2024 NAME HERE <EMAIL ADDRESS>
Copyright © 2024 NAME HERE <EMAIL ADDRESS>
Copyright © 2023 NAME HERE <EMAIL ADDRESS>
Copyright © 2023 NAME HERE <EMAIL ADDRESS>
Copyright © 2023 NAME HERE <EMAIL ADDRESS>
Copyright © 2024 NAME HERE <EMAIL ADDRESS>
Copyright © 2024 NAME HERE <EMAIL ADDRESS>
Copyright © 2023 NAME HERE <EMAIL ADDRESS>
Copyright © 2023 NAME HERE <EMAIL ADDRESS>
Index ¶
- func Execute()
- func ReadModuleNameFromGoModFile() (string, error)
- func WriteToFile(newFile string, fileData []byte) error
- type ActionType
- type Generator
- func (gen *Generator) EntGenerate() (string, error)
- func (gen *Generator) Generate(targetFile, tmpl string, actionType ActionType) error
- func (gen *Generator) InitGenerate(filename, fileDirname, templateName string) error
- func (gen *Generator) InitHandler() error
- func (gen *Generator) InitInterface(t string) error
- func (gen *Generator) NewEntSchema() (string, error)
- func (gen *Generator) NewHandler() error
- func (gen *Generator) NewRepository() error
- func (gen *Generator) NewRequest() error
- func (gen *Generator) NewResponse() error
- func (gen *Generator) NewRouter() error
- func (gen *Generator) NewService() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Execute ¶
func Execute()
Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
func WriteToFile ¶
Types ¶
type Generator ¶
type Generator struct {
Module string // go.mod module
TargetFile string // 写入目标文件
SnakeName string
TmplName string
UpdatePosition string // 更新位置
Action ActionType // 动作;创建,还是更新
Content bytes.Buffer // 内容
WorkDir string // exec命令执行工作目录
InternalDir string
ConfigDir string
DatabaseDir string
HandlerDir string
RequestDir string
ResponseDir string
ModelDir string
RepositoryDir string
ServiceDir string
LogrotateDir string
SystemdDir string
DocDir string
// contains filtered or unexported fields
}
func NewGenerate ¶
func (*Generator) EntGenerate ¶
func (*Generator) Generate ¶
func (gen *Generator) Generate(targetFile, tmpl string, actionType ActionType) error
func (*Generator) InitGenerate ¶
InitGenerate generate func filename mysql.go fileDirname /internal/database/ templateName mysql.tmpl
func (*Generator) InitHandler ¶
func (*Generator) InitInterface ¶
InitInterface init interface file