Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DialectorByDB ¶
DialectorByDB return gorm.Dialector by sql.DB
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config contain database connect options and gorm options
type ConfigOpt ¶
type ConfigOpt func(*Config)
ConfigOpt set Config function
func WithGormOpts ¶
WithGormOpts set Config gormOpts
type DsnInfo ¶
type DsnInfo struct { User string Passwd string Host string Port uint32 DbName string Params url.Values }
DsnInfo user:pass@tcp(127.0.0.1:3306)/dbname?charset=utf8mb4&parseTime=True&loc=Local
type OptionFunc ¶
type OptionFunc func(opts *Options)
OptionFunc set Options function
func WithConnMaxLifetime ¶
func WithConnMaxLifetime(connmaxLifetime time.Duration) OptionFunc
WithConnMaxLifetime set connMaxLifetime
func WithMaxIdleConns ¶
func WithMaxIdleConns(maxIdleConns int) OptionFunc
WithMaxIdleConns set maxIdleConns
func WithMaxOpenConns ¶
func WithMaxOpenConns(maxOpenConns int) OptionFunc
WithMaxOpenConns set maxOpenConns
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
Options connect database options
type OrmGenCmd ¶
type OrmGenCmd struct { DataTyMap map[string]func(string) string ModelOpts []gen.ModelOpt GenModels []GenModel Dialector gorm.Dialector Cfg gen.Config }
OrmGenCmd generate orm model and repository command
func (*OrmGenCmd) GetShutdownFunc ¶
GetShutdownFunc implement GetShutdownFunc method of cmd.Commander
func (*OrmGenCmd) RegShutdownFunc ¶
RegShutdownFunc implement RegShutdownFunc method of cmd.Commander
Click to show internal directories.
Click to hide internal directories.