mirror of
https://github.com/scroll-tech/scroll.git
synced 2026-01-14 08:28:02 -05:00
25 lines
445 B
Go
25 lines
445 B
Go
package controller
|
|
|
|
import (
|
|
"sync"
|
|
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
var (
|
|
// HistoryCtrler is controller instance
|
|
HistoryCtrler *HistoryController
|
|
// BatchCtrler is controller instance
|
|
BatchCtrler *BatchController
|
|
|
|
initControllerOnce sync.Once
|
|
)
|
|
|
|
// InitController inits Controller with database
|
|
func InitController(db *gorm.DB) {
|
|
initControllerOnce.Do(func() {
|
|
HistoryCtrler = NewHistoryController(db)
|
|
BatchCtrler = NewBatchController(db)
|
|
})
|
|
}
|