move InterfacetoType to types and deleted types as it was now empty

This commit is contained in:
Robin Olsen
2026-02-18 14:28:58 +01:00
parent e8fffba752
commit 5c74cd15ba
2 changed files with 16 additions and 27 deletions

View File

@@ -2,7 +2,10 @@ package tasks
import (
"github.com/LazyBachelor/LazyPM/internal/service"
"github.com/LazyBachelor/LazyPM/pkg/cli/repl"
"github.com/LazyBachelor/LazyPM/pkg/task"
"github.com/LazyBachelor/LazyPM/pkg/tui"
"github.com/LazyBachelor/LazyPM/pkg/web"
)
func init() {
@@ -14,3 +17,16 @@ func init() {
return NewCodingTask(svc)
})
}
func InterfaceToType(it task.Interface) task.InterfaceType {
switch it.(type) {
case *repl.REPL:
return task.InterfaceCLI
case *tui.Tui:
return task.InterfaceTUI
case *web.Web:
return task.InterfaceWeb
default:
return task.InterfaceType("unknown")
}
}

View File

@@ -1,27 +0,0 @@
package tasks
import (
"github.com/LazyBachelor/LazyPM/pkg/cli/repl"
"github.com/LazyBachelor/LazyPM/pkg/task"
"github.com/LazyBachelor/LazyPM/pkg/tui"
"github.com/LazyBachelor/LazyPM/pkg/web"
)
const (
InterfaceTUI task.InterfaceType = "tui"
InterfaceCLI task.InterfaceType = "repl"
InterfaceWeb task.InterfaceType = "web"
)
func InterfaceToType(it task.Interface) task.InterfaceType {
switch it.(type) {
case *repl.REPL:
return InterfaceCLI
case *tui.Tui:
return InterfaceTUI
case *web.Web:
return InterfaceWeb
default:
return "unknown"
}
}