Documentation
¶
Index ¶
- Constants
- Variables
- func AppendEntity(entity ...interface{})
- func ApplyMigrate() error
- func DefaulViewSql(tablePrefix, view, query string) string
- func DoCleanup(settingkey string, tables []string, col string, duration string) interface{}
- func InitDB(sub string, logger *zap.Logger) *gorm.DB
- func InitDefaultDB(logger *zap.Logger) *gorm.DB
- func InitMysqlViews(tx *gorm.DB, logger *zap.Logger) error
- func InitScheduleCleanupJob(settingkey string) interface{}
- func MigrateTableAndView(db *gorm.DB, logger *zap.Logger)
- func SessionWithConfig(slowThreshold time.Duration, ignoredNotFound bool) *gorm.Session
- type CleanupService
- type DBCleanupReq
- type DBCronJob
- type GetViewSql
- type HealthController
- type OrmDialector
Constants ¶
View Source
const ( KeyInitDB = ginshared.KeyInitDB KeyTablePrefix = "database.tablePrefix" )
View Source
const ( HealthURIKey = "healthz" HealthURIValue = "/healthz" )
View Source
const ViewMysqlTmp = "CREATE OR REPLACE ALGORITHM = UNDEFINED VIEW %s%s AS %s"
Variables ¶
View Source
var DialectorMap = make(map[string]OrmDialector)
View Source
var ViewMap = make(map[string]GetViewSql)
Functions ¶
func AppendEntity ¶ added in v0.4.11
func AppendEntity(entity ...interface{})
func ApplyMigrate ¶ added in v0.5.0
func ApplyMigrate() error
func DefaulViewSql ¶ added in v0.4.8
func InitScheduleCleanupJob ¶ added in v0.4.14
func InitScheduleCleanupJob(settingkey string) interface{}
func MigrateTableAndView ¶ added in v0.4.11
Types ¶
type CleanupService ¶ added in v0.2.6
func (*CleanupService) Cleanup ¶ added in v0.2.6
func (cs *CleanupService) Cleanup(req *DBCleanupReq) error
func (*CleanupService) GetDefaultRequest ¶ added in v0.2.6
func (cs *CleanupService) GetDefaultRequest() *DBCleanupReq
func (*CleanupService) RegConnection ¶ added in v0.2.6
func (cs *CleanupService) RegConnection(name string, db *gorm.DB)
type DBCleanupReq ¶ added in v0.2.6
type DBCronJob ¶ added in v0.1.8
type GetViewSql ¶ added in v0.4.8
type HealthController ¶
type HealthController struct {
// contains filtered or unexported fields
}
func (*HealthController) Ping ¶
func (h *HealthController) Ping(c *gin.Context)
type OrmDialector ¶ added in v0.0.5
Click to show internal directories.
Click to hide internal directories.