Documentation ¶
Index ¶
- type GenElement
- type GenPackage
- type GenStruct
- func (s *GenStruct) AddElement(e ...GenElement)
- func (s *GenStruct) GenerateColumnName() []string
- func (s *GenStruct) GenerateTableName() []string
- func (s *GenStruct) Generates() []string
- func (s *GenStruct) GeneratesColor() []string
- func (s *GenStruct) SetCreatTableStr(sql string)
- func (s *GenStruct) SetNotes(notes string)
- func (s *GenStruct) SetStructName(name string)
- func (s *GenStruct) SetTableName(name string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GenElement ¶
type GenElement struct { Name string // Name.元素名 ColumnName string // table name.表名 Type string // Type.类型标记 Notes string // Notes.注释 Tags map[string][]string // tages.标记 }
GenElement element of sturct.元素类
func (*GenElement) AddTag ¶
func (e *GenElement) AddTag(k string, v string)
AddTag Add a tag .添加一个tag标记
func (*GenElement) Generate ¶
func (e *GenElement) Generate() string
Generate Get the result data.获取结果数据
func (*GenElement) GenerateColor ¶
func (e *GenElement) GenerateColor() string
GenerateColor Get the result data.获取结果数据
func (*GenElement) SetName ¶
func (e *GenElement) SetName(name string)
SetName Setting element name.设置元素名字
func (*GenElement) SetNotes ¶
func (e *GenElement) SetNotes(notes string)
SetNotes Setting element notes.设置注释
func (*GenElement) SetType ¶
func (e *GenElement) SetType(tp string)
SetType Setting element type.设置元素类型
type GenPackage ¶
type GenPackage struct { Name string // name.名字 Imports map[string]string // Inclusion term.元素组合 Structs []GenStruct // struct list .结构体组合 FuncStrList []string // func of template on string. 函数的最终定义 }
GenPackage package of IPackage.包体
func (*GenPackage) AddFuncStr ¶
func (p *GenPackage) AddFuncStr(src string)
AddFuncStr add func coding string.添加函数串
func (*GenPackage) AddImport ¶
func (p *GenPackage) AddImport(imp string)
AddImport Add import by type.通过类型添加import
func (*GenPackage) AddStruct ¶
func (p *GenPackage) AddStruct(st GenStruct)
AddStruct Add a structure.添加一个结构体
func (*GenPackage) Generate ¶
func (p *GenPackage) Generate() string
Generate Get the result data.获取结果数据
func (*GenPackage) SetPackage ¶
func (p *GenPackage) SetPackage(pname string)
SetPackage Defining package names.定义包名
type GenStruct ¶
type GenStruct struct { SQLBuildStr string // Create SQL statements.创建sql语句 TableName string // table_name.表名 Name string // name.名字 Notes string // notes.注释 Em []GenElement // em.元素组合 }
GenStruct struct of IStruct .结构体
func (*GenStruct) AddElement ¶
func (s *GenStruct) AddElement(e ...GenElement)
AddElement Add one or more elements.添加一个/或多个元素
func (*GenStruct) GenerateColumnName ¶
GenerateColumnName generate column name . 生成列名
func (*GenStruct) GenerateTableName ¶
GenerateTableName generate table name .生成表名
func (*GenStruct) GeneratesColor ¶
\033[3%d;%dm -%d;%d-colors!\033[0m\n GeneratesColor Get the result data on color.获取结果数据 带颜色
func (*GenStruct) SetCreatTableStr ¶
SetCreatTableStr Set up SQL create statement, backup use setup create statement, backup use.设置创建语句,备份使用
func (*GenStruct) SetStructName ¶
SetStructName Setting the name of struct.设置struct名字
func (*GenStruct) SetTableName ¶
SetTableName Setting the name of struct.设置struct名字