add some helpers to simplify task creation

This commit is contained in:
Robin Olsen
2026-02-18 19:32:17 +01:00
parent c85023cb78
commit 4d6b70fb6a
5 changed files with 126 additions and 78 deletions

View File

@@ -9,21 +9,12 @@ import (
)
type TaskConfig = service.Config
var ErrUserQuit = fmt.Errorf("user quit")
type InterfaceType string
type Interface interface {
Run(context.Context, TaskConfig) error
}
type InterfaceType string
const (
InterfaceTUI InterfaceType = "tui"
InterfaceCLI InterfaceType = "repl"
InterfaceWeb InterfaceType = "web"
)
type Tasker interface {
Config() TaskConfig
Details() taskui.TaskDetails
@@ -41,3 +32,5 @@ type ValidatedInterface interface {
Interface
SetChannels(feedbackChan chan ValidationFeedback, quitChan chan bool)
}
var ErrUserQuit = fmt.Errorf("user quit")