Documentation ¶
Index ¶
Constants ¶
View Source
const ( // TypeGormModel - type gorm model gen TypeGormModel = "gorm_model" // TypeBeegoModel - type beego model gen TypeBeegoModel = "beego_model" // TypeService - type service gen TypeService = "service" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Package string `json:"package"` GenPath string `json:"gen_path"` AllInOne bool `json:"all_in_one"` ModelCfg ModelGenConfig `json:"model_cfg"` ServiceCfg ServiceGenConfig `json:"service_cfg"` }
Config - init config
type Generator ¶
type Generator interface { // Gen - gen file Gen() error // start gc routine based on config settings. StartAndGC(config Config) error }
Generator interface contains all behaviors for model generator adapter.
type Instance ¶
type Instance func() Generator
Instance is a function create a new Generator Instance
type Item ¶
type Item struct { Name string `json:"name"` TableName string `json:"table_name"` Relations []string `json:"relations"` Detail string `json:"detail"` Primary Primary `json:"primary"` DisableMode bool `json:"disable_mode"` Extend map[string]interface{} `json:"extend"` }
Item - gen item
type ModelGenConfig ¶ added in v0.0.6
type ModelGenConfig struct { Items []Item `json:"items"` MaxIdleConns int64 `json:"max_idle_conns"` MaxOpenConns int64 `json:"set_max_open_conns"` }
ModelGenConfig - model config
type SItem ¶ added in v0.0.6
type SItem struct { Req interface{} `json:"req"` Dst interface{} `json:"dst"` Index int64 `json:"index"` CheckApp bool `json:"check_app"` DisableRPC bool `json:"disable_rpc"` ViewCfg ViewConfig `json:"view_cfg"` Extend map[string]interface{} `json:"extend"` }
SItem - service config item
Click to show internal directories.
Click to hide internal directories.