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"` Relations []string `json:"relations"` Detail string `json:"detail"` }
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
Click to show internal directories.
Click to hide internal directories.