refactor to use app package instead of service

refactor app to be composable
This commit is contained in:
Robin Olsen
2026-02-28 23:30:31 +01:00
parent ba4d3df669
commit aabce0b0b2
56 changed files with 385 additions and 279 deletions

View File

@@ -9,9 +9,9 @@ import (
"strings"
"time"
"github.com/LazyBachelor/LazyPM/internal/app"
"github.com/LazyBachelor/LazyPM/internal/models"
"github.com/LazyBachelor/LazyPM/internal/service"
"github.com/LazyBachelor/LazyPM/internal/utils"
"github.com/LazyBachelor/LazyPM/internal/utils/browser"
"github.com/LazyBachelor/LazyPM/pkg/web/handler"
"github.com/LazyBachelor/LazyPM/pkg/web/server"
)
@@ -32,7 +32,7 @@ func New() *Web {
var assets embed.FS
func (w *Web) Run(ctx context.Context, config Config) error {
app, cleanup, err := service.NewApp(ctx, config)
app, cleanup, err := app.New(ctx, config)
if err != nil {
return err
}
@@ -52,7 +52,7 @@ func (w *Web) Run(ctx context.Context, config Config) error {
address = "http://localhost" + address
}
err = utils.OpenBrowser(address)
err = browser.Open(address)
if err != nil {
return fmt.Errorf("failed to open browser: %w", err)
}