Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CleanupService ¶
type CleanupService struct {
// contains filtered or unexported fields
}
func NewCleanupService ¶
func NewCleanupService(jobService JobService, interval, maxAge time.Duration) *CleanupService
func (*CleanupService) Start ¶
func (c *CleanupService) Start(ctx context.Context)
func (*CleanupService) Stop ¶
func (c *CleanupService) Stop()
type JobRepository ¶
type JobRepository interface {
Create(ctx context.Context, job *models.GenerationJob) error
GetByID(ctx context.Context, id uuid.UUID) (*models.GenerationJob, error)
List(ctx context.Context, filters JobFilters) ([]*models.GenerationJob, error)
Update(ctx context.Context, job *models.GenerationJob) error
UpdateStatus(ctx context.Context, id uuid.UUID, status models.JobStatus, progress int, errorMsg string) error
DeleteOldJobs(ctx context.Context, olderThan time.Time) (int64, error)
}
func NewJobRepository ¶
func NewJobRepository(db *gorm.DB) JobRepository
type JobService ¶
type JobService interface {
CreateJob(ctx context.Context, req *models.GenerationRequest) (*models.GenerationJob, error)
GetJob(ctx context.Context, id uuid.UUID) (*models.GenerationJob, error)
ListJobs(ctx context.Context, status string, courseID *uuid.UUID) ([]*models.GenerationJob, error)
UpdateJobStatus(ctx context.Context, id uuid.UUID, status models.JobStatus, progress int, errorMsg string) error
AddJobLog(ctx context.Context, id uuid.UUID, logEntry string) error
CleanupOldJobs(ctx context.Context, maxAge time.Duration) (int64, error)
}
func NewJobServiceImpl ¶
func NewJobServiceImpl(repo JobRepository) JobService
Click to show internal directories.
Click to hide internal directories.