mirror of
https://github.com/scroll-tech/scroll.git
synced 2026-01-08 21:48:11 -05:00
Co-authored-by: georgehao <georgehao@users.noreply.github.com> Co-authored-by: Péter Garamvölgyi <peter@scroll.io>
31 lines
656 B
Go
31 lines
656 B
Go
package controller
|
|
|
|
import (
|
|
"sync"
|
|
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
var (
|
|
// HistoryCtrler is controller instance
|
|
HistoryCtrler *HistoryController
|
|
// BatchCtrler is controller instance
|
|
BatchCtrler *BatchController
|
|
// HealthCheck the health check controller
|
|
HealthCheck *HealthCheckController
|
|
// Ready the ready controller
|
|
Ready *ReadyController
|
|
|
|
initControllerOnce sync.Once
|
|
)
|
|
|
|
// InitController inits Controller with database
|
|
func InitController(db *gorm.DB) {
|
|
initControllerOnce.Do(func() {
|
|
HistoryCtrler = NewHistoryController(db)
|
|
BatchCtrler = NewBatchController(db)
|
|
HealthCheck = NewHealthCheckController(db)
|
|
Ready = NewReadyController()
|
|
})
|
|
}
|