add so interfaces can see task feedback

This commit is contained in:
Robin Olsen
2026-02-17 13:04:03 +01:00
parent 235275d911
commit 68af436a3f
3 changed files with 90 additions and 9 deletions

View File

@@ -3,6 +3,7 @@ package task
import (
"context"
"errors"
"time"
"github.com/LazyBachelor/LazyPM/internal/service"
)
@@ -18,3 +19,19 @@ type Interface interface {
type ConfigFunc func() TaskConfig
type ValidateFunc func(context.Context, *service.Services) (ok bool, err error)
type DbStateFunc func(context.Context, *service.Services) error
type ValidationFeedback struct {
Success bool
Message string
Timestamp time.Time
}
type ValidationObserver interface {
OnValidationUpdate(feedback ValidationFeedback)
OnTaskComplete()
}
type ValidatedInterface interface {
Interface
SetChannels(feedbackChan chan ValidationFeedback, quitChan chan bool)
}