Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultPath = "conf/table.yaml"
View Source
var TableConfigs = new(config)
Functions ¶
func LoadConfigFromYaml ¶
func LoadConfigFromYaml(configPath string)
func ParseConfigByViper ¶
func ParseConfigByViper(configPath, configName, configType string)
Types ¶
type DBTableInfo ¶
type DBTableInfo struct { DBName string `json:"db_name" yaml:"db_name"` DBType string `json:"db_type" yaml:"db_type"` DSN string `json:"dsn" yaml:"dsn"` OnlyModel bool `json:"only_model" yaml:"only_model"` GenHook bool `json:"gen_hook" yaml:"gen_hook"` ServicePath string `json:"service_path" yaml:"service_path"` ModelPath string `json:"model_path" yaml:"model_path"` DaoPath string `json:"dao_path" yaml:"dao_path"` UseSQLNullable bool `json:"use_sql_nullable" yaml:"use_sql_nullable"` Tables []*TableInfo `json:"tables" yaml:"tables"` ModelModule string DaoModule string // DSN 可选 Host string `json:"host" yaml:"host"` Port int `json:"port" yaml:"port"` User string `json:"user" yaml:"user"` Password string `json:"password" yaml:"password"` Database string `json:"database" yaml:"database"` }
DBTableInfo 连接配置
func (*DBTableInfo) GenDSN ¶
func (c *DBTableInfo) GenDSN() (dsn string)
Click to show internal directories.
Click to hide internal directories.