Documentation ¶
Index ¶
- Constants
- func AddTableStructToTpl(cfg ConnConfig)
- func CreateDoc()
- func CreateProject(force, newdoc bool)
- type ConnConfig
- type Model
- type MysqlConfig
- type Project
- func (t Project) CallHandlerList() []*handler
- func (t Project) CallHandlerString(ctnFn func(*handler) string) string
- func (p *Project) Generator(force, newdoc bool)
- func (t Project) HandlerList() []*handler
- func (t Project) Parse() *tplInfo
- func (t Project) PushHandlerList() []*handler
- func (t Project) PushHandlerString(ctnFn func(*handler) string) string
- func (t Project) RouterString(groupName string) string
- func (t Project) TypeImportString() string
- func (t Project) TypesString() string
Constants ¶
View Source
const ( // API_PULL_ROUTER name of the interface used to register the pull route in the template API_PULL_ROUTER = "__API_PULL__" // API_PUSH_ROUTER name of the interface used to register the push route in the template API_PUSH_ROUTER = "__API_PUSH__" // 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 MicroGenLock = "__tp-micro__gen__.lock"
MicroGenLock the file is used to markup generated project
View Source
const MicroTpl = "__tp-micro__tpl__.go"
MicroTpl 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) CallHandlerList ¶
func (t Project) CallHandlerList() []*handler
func (Project) CallHandlerString ¶
func (Project) HandlerList ¶
func (t Project) HandlerList() []*handler
func (Project) PushHandlerList ¶
func (t Project) PushHandlerList() []*handler
func (Project) PushHandlerString ¶
func (Project) RouterString ¶
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.