add init file for better separation

This commit is contained in:
Robin Olsen
2026-02-12 22:07:03 +01:00
parent 412b2fe0c2
commit cbfbb6a0bb

32
cmd/survey/init.go Normal file
View File

@@ -0,0 +1,32 @@
package main
import (
"context"
"github.com/LazyBachelor/LazyPM/cmd/survey/tasks"
"github.com/LazyBachelor/LazyPM/internal/service"
"github.com/LazyBachelor/LazyPM/pkg/cli/repl"
"github.com/LazyBachelor/LazyPM/pkg/tui"
"github.com/LazyBachelor/LazyPM/pkg/web"
)
func initializeServices(ctx context.Context) (*service.Services, func(), error) {
config := service.Config{
IssuePrefix: "pm",
BeadsDBPath: "./.pm/db.db",
StatisticsStoragePath: "./.pm/stats.json",
WebAddress: "localhost:8080",
}
return service.NewServices(ctx, config)
}
func initTasks() []*tasks.Task {
return []*tasks.Task{
tasks.NewCreateIssueTask(),
tasks.NewCreateIssueTask(),
}
}
func initInterfaces() []tasks.Interface {
return []tasks.Interface{repl.NewRepl(), tui.NewTui(), web.NewWeb()}
}