move around types for better understanding
This commit is contained in:
@@ -4,26 +4,14 @@ import (
|
||||
"context"
|
||||
|
||||
"github.com/LazyBachelor/LazyPM/internal/service"
|
||||
tea "github.com/charmbracelet/bubbletea"
|
||||
)
|
||||
|
||||
type TaskConfig = service.Config
|
||||
|
||||
type Interface interface {
|
||||
Run(context.Context, service.Config) error
|
||||
Run(context.Context, TaskConfig) error
|
||||
}
|
||||
|
||||
type ConfigFunc func() TaskConfig
|
||||
type ValidateFunc func(context.Context, *service.Services) (ok bool, err error)
|
||||
type DbStateFunc func(context.Context, *service.Services) error
|
||||
|
||||
type Task struct {
|
||||
interfaceType Interface
|
||||
aboutScreen tea.Model
|
||||
questionnaire tea.Model
|
||||
|
||||
validateFunc ValidateFunc
|
||||
dbStateFunc DbStateFunc
|
||||
}
|
||||
|
||||
type TaskList struct {
|
||||
Todo []*Task
|
||||
Done []*Task
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user