invent

package
v0.0.0-...-6b90055 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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