add so interfaces can see task feedback
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user