Files
GoMFT/internal/web/handlers/handler.go
T
StarFleetCPTN 3193bf5111 feat: Update dependencies and enhance job run details template
- Add new dependencies: `github.com/joho/godotenv`, `github.com/stretchr/testify`, and `gopkg.in/natefinch/lumberjack.v2`
- Remove indirect dependency on `github.com/joho/godotenv`
- Refactor JobRunDetails template to separate content rendering for improved testing
- Enhance error message display in JobRunDetails template
- Introduce new test files for JWT and password functionalities
- Add comprehensive tests for database operations and error handling
2025-03-13 18:40:40 -07:00

36 lines
898 B
Go

package handlers
import (
"time"
"github.com/starfleetcptn/gomft/internal/db"
"github.com/starfleetcptn/gomft/internal/email"
"github.com/starfleetcptn/gomft/internal/scheduler"
)
// Handlers contains all the dependencies needed by the handlers
type Handlers struct {
DB *db.DB
Scheduler scheduler.SchedulerInterface
JWTSecret string
StartTime time.Time
DBPath string
BackupDir string
LogsDir string
Email *email.Service
}
// NewHandlers creates a new Handlers instance
func NewHandlers(database *db.DB, scheduler scheduler.SchedulerInterface, jwtSecret string, dbPath string, backupDir string, logsDir string, emailService *email.Service) *Handlers {
return &Handlers{
DB: database,
Scheduler: scheduler,
JWTSecret: jwtSecret,
StartTime: time.Now(),
DBPath: dbPath,
BackupDir: backupDir,
LogsDir: logsDir,
Email: emailService,
}
}