Documentation
¶
Index ¶
- func Create[T interface{}](add T) error
- func DB() *gorm.DB
- func DBWithGormMysql(reg *register.Register)
- func Delete[T interface{}](model T, args interface{}) error
- func Select[T interface{}](model T, args interface{}) (T, error)
- func SelectAll[T interface{}](model T, args interface{}) ([]T, error)
- func SelectPage[T interface{}](model T, args interface{}, page, limit int) ([]T, int64, error)
- func Update[T interface{}](model T, args interface{}, update map[string]interface{}) error
- type GormMysqlComponent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DBWithGormMysql ¶
func SelectPage ¶
Types ¶
type GormMysqlComponent ¶
type GormMysqlComponent struct { Host string `toml:"host" json:"host"` Port int `toml:"port" json:"port"` User string `toml:"user" json:"user"` Passwd string `toml:"passwd" json:"passwd"` DbName string `toml:"dbname" json:"dbname"` MaxIdleConns int `toml:"max_idle_conns" json:"max_idle_conns"` MaxOpenConns int `toml:"max_open_conns" json:"max_open_conns"` ConnMaxIdletime int `toml:"conn_max_idletime" json:"conn_max_idletime"` ConnMaxLifetime int `toml:"conn_max_lifetime" json:"conn_max_lifetime"` // contains filtered or unexported fields }
func (*GormMysqlComponent) Init ¶
func (gmc *GormMysqlComponent) Init() error
func (*GormMysqlComponent) Name ¶
func (gmc *GormMysqlComponent) Name() string
func (*GormMysqlComponent) Ready ¶
func (gmc *GormMysqlComponent) Ready()
Click to show internal directories.
Click to hide internal directories.