mirror of
https://github.com/scroll-tech/scroll.git
synced 2026-01-14 00:18:03 -05:00
Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com> Co-authored-by: HAOYUatHZ <haoyu@protonmail.com>
34 lines
807 B
Go
34 lines
807 B
Go
package api
|
|
|
|
import (
|
|
"sync"
|
|
|
|
"github.com/prometheus/client_golang/prometheus"
|
|
"gorm.io/gorm"
|
|
|
|
"scroll-tech/coordinator/internal/config"
|
|
)
|
|
|
|
var (
|
|
// GetTask the prover task controller
|
|
GetTask *GetTaskController
|
|
// SubmitProof the submit proof controller
|
|
SubmitProof *SubmitProofController
|
|
// HealthCheck the health check controller
|
|
HealthCheck *HealthCheckController
|
|
// Auth the auth controller
|
|
Auth *AuthController
|
|
|
|
initControllerOnce sync.Once
|
|
)
|
|
|
|
// InitController inits Controller with database
|
|
func InitController(cfg *config.Config, db *gorm.DB, reg prometheus.Registerer) {
|
|
initControllerOnce.Do(func() {
|
|
Auth = NewAuthController(db)
|
|
HealthCheck = NewHealthCheckController()
|
|
GetTask = NewGetTaskController(cfg, db, reg)
|
|
SubmitProof = NewSubmitProofController(cfg, db, reg)
|
|
})
|
|
}
|