Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DealFilePath ¶ added in v1.4.1
DealFilePath back save path and package name
func GenerateMySQL ¶
func GenerateMySQL(c Config)
func UpperCamel ¶ added in v1.4.1
func Write ¶ added in v1.4.1
func Write(f FileInfo, data []StructInfo, oneFile bool)
Write struct information to .go file
Types ¶
type Config ¶ added in v1.4.1
type Config struct {
// connect mysql, [user]:[password]@tcp([host]:[port])/[database]?parseTime=true
ConnStr string
// database name
Database string
// file, relative path
SavePath string
// json tag
IsGenJsonTag bool
// Generate one file or files by table
IsGenInOneFile bool
// Generate simple database field information like: "int unsigned not null"
// value 1:not generate; 2:simple info
GenDBInfoType int
// json tag type. The necessary conditions:IsGenJsonTag:true.
// 1.UserName 2.userName 3.user_name 4.user-name
JsonTagType int
// sql of creating table in the database
IsGenCreateSQL bool
// simple crud function
IsGenFunction bool
// cache simple model info to redis, Ps. IsGenCreateSQL = true
IsGenFunctionWithCache bool
// custom type relationships will be preferred.
// the key is the database type, The value is the golang type
CustomType map[string]string
}
Config config information
Click to show internal directories.
Click to hide internal directories.