Documentation ¶
Index ¶
Constants ¶
View Source
const ( ModeCreateOrReplace = 0 //创建或替换 ModeOnlyCreate = 1 //只创建 ModeOnlyReplace = 2 //只替换 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TemplateMeta ¶
type TemplateMeta struct { Key string Mode int //模式 0:创建或替换 1:只创建 2:只替换 CodeOutPath string //生成的代码路径 test/template.go //TemplateFile string //模版文件路径 tpl/api.go.tpl TemplateString string //模版文件内容 FunMap map[string]any //模版函数 Data interface{} //填充内容 }
生成目录,文件名,模板内容,填充数据 data
func (*TemplateMeta) CreateTempFile ¶
func (s *TemplateMeta) CreateTempFile() error
func (*TemplateMeta) MoveTempFile ¶
func (s *TemplateMeta) MoveTempFile(movePath string) error
func (*TemplateMeta) RollBack ¶
func (s *TemplateMeta) RollBack() error
Click to show internal directories.
Click to hide internal directories.