Documentation ¶
Index ¶
- Variables
- func GetDBTag() string
- func GetIsColumnName() bool
- func GetIsDev() bool
- func GetIsForeignKey() bool
- func GetIsGUI() bool
- func GetIsNullToPoint() bool
- func GetIsOutFileByTableName() bool
- func GetIsOutFunc() bool
- func GetIsOutSQL() bool
- func GetIsTableName() bool
- func GetIsWEBTag() bool
- func GetIsWebTagPkHidden() bool
- func GetLG() string
- func GetMysqlConStr() string
- func GetOriginTableNames() string
- func GetOutDir() string
- func GetOutFileName() string
- func GetSelfTypeDefine() map[string]string
- func GetSimple() bool
- func GetTableNames() string
- func GetTablePrefix() string
- func GetURLTag() string
- func GetWebTagType() int
- func InitFile(filename string) error
- func IsRunTesting() bool
- func SaveToFile() error
- func SetDBTag(s string)
- func SetForeignKey(b bool)
- func SetIsColumnName(isColumnName bool)
- func SetIsDev(b bool)
- func SetIsGUI(b bool)
- func SetIsNullToPoint(b bool)
- func SetIsOutFileByTableName(isOutFileByTableName bool)
- func SetIsOutFunc(b bool)
- func SetIsOutSQL(b bool)
- func SetIsTableName(b bool)
- func SetIsWEBTag(b bool)
- func SetLG(s string)
- func SetMysqlDbInfo(info *DBInfo)
- func SetOutDir(outDir string)
- func SetOutFileName(s string)
- func SetSelfTypeDefine(data map[string]string)
- func SetSimple(b bool)
- func SetTableNames(tableNames string)
- func SetTablePrefix(t string)
- func SetURLTag(s string)
- func SetWebTagType(i int)
- type CfgBase
- type Config
- type DBInfo
Constants ¶
This section is empty.
Variables ¶
var Map = Config{ CfgBase: CfgBase{ IsDev: false, }, Database: DBInfo{ Host: "127.0.0.1", Port: 3306, Username: "root", Password: "root", Database: "test", }, OutDir: "./model", URLTag: "json", Language: "中 文", DbTag: "gorm", Simple: false, IsWEBTag: false, IsForeignKey: true, IsOutSQL: false, IsOutFunc: false, IsGUI: false, TablePrefix: "", SelfTypeDef: make(map[string]string), WebTagType: 0, TableNames: "", IsColumnName: false, IsOutFileByTableName: false, }
Functions ¶
func GetIsColumnName ¶
func GetIsColumnName() bool
GetIsColumnName get gen columnName config . 获取生成列名的config
func GetIsNullToPoint ¶
func GetIsNullToPoint() bool
GetIsNullToPoint get if with null to porint in sturct
func GetIsOutFileByTableName ¶
func GetIsOutFileByTableName() bool
GetIsOutFileByTableName get gen columnName config . 设置是否根据表名生成文件
func GetMysqlConStr ¶
func GetMysqlConStr() string
GetMysqlConStr Get MySQL connection string.获取mysql 连接字符串
func GetOriginTableNames ¶
func GetOriginTableNames() string
GetOriginTableNames get origin tableNames. 获取原始的设置的表名
func GetTableNames ¶
func GetTableNames() string
GetTableNames get format tableNames by config. 获取格式化后设置的表名
func IsRunTesting ¶
func IsRunTesting() bool
IsRunTesting Determine whether to use it in a test environment.判断是否在测试环境下使用
func SetIsColumnName ¶
func SetIsColumnName(isColumnName bool)
SetIsColumnName set gen ColumnName config. 设置生成列名的config
func SetIsNullToPoint ¶
func SetIsNullToPoint(b bool)
SetIsNullToPoint if with null to porint in struct
func SetIsOutFileByTableName ¶
func SetIsOutFileByTableName(isOutFileByTableName bool)
SetIsOutFileByTableName set gen ColumnName config. 设置是否根据表名生成文件
func SetMysqlDbInfo ¶
func SetMysqlDbInfo(info *DBInfo)
SetMysqlDbInfo Update MySQL configuration information
Types ¶
type CfgBase ¶
type CfgBase struct { // SerialNumber string `json:"serial_number" yaml:"serial_number"` // version.版本号 // ServiceName string `json:"service_name" yaml:"service_name"` // service name .service名字 // ServiceDisplayname string `json:"service_displayname" yaml:"service_displayname"` // display name .显示名 // SerciceDesc string `json:"sercice_desc" yaml:"sercice_desc"` // sercice desc .service描述 IsDev bool `json:"is_dev" yaml:"is_dev"` // Is it a development version?是否是开发版本 }
CfgBase base config struct
type Config ¶
type Config struct { CfgBase `yaml:"base"` Database DBInfo `yaml:"database"` OutDir string `yaml:"out_dir"` URLTag string `yaml:"url_tag"` // url tag Language string `yaml:"language"` // language DbTag string `yaml:"db_tag"` // 数据库标签(gormt,db) Simple bool `yaml:"simple"` IsWEBTag bool `yaml:"is_web_tag"` IsWebTagPkHidden bool `yaml:"is_web_tag_pk_hidden"` // web标记是否隐藏主键 IsForeignKey bool `yaml:"is_foreign_key"` IsOutSQL bool `yaml:"is_out_sql"` IsOutFunc bool `yaml:"is_out_func"` IsGUI bool `yaml:"is_gui"` // IsTableName bool `yaml:"is_table_name"` IsNullToPoint bool `yaml:"is_null_to_point"` // null to porint TablePrefix string `yaml:"table_prefix"` // 表前缀 SelfTypeDef map[string]string `yaml:"self_type_define"` OutFileName string `yaml:"out_file_name"` WebTagType int `yaml:"web_tag_type"` // 默认小驼峰 TableNames string `yaml:"table_names"` // 表名(多个表名用","隔开) IsColumnName bool `yaml:"is_column_name"` //是否输出列名 IsOutFileByTableName bool `yaml:"is_out_file_by_table_name"` //是否根据表名生成文件(多个表名生成多个文件) }
Config custom config struct