Documentation
¶
Index ¶
Constants ¶
View Source
const ( // MYSQL_MODEL name of the struct used to create mysql model MYSQL_MODEL = "__MYSQL_MODEL__" // MONGO_MODEL name of the struct used to create mongo model MONGO_MODEL = "__MONGO_MODEL__" )
View Source
const ModelGenLock = "__model__gen__.lock"
ModelGenLock the file is used to markup generated project
View Source
const ModelTpl = "__model__tpl__.go"
ModelTpl template file name
Variables ¶
This section is empty.
Functions ¶
func AddTableStructToTpl ¶
func AddTableStructToTpl(cfg ConnConfig)
AddTableStructToTpl adds struct to tpl
Types ¶
type ConnConfig ¶
type ConnConfig struct {
MysqlConfig
Tables []string
SshHost string
SshPort string
SshUser string
}
ConnConfig connection config
type Model ¶
type Model struct {
ModelStyle string
PrimaryFields []*field
UniqueFields []*field
Fields []*field
IsDefaultPrimary bool
Doc string
Name string
SnakeName string
LowerFirstName string
LowerFirstLetter string
NameSql string
QuerySql [2]string
UpdateSql string
UpsertSqlSuffix string
// contains filtered or unexported fields
}
type MysqlConfig ¶
MysqlConfig config
func (MysqlConfig) ConnString ¶
func (c MysqlConfig) ConnString() string
ConnString returns the connection string.
type Project ¶
Project project Information
func (Project) TypeImportString ¶
func (t Project) TypeImportString() string
func (Project) TypesString ¶
func (t Project) TypesString() string
Click to show internal directories.
Click to hide internal directories.